27 #ifndef WOLF_CRYPT_SIGNATURE_H 28 #define WOLF_CRYPT_SIGNATURE_H 38 enum wc_SignatureType {
39 WC_SIGNATURE_TYPE_NONE = 0,
40 WC_SIGNATURE_TYPE_ECC = 1,
41 WC_SIGNATURE_TYPE_RSA = 2,
42 WC_SIGNATURE_TYPE_RSA_W_ENC = 3,
46 const void* key, word32 key_len);
48 WOLFSSL_API
int wc_SignatureVerifyHash(
49 enum wc_HashType hash_type,
enum wc_SignatureType sig_type,
50 const byte* hash_data, word32 hash_len,
51 const byte* sig, word32 sig_len,
52 const void* key, word32 key_len);
55 enum wc_HashType hash_type,
enum wc_SignatureType sig_type,
56 const byte* data, word32 data_len,
57 const byte* sig, word32 sig_len,
58 const void* key, word32 key_len);
60 WOLFSSL_API
int wc_SignatureGenerateHash(
61 enum wc_HashType hash_type,
enum wc_SignatureType sig_type,
62 const byte* hash_data, word32 hash_len,
63 byte* sig, word32 *sig_len,
64 const void* key, word32 key_len,
WC_RNG* rng);
65 WOLFSSL_API
int wc_SignatureGenerateHash_ex(
66 enum wc_HashType hash_type,
enum wc_SignatureType sig_type,
67 const byte* hash_data, word32 hash_len,
68 byte* sig, word32 *sig_len,
69 const void* key, word32 key_len,
WC_RNG* rng,
int verify);
71 enum wc_HashType hash_type,
enum wc_SignatureType sig_type,
72 const byte* data, word32 data_len,
73 byte* sig, word32 *sig_len,
74 const void* key, word32 key_len,
76 WOLFSSL_API
int wc_SignatureGenerate_ex(
77 enum wc_HashType hash_type,
enum wc_SignatureType sig_type,
78 const byte* data, word32 data_len,
79 byte* sig, word32 *sig_len,
80 const void* key, word32 key_len,
WOLFSSL_API 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 th...
Definition: signature.c:447
WOLFSSL_API 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 verif...
Definition: signature.c:247
WOLFSSL_API int wc_SignatureGetSize(enum wc_SignatureType sig_type, const void *key, word32 key_len)
This function returns the maximum size of the resulting signature.
Definition: signature.c:73