Suggest crypto_generichash_statebytes() instead of sizeof()
This commit is contained in:
parent
b5deb4d070
commit
d0e9b8f69c
@ -73,8 +73,8 @@ int sodium_munlock(void * const addr, const size_t len);
|
|||||||
* either 357 or 361 bytes. For this reason, when using sodium_malloc() to
|
* either 357 or 361 bytes. For this reason, when using sodium_malloc() to
|
||||||
* allocate a crypto_generichash_state structure, padding must be added in
|
* allocate a crypto_generichash_state structure, padding must be added in
|
||||||
* order to ensure proper alignment:
|
* order to ensure proper alignment:
|
||||||
* state = sodium_malloc((sizeof(crypto_generichash_state)
|
* state = sodium_malloc((crypto_generichash_statebytes() + (size_t) 63U)
|
||||||
* + (size_t) 63U) & ~(size_t) 63U);
|
* & ~(size_t) 63U);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SODIUM_EXPORT
|
SODIUM_EXPORT
|
||||||
|
Loading…
Reference in New Issue
Block a user