Struct std::Sha512Ctx
struct Sha512Ctx {
unsigned long long h[8];
unsigned char buf[SHA512_BLOCK_SIZE];
unsigned long long total_bytes;
int is384;
}Fields
current hash state
partial block buffer
Total bytes processed. SHA-512's length field is 128 bits, but a single 64-bit counter is tracked here (matching every other hash module in this library) since no realistic input reaches 2^64 bytes — the length field's high 8 bytes are simply written as zero.
1 = SHA-384 variant
Methods
A fresh SHA-512 context.
A fresh SHA-384 context (same struct, is384 = 1).
Feed len bytes of data into the hash.
Finalise and write the digest. For SHA-512: digest must be at least 64 bytes. For SHA-384: digest must be at least 48 bytes.
64 (SHA-512) or 48 (SHA-384) / SHA512_BLOCK_SIZE (hash.h's BlockHash).