SHA-3#

SHA-3 comes in six different variants (instantiations) …

  • SHA3-224,

  • SHA3-256,

  • SHA3-384,

  • SHA3-512,

  • SHAKE128, and

  • SHAKE256.

The number in SHA3-* denotes the digest size, i.e., how many bits are produced by the hash function. SHAKE128 and SHAKE256 have a 128- or 256-bit security strength and can produce as many bytes as requested.

API Reference#

One-Shot#

Warning

doxygenfunction: Cannot find function “Hacl_SHA3_sha3_224” in doxygen xml output for project “HACL Packages” from directory: ../../build/doxygen/xml/

Warning

doxygenfunction: Cannot find function “Hacl_SHA3_sha3_256” in doxygen xml output for project “HACL Packages” from directory: ../../build/doxygen/xml/

Warning

doxygenfunction: Cannot find function “Hacl_SHA3_sha3_384” in doxygen xml output for project “HACL Packages” from directory: ../../build/doxygen/xml/

Warning

doxygenfunction: Cannot find function “Hacl_SHA3_sha3_512” in doxygen xml output for project “HACL Packages” from directory: ../../build/doxygen/xml/

Warning

doxygenfunction: Cannot find function “Hacl_SHA3_shake128_hacl” in doxygen xml output for project “HACL Packages” from directory: ../../build/doxygen/xml/

Warning

doxygenfunction: Cannot find function “Hacl_SHA3_shake256_hacl” in doxygen xml output for project “HACL Packages” from directory: ../../build/doxygen/xml/

Example

// This example uses SHA3-256.
//

const char* message = "Hello, World!";
uint32_t message_size = strlen(message);

// 256 Bit / 8 = 32 Byte
uint8_t digest[256 / 8];

Hacl_SHA3_sha3_256(message_size, (uint8_t*)message, digest);

Streaming#

No streaming API available.