+ crypto_hash_sha(256|512)_statebytes
This commit is contained in:
parent
cdbb2dfe75
commit
b5deb4d070
@ -4,3 +4,8 @@ size_t
|
||||
crypto_hash_sha256_bytes(void) {
|
||||
return crypto_hash_sha256_BYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_hash_sha256_statebytes(void) {
|
||||
return sizeof(crypto_hash_sha256_state);
|
||||
}
|
||||
|
@ -4,3 +4,8 @@ size_t
|
||||
crypto_hash_sha512_bytes(void) {
|
||||
return crypto_hash_sha512_BYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_hash_sha512_statebytes(void) {
|
||||
return sizeof(crypto_hash_sha512_state);
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ typedef struct crypto_hash_sha256_state {
|
||||
uint32_t count[2];
|
||||
unsigned char buf[64];
|
||||
} crypto_hash_sha256_state;
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha256_statebytes(void);
|
||||
|
||||
#define crypto_hash_sha256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
|
@ -26,6 +26,8 @@ typedef struct crypto_hash_sha512_state {
|
||||
uint64_t count[2];
|
||||
unsigned char buf[128];
|
||||
} crypto_hash_sha512_state;
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha512_statebytes(void);
|
||||
|
||||
#define crypto_hash_sha512_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
|
@ -36,6 +36,8 @@ int main(void)
|
||||
assert(crypto_hash_sha256_bytes() > 0U);
|
||||
assert(crypto_hash_sha512_bytes() >= crypto_hash_sha256_bytes());
|
||||
assert(crypto_hash_sha512_bytes() == crypto_hash_bytes());
|
||||
assert(crypto_hash_sha256_statebytes() == sizeof(crypto_hash_sha256_state));
|
||||
assert(crypto_hash_sha512_statebytes() == sizeof(crypto_hash_sha512_state));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user