1 #include "crypto_generichash_blake2b.h" 2 #include "randombytes.h" 3 4 size_t crypto_generichash_blake2b_bytes_min(void)5crypto_generichash_blake2b_bytes_min(void) { 6 return crypto_generichash_blake2b_BYTES_MIN; 7 } 8 9 size_t crypto_generichash_blake2b_bytes_max(void)10crypto_generichash_blake2b_bytes_max(void) { 11 return crypto_generichash_blake2b_BYTES_MAX; 12 } 13 14 size_t crypto_generichash_blake2b_bytes(void)15crypto_generichash_blake2b_bytes(void) { 16 return crypto_generichash_blake2b_BYTES; 17 } 18 19 size_t crypto_generichash_blake2b_keybytes_min(void)20crypto_generichash_blake2b_keybytes_min(void) { 21 return crypto_generichash_blake2b_KEYBYTES_MIN; 22 } 23 24 size_t crypto_generichash_blake2b_keybytes_max(void)25crypto_generichash_blake2b_keybytes_max(void) { 26 return crypto_generichash_blake2b_KEYBYTES_MAX; 27 } 28 29 size_t crypto_generichash_blake2b_keybytes(void)30crypto_generichash_blake2b_keybytes(void) { 31 return crypto_generichash_blake2b_KEYBYTES; 32 } 33 34 size_t crypto_generichash_blake2b_saltbytes(void)35crypto_generichash_blake2b_saltbytes(void) { 36 return crypto_generichash_blake2b_SALTBYTES; 37 } 38 39 size_t crypto_generichash_blake2b_personalbytes(void)40crypto_generichash_blake2b_personalbytes(void) { 41 return crypto_generichash_blake2b_PERSONALBYTES; 42 } 43 44 size_t crypto_generichash_blake2b_statebytes(void)45crypto_generichash_blake2b_statebytes(void) 46 { 47 return (sizeof(crypto_generichash_blake2b_state) + (size_t) 63U) 48 & ~(size_t) 63U; 49 } 50 51 void crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES])52crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES]) 53 { 54 randombytes_buf(k, crypto_generichash_blake2b_KEYBYTES); 55 } 56