My Project
Classes | Functions
KangarooTwelve

Faster, reduced-round XOF with a customzation string, as defined in the draft KangarooTwelve and TurboSHAKE specification. More...

Classes

struct  k12_t
 KangarooTwelve context. More...
 

Functions

void k12_once (const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len)
 Absorb data into KangarooTwelve, then squeeze bytes out. More...
 
void k12_custom_once (const uint8_t *src, const size_t src_len, const uint8_t *custom, const size_t custom_len, uint8_t *dst, const size_t dst_len)
 Absorb data into KangarooTwelve with customization string, then squeeze bytes out. More...
 
void k12_init (k12_t *k12, const uint8_t *src, const size_t src_len, const uint8_t *custom, const size_t custom_len)
 Initialize KangarooTwelve context. More...
 
void k12_squeeze (k12_t *k12, uint8_t *dst, const size_t dst_len)
 Squeeze bytes from KangarooTwelve context. More...
 

Detailed Description

Faster, reduced-round XOF with a customzation string, as defined in the draft KangarooTwelve and TurboSHAKE specification.

Function Documentation

◆ k12_custom_once()

void k12_custom_once ( const uint8_t *  src,
const size_t  src_len,
const uint8_t *  custom,
const size_t  custom_len,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into KangarooTwelve with customization string, then squeeze bytes out.

Initialize internal KangarooTwelve context with custom string custom of length custom_len, absorb src_len bytes of input from source buffer src, then squeeze dst_len bytes of output into destination buffer dst.

Parameters
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[in]customCustom string buffer.
[in]custom_lenCustom string length, in bytes.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ k12_init()

void k12_init ( k12_t k12,
const uint8_t *  src,
const size_t  src_len,
const uint8_t *  custom,
const size_t  custom_len 
)

Initialize KangarooTwelve context.

Initialize KangarooTwelve context with message src of length src_len bytes and custom string custom of length custom_len bytes.

Note: This implementation of KangarooTwelve is sequential, not parallel.

Parameters
[out]k12KangarooTwelve context.
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[in]customCustom string buffer.
[in]custom_lenCustom string length, in bytes.

◆ k12_once()

void k12_once ( const uint8_t *  src,
const size_t  src_len,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into KangarooTwelve, then squeeze bytes out.

!

Initialize internal KangarooTwelve context, absorb src_len bytes of input from source buffer src, then squeeze dst_len bytes of output into destination buffer dst.

Parameters
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ k12_squeeze()

void k12_squeeze ( k12_t k12,
uint8_t *  dst,
const size_t  dst_len 
)

Squeeze bytes from KangarooTwelve context.

Squeeze dst_len bytes of output into destination buffer dst from KangarooTwelve context k12. Can be called iteratively to squeeze output data in chunks.

Note: This implementation of KangarooTwelve is sequential, not parallel.

Parameters
[in,out]k12KangarooTwelve context.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.