Functions | |
int | wc_SignatureGetSize (enum wc_SignatureType sig_type, const void *key, word32 key_len) |
This function returns the maximum size of the resulting signature. More... | |
int | wc_SignatureVerify (enum wc_HashType hash_type, enum wc_SignatureType sig_type, const byte *data, word32 data_len, const byte *sig, word32 sig_len, const void *key, word32 key_len) |
This function validates a signature by hashing the data and using the resulting hash and key to verify the signature. More... | |
int | wc_SignatureGenerate (enum wc_HashType hash_type, enum wc_SignatureType sig_type, const byte *data, word32 data_len, byte *sig, word32 *sig_len, const void *key, word32 key_len, WC_RNG *rng) |
This function generates a signature from the data using a key. It first creates a hash of the data then signs the hash using the key. More... | |
int wc_SignatureGenerate | ( | enum wc_HashType | hash_type, |
enum wc_SignatureType | sig_type, | ||
const byte * | data, | ||
word32 | data_len, | ||
byte * | sig, | ||
word32 * | sig_len, | ||
const void * | key, | ||
word32 | key_len, | ||
WC_RNG * | rng | ||
) |
This function generates a signature from the data using a key. It first creates a hash of the data then signs the hash using the key.
hash_type | A hash type from the “enum wc_HashType” such as “WC_HASH_TYPE_SHA256”. |
sig_type | A signature type enum value such as WC_SIGNATURE_TYPE_ECC or WC_SIGNATURE_TYPE_RSA. |
data | Pointer to buffer containing the data to hash. |
data_len | Length of the data buffer. |
sig | Pointer to buffer to output signature. |
sig_len | Length of the signature output buffer. |
key | Pointer to a key structure such as ecc_key or RsaKey. |
key_len | Size of the key structure. |
rng | Pointer to an initialized RNG structure. |
Example
int wc_SignatureGetSize | ( | enum wc_SignatureType | sig_type, |
const void * | key, | ||
word32 | key_len | ||
) |
This function returns the maximum size of the resulting signature.
sig_type | A signature type enum value such as WC_SIGNATURE_TYPE_ECC or WC_SIGNATURE_TYPE_RSA. |
key | Pointer to a key structure such as ecc_key or RsaKey. |
key_len | Size of the key structure. |
Example
int wc_SignatureVerify | ( | enum wc_HashType | hash_type, |
enum wc_SignatureType | sig_type, | ||
const byte * | data, | ||
word32 | data_len, | ||
const byte * | sig, | ||
word32 | sig_len, | ||
const void * | key, | ||
word32 | key_len | ||
) |
This function validates a signature by hashing the data and using the resulting hash and key to verify the signature.
hash_type | A hash type from the “enum wc_HashType” such as “WC_HASH_TYPE_SHA256”. |
sig_type | A signature type enum value such as WC_SIGNATURE_TYPE_ECC or WC_SIGNATURE_TYPE_RSA. |
data | Pointer to buffer containing the data to hash. |
data_len | Length of the data buffer. |
sig | Pointer to buffer to output signature. |
sig_len | Length of the signature output buffer. |
key | Pointer to a key structure such as ecc_key or RsaKey. |
key_len | Size of the key structure. |
Example