Derives a value of the requested length based on shared secret information, suitable for use as a key value.
#include "hukdf.h"
int hu_KDFDerive(int algid, size_t secretLen, const unsigned char *sharedSecret, size_t addInfoLen, const unsigned char *addInfo, size_t keyLen, unsigned char *keyValue, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
A KDF algorithm. The acceptable values are one of the HU_KDF_* macros.
The length (in bytes) of the shared secret data.
The shared secret data.
The length (in bytes) of the additional information. (Optional)
Additional information. (Optional - set to NULL if not used.)
The length (in bytes) of the key buffer.
The key buffer.
A global context.
Additional shared information may also be given.
For the IEEE KDF1 algorithm, the requested length must be the underlying digest algorithm's output length.
When the NIST Alternative 1 KDF is used, the underlying hash algorithm must be registered. If not, a not supported error for the hash algorithm will be returned.
The KDF algorithm identifier is invalid.
The shared secret value is NULL.
The length of the shared secret length is invalid.
The additional information value is NULL.
The key buffer is NULL.
The length of the key buffer length is invalid.
Success.