hcrypto: Add HMAC_CTX_new and HMAC_CTX_free
Add a pair of functions which can be used to allocate and free an HMAC_CTX structure on the heap. This means that the caller doesn't need to know the size of the underlying structure.
This commit is contained in:

committed by
Jeffrey Altman

parent
ae62cc2341
commit
c1eb9828f4
@@ -66,6 +66,19 @@ HMAC_CTX_cleanup(HMAC_CTX *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
HMAC_CTX *
|
||||
HMAC_CTX_new(void)
|
||||
{
|
||||
return calloc(1, sizeof(HMAC_CTX));
|
||||
}
|
||||
|
||||
void
|
||||
HMAC_CTX_free(HMAC_CTX *ctx)
|
||||
{
|
||||
HMAC_CTX_cleanup(ctx);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
size_t
|
||||
HMAC_size(const HMAC_CTX *ctx)
|
||||
{
|
||||
|
Reference in New Issue
Block a user