ndn-lite
Functions
sign-on-basic-ecc-256-sec.h File Reference
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Functions

int sign_on_basic_ecc_256_gen_sha256_hash (const uint8_t *payload, uint32_t payload_len, uint8_t *output)
 Generate a sha256 hash. More...
 
int sign_on_basic_ecc_256_decrypt_kd_pri (uint8_t *key, uint32_t key_len, const uint8_t *encrypted_payload, uint32_t encrypted_payload_len, uint8_t *decrypted_payload, uint32_t decrypted_payload_buf_len, uint32_t *decrypted_payload_len)
 The KD key pair private key should be encrypted using AES CBC with PCS5 padding. More...
 
int sign_on_basic_ecc_256_vrfy_btstrp_rqst_rspns_sig (const uint8_t *payload, uint32_t payload_len, const uint8_t *sig, uint32_t sig_len, const uint8_t *key, uint32_t key_len)
 The bootstrapping request response signature should be an hmac sha256 signature. More...
 
int sign_on_basic_ecc_256_vrfy_cert_rqst_rspns_sig (const uint8_t *payload, uint32_t payload_len, const uint8_t *sig, uint32_t sig_len, const uint8_t *key, uint32_t key_len)
 The certificate request response signature should be an hmac sha256 signature. More...
 
int sign_on_basic_ecc_256_gen_btstrp_rqst_sig (const uint8_t *pri_key, const uint8_t *payload, uint32_t payload_len, uint8_t *output_buf, uint32_t output_buf_len, uint32_t *output_len)
 The bootstrapping request signature should be an ecdsa sha256 signature. More...
 
int sign_on_basic_ecc_256_gen_cert_rqst_sig (const uint8_t *pri_key, const uint8_t *payload, uint32_t payload_len, uint8_t *output_buf, uint32_t output_buf_len, uint32_t *output_len)
 The certificate request signature should be an ecdsa sha256 signature. More...
 
int sign_on_basic_ecc_256_gen_fin_msg_sig (const uint8_t *pri_key, const uint8_t *payload, uint32_t payload_len, uint8_t *output_buf, uint32_t output_buf_len, uint32_t *output_len)
 The finish message signature should be an ecdsa sha256 signature. More...
 
int sign_on_basic_ecc_256_gen_n1_keypair (uint8_t *pub_key_buf, uint32_t pub_key_buf_len, uint32_t *pub_key_output_len, uint8_t *pri_key_buf, uint32_t pri_key_buf_len, uint32_t *pri_key_output_len)
 The N1 key pair should be a pair of ecc keys, based on the "secp256r1" curve. More...
 
int sign_on_basic_ecc_256_gen_kt (const uint8_t *pub_key, uint32_t pub_key_len, const uint8_t *pri_key, uint32_t pri_key_len, uint8_t *output_buf, uint32_t output_buf_len, uint32_t *output_len)
 The keys used to generate KT should be ecc keys, based on the "secp256r1" curve. More...
 

Function Documentation

◆ sign_on_basic_ecc_256_decrypt_kd_pri()

int sign_on_basic_ecc_256_decrypt_kd_pri ( uint8_t *  key,
uint32_t  key_len,
const uint8_t *  encrypted_payload,
uint32_t  encrypted_payload_len,
uint8_t *  decrypted_payload,
uint32_t  decrypted_payload_buf_len,
uint32_t *  decrypted_payload_len 
)

The KD key pair private key should be encrypted using AES CBC with PCS5 padding.

Parameters
[in]keyThe format of key should be the same format used and generated in the micro-ecc library. The unecrypted KD key pair private key should be in the same format generated and used in the micro-ecc library.

◆ sign_on_basic_ecc_256_gen_btstrp_rqst_sig()

int sign_on_basic_ecc_256_gen_btstrp_rqst_sig ( const uint8_t *  pri_key,
const uint8_t *  payload,
uint32_t  payload_len,
uint8_t *  output_buf,
uint32_t  output_buf_len,
uint32_t *  output_len 
)

The bootstrapping request signature should be an ecdsa sha256 signature.

The format of the signature will be the same as that generated by the micro-ecc library.

Parameters
[in]pri_keyThe format of pri_key should be the same format used and generated in the micro-ecc library.

◆ sign_on_basic_ecc_256_gen_cert_rqst_sig()

int sign_on_basic_ecc_256_gen_cert_rqst_sig ( const uint8_t *  pri_key,
const uint8_t *  payload,
uint32_t  payload_len,
uint8_t *  output_buf,
uint32_t  output_buf_len,
uint32_t *  output_len 
)

The certificate request signature should be an ecdsa sha256 signature.

The format of the signature will be the same as that generated by the micro-ecc library.

Parameters
[in]pri_keyThe format of pri_key should be the same format used and generated in the micro-ecc library.

◆ sign_on_basic_ecc_256_gen_fin_msg_sig()

int sign_on_basic_ecc_256_gen_fin_msg_sig ( const uint8_t *  pri_key,
const uint8_t *  payload,
uint32_t  payload_len,
uint8_t *  output_buf,
uint32_t  output_buf_len,
uint32_t *  output_len 
)

The finish message signature should be an ecdsa sha256 signature.

The format of the signature will be the same as that generated by the micro-ecc library.

Parameters
[in]pri_keyThe format of pri_key should be the same format used and generated in the micro-ecc library.

◆ sign_on_basic_ecc_256_gen_kt()

int sign_on_basic_ecc_256_gen_kt ( const uint8_t *  pub_key,
uint32_t  pub_key_len,
const uint8_t *  pri_key,
uint32_t  pri_key_len,
uint8_t *  output_buf,
uint32_t  output_buf_len,
uint32_t *  output_len 
)

The keys used to generate KT should be ecc keys, based on the "secp256r1" curve.

Parameters
[in]pub_keyThe format of the public key should be the same format used and generated in the micro-ecc library.
[in]pri_keyThe format of the private key should be the same format used and generated in the micro-ecc library.

◆ sign_on_basic_ecc_256_gen_n1_keypair()

int sign_on_basic_ecc_256_gen_n1_keypair ( uint8_t *  pub_key_buf,
uint32_t  pub_key_buf_len,
uint32_t *  pub_key_output_len,
uint8_t *  pri_key_buf,
uint32_t  pri_key_buf_len,
uint32_t *  pri_key_output_len 
)

The N1 key pair should be a pair of ecc keys, based on the "secp256r1" curve.

Parameters
[in]pub_key_bufThe format of the public key should be the same format used and generated in the micro-ecc library.
[in]pri_key_bufThe format of the private key should be the same format used and generated in the micro-ecc library.

◆ sign_on_basic_ecc_256_gen_sha256_hash()

int sign_on_basic_ecc_256_gen_sha256_hash ( const uint8_t *  payload,
uint32_t  payload_len,
uint8_t *  output 
)

Generate a sha256 hash.

◆ sign_on_basic_ecc_256_vrfy_btstrp_rqst_rspns_sig()

int sign_on_basic_ecc_256_vrfy_btstrp_rqst_rspns_sig ( const uint8_t *  payload,
uint32_t  payload_len,
const uint8_t *  sig,
uint32_t  sig_len,
const uint8_t *  key,
uint32_t  key_len 
)

The bootstrapping request response signature should be an hmac sha256 signature.

Parameters
[in]keyThe format of key should be the same format used and generated in the micro-ecc library.

◆ sign_on_basic_ecc_256_vrfy_cert_rqst_rspns_sig()

int sign_on_basic_ecc_256_vrfy_cert_rqst_rspns_sig ( const uint8_t *  payload,
uint32_t  payload_len,
const uint8_t *  sig,
uint32_t  sig_len,
const uint8_t *  key,
uint32_t  key_len 
)

The certificate request response signature should be an hmac sha256 signature.

Parameters
[in]keyThe format of key should be the same format used and generated in the micro-ecc library.