
|
My Project
|
Functions | |
| WOLFSSL_API int | wc_HmacSetKey (Hmac *, int type, const byte *key, word32 keySz) |
| This function initializes an Hmac object, setting its encryption type, key and HMAC length. | |
| WOLFSSL_API int | wc_HmacUpdate (Hmac *, const byte *, word32) |
| This function updates the message to authenticate using HMAC. It should be called after the Hmac object has been initialized with wc_HmacSetKey. This function may be called multiple times to update the message to hash. After calling wc_HmacUpdate as desired, one should call wc_HmacFinal to obtain the final authenticated message tag. | |
| WOLFSSL_API int | wc_HmacFinal (Hmac *, byte *) |
| This function computes the final hash of an Hmac object's message. | |
| WOLFSSL_API int | wolfSSL_GetHmacMaxSize (void) |
| This function returns the largest HMAC digest size available based on the configured cipher suites. | |
| WOLFSSL_API int | wc_HKDF (int type, const byte *inKey, word32 inKeySz, const byte *salt, word32 saltSz, const byte *info, word32 infoSz, byte *out, word32 outSz) |
| This function provides access to a HMAC Key Derivation Function (HKDF). It utilizes HMAC to convert inKey, with an optional salt and optional info into a derived key, which it stores in out. The hash type defaults to MD5 if 0 or NULL is given. | |
| int wc_HKDF | ( | int | type, |
| const byte * | inKey, | ||
| word32 | inKeySz, | ||
| const byte * | salt, | ||
| word32 | saltSz, | ||
| const byte * | info, | ||
| word32 | infoSz, | ||
| byte * | out, | ||
| word32 | outSz ) |
This function provides access to a HMAC Key Derivation Function (HKDF). It utilizes HMAC to convert inKey, with an optional salt and optional info into a derived key, which it stores in out. The hash type defaults to MD5 if 0 or NULL is given.
| type | hash type to use for the HKDF. Valid types are: MD5, SHA, SHA256, SHA384, SHA512, SHA3-224, SHA3-256, SHA3-384, SHA3-512 |
| inKey | pointer to the buffer containing the key to use for KDF |
| inKeySz | length of the input key |
| salt | pointer to a buffer containing an optional salt. Use NULL instead if not using a salt |
| saltSz | length of the salt. Use 0 if not using a salt |
| info | pointer to a buffer containing optional additional info. Use NULL if not appending extra info |
| infoSz | length of additional info. Use 0 if not using additional info |
| out | pointer to the buffer in which to store the derived key |
| outSz | space available in the output buffer to store the generated key |
Example
| int wc_HmacFinal | ( | Hmac * | hmac, |
| byte * | hash ) |
This function computes the final hash of an Hmac object's message.
| hmac | pointer to the Hmac object for which to calculate the final hash |
| hash | pointer to the buffer in which to store the final hash. Should have room available as required by the hashing algorithm chosen |
Example
| int wc_HmacSetKey | ( | Hmac * | hmac, |
| int | type, | ||
| const byte * | key, | ||
| word32 | keySz ) |
This function initializes an Hmac object, setting its encryption type, key and HMAC length.
| hmac | pointer to the Hmac object to initialize |
| type | type specifying which encryption method the Hmac object should use. Valid options are: MD5, SHA, SHA256, SHA384, SHA512, SHA3-224, SHA3-256, SHA3-384, SHA3-512 |
| key | pointer to a buffer containing the key with which to initialize the Hmac object |
| length | length of the key |
Example
| int wc_HmacUpdate | ( | Hmac * | hmac, |
| const byte * | msg, | ||
| word32 | length ) |
This function updates the message to authenticate using HMAC. It should be called after the Hmac object has been initialized with wc_HmacSetKey. This function may be called multiple times to update the message to hash. After calling wc_HmacUpdate as desired, one should call wc_HmacFinal to obtain the final authenticated message tag.
| hmac | pointer to the Hmac object for which to update the message |
| msg | pointer to the buffer containing the message to append |
| length | length of the message to append |
Example
| int wolfSSL_GetHmacMaxSize | ( | void | ) |
This function returns the largest HMAC digest size available based on the configured cipher suites.
| none | No parameters. |
Example