libusual  0.1
Data Structures | Defines | Functions
usual/crypto/sha3.h File Reference

SHA3 variants of Keccak. More...

Data Structures

struct  SHA3Context
 State structure. More...

Defines

#define SHA3_224_CAPACITY
 Keccak capacity area for SHA3-224, in bits.
#define SHA3_256_CAPACITY
 Keccak capacity area for SHA3-256, in bits.
#define SHA3_384_CAPACITY
 Keccak capacity area for SHA3-384, in bits.
#define SHA3_512_CAPACITY
 Keccak capacity area for SHA3-512, in bits.
#define SHAKE128_CAPACITY
 Keccak capacity area for SHAKE128, in bits.
#define SHAKE256_CAPACITY
 Keccak capacity area for SHAKE256, in bits.
#define SHA3_224_DIGEST_LENGTH
 Result length of SHA3-224, in bytes.
#define SHA3_256_DIGEST_LENGTH
 Result length of SHA3-256, in bytes.
#define SHA3_384_DIGEST_LENGTH
 Result length of SHA3-384, in bytes.
#define SHA3_512_DIGEST_LENGTH
 Result length of SHA3-512, in bytes.
#define SHAKE128_DIGEST_LENGTH
 Result length of SHAKE128, in bytes.
#define SHAKE256_DIGEST_LENGTH
 Result length of SHAKE256, in bytes.
#define SHA3_224_BLOCK_SIZE
 Block size of SHA3-224, in bytes.
#define SHA3_256_BLOCK_SIZE
 Block size of SHA3-256, in bytes.
#define SHA3_384_BLOCK_SIZE
 Block size of SHA3-384, in bytes.
#define SHA3_512_BLOCK_SIZE
 Block size of SHA3-512, in bytes.
#define SHAKE128_BLOCK_SIZE
 Block size of SHAKE128, in bytes.
#define SHAKE256_BLOCK_SIZE
 Block size of SHAKE256, in bytes.

Functions

void sha3_224_reset (struct SHA3Context *ctx)
 Initialize state for SHA3-224.
void sha3_256_reset (struct SHA3Context *ctx)
 Initialize state for SHA3-256.
void sha3_384_reset (struct SHA3Context *ctx)
 Initialize state for SHA3-384.
void sha3_512_reset (struct SHA3Context *ctx)
 Initialize state for SHA3-512.
void sha3_update (struct SHA3Context *ctx, const void *ptr, unsigned len)
 Process data, update state.
void sha3_final (struct SHA3Context *ctx, void *dst)
 Calculate final result.
void shake128_reset (struct SHA3Context *ctx)
 Initialize state for SHAKE128.
void shake256_reset (struct SHA3Context *ctx)
 Initialize state for SHAKE256.
void shake_update (struct SHA3Context *ctx, const void *ptr, unsigned len)
 Process data, update state.
void shake_extract (struct SHA3Context *ctx, void *dst, unsigned count)
 Output variable amount of result data.

Detailed Description

SHA3 variants of Keccak.

SHA3-X are fixed-length hashes, SHAKE is variable-length.


Define Documentation

Keccak capacity area for SHA3-224, in bits.

Keccak capacity area for SHA3-256, in bits.

Keccak capacity area for SHA3-384, in bits.

Keccak capacity area for SHA3-512, in bits.

Keccak capacity area for SHAKE128, in bits.

Keccak capacity area for SHAKE256, in bits.

Result length of SHA3-224, in bytes.

Result length of SHA3-256, in bytes.

Result length of SHA3-384, in bytes.

Result length of SHA3-512, in bytes.

Result length of SHAKE128, in bytes.

Result length of SHAKE256, in bytes.

Block size of SHA3-224, in bytes.

Block size of SHA3-256, in bytes.

Block size of SHA3-384, in bytes.

Block size of SHA3-512, in bytes.

Block size of SHAKE128, in bytes.

Block size of SHAKE256, in bytes.


Function Documentation

void sha3_224_reset ( struct SHA3Context ctx)

Initialize state for SHA3-224.

void sha3_256_reset ( struct SHA3Context ctx)

Initialize state for SHA3-256.

void sha3_384_reset ( struct SHA3Context ctx)

Initialize state for SHA3-384.

void sha3_512_reset ( struct SHA3Context ctx)

Initialize state for SHA3-512.

void sha3_update ( struct SHA3Context ctx,
const void *  ptr,
unsigned  len 
)

Process data, update state.

void sha3_final ( struct SHA3Context ctx,
void *  dst 
)

Calculate final result.

void shake128_reset ( struct SHA3Context ctx)

Initialize state for SHAKE128.

void shake256_reset ( struct SHA3Context ctx)

Initialize state for SHAKE256.

void shake_update ( struct SHA3Context ctx,
const void *  ptr,
unsigned  len 
)

Process data, update state.

void shake_extract ( struct SHA3Context ctx,
void *  dst,
unsigned  count 
)

Output variable amount of result data.