Welcome to little lamb

Code » limb » release » tree

[release] / src / doc / sha3.h / sha3_224_init.3.md

% limb manual
% sha3_224_init(3)
% limb 0.1.0
% 2023-07-24

# NAME

sha3\_224\_init, sha3\_256\_init, sha3\_384\_init, sha3\_512\_init,
sha3\_update, sha3\_final - compute the SHA3 of a given block of data

# SYNOPSIS

    #include <limb/sha3.h>

```pre hl
void sha3_224_init(void *<em>ctx</em>);
void sha3_256_init(void *<em>ctx</em>);
void sha3_384_init(void *<em>ctx</em>);
void sha3_512_init(void *<em>ctx</em>);
void sha3_update(const void *<em>msg</em>, size_t <em>size</em>, void *<em>ctx</em>);
void sha3_final(void * restrict <em>md</em>, void *<em>ctx</em>);
```

# DESCRIPTION

The `sha3_224_init`() function initializes the given sha3 context `ctx` to
calculate a digest of 224 bits.

The `sha3_256_init`(), `sha3_384_init`() and `sha3_512_init`() functions are
similar, but initializing the conext for a SHA3 of 256, 384 and 512 bits
respectively.

The `sha3_update`() function feeds the specified chunk of data pointed by `msg`
of length `size` (in bytes) to be hashed into the given `ctx`. You can call this
function repeatedly as many times as needed.

The `sha3_final`() function stores the calculated hash from `ctx` in binary form
into `md`, which must be able to store as many bytes as needed: `bits / 8`,
where `bits` corresponds to the `sha3_*_init`() function called.

# SEE ALSO

[hasher_sha3_224.h](0), [hasher_sha3_256.h](0), [hasher_sha3_384.h](0),
[hasher_sha3_512.h](0), [hasher_hash](3), [blake3_init](3)