ASCON Suite
Classes | Functions
masking.h File Reference

Definitions to support masked ASCON ciphers. More...

#include <stdint.h>

Go to the source code of this file.

Classes

union  ascon_masked_key_word_t
 Masked 64-bit key word with up to four shares. More...
 
struct  ascon_masked_key_128_t
 128-bit key that has been masked to hide its value when the code is operating on it. More...
 
struct  ascon_masked_key_160_t
 160-bit key that has been masked to hide its value when the code is operating on it. More...
 

Functions

void ascon_masked_key_128_init (ascon_masked_key_128_t *masked, const unsigned char *key)
 Initializes a masked 128-bit key for ASCON. More...
 
void ascon_masked_key_128_free (ascon_masked_key_128_t *masked)
 Frees a masked 128-bit key and destroys all sensitive material. More...
 
void ascon_masked_key_128_randomize (ascon_masked_key_128_t *masked)
 Randomizes a masked 128-bit key by mixing in fresh random material. More...
 
void ascon_masked_key_128_extract (const ascon_masked_key_128_t *masked, unsigned char *key)
 Extracts the plain version of a 128-bit key from its masked version. More...
 
void ascon_masked_key_160_init (ascon_masked_key_160_t *masked, const unsigned char *key)
 Initializes a masked 160-bit key for ASCON. More...
 
void ascon_masked_key_160_free (ascon_masked_key_160_t *masked)
 Frees a masked 160-bit key and destroys all sensitive material. More...
 
void ascon_masked_key_160_randomize (ascon_masked_key_160_t *masked)
 Randomizes a masked 160-bit key by mixing in fresh random material. More...
 
void ascon_masked_key_160_extract (const ascon_masked_key_160_t *masked, unsigned char *key)
 Extracts the plain version of a 160-bit key from its masked version. More...
 

Detailed Description

Definitions to support masked ASCON ciphers.

Definition in file masking.h.

Function Documentation

◆ ascon_masked_key_128_extract()

void ascon_masked_key_128_extract ( const ascon_masked_key_128_t masked,
unsigned char *  key 
)

Extracts the plain version of a 128-bit key from its masked version.

Parameters
maskedPoints to the masked key to be extracted.
keyPoints to a 16 byte buffer to receive the extracted key.

Definition at line 96 of file ascon-masked-key.c.

◆ ascon_masked_key_128_free()

void ascon_masked_key_128_free ( ascon_masked_key_128_t masked)

Frees a masked 128-bit key and destroys all sensitive material.

Parameters
maskedPoints to the masked key to be freed.

Definition at line 55 of file ascon-masked-key.c.

◆ ascon_masked_key_128_init()

void ascon_masked_key_128_init ( ascon_masked_key_128_t masked,
const unsigned char *  key 
)

Initializes a masked 128-bit key for ASCON.

Parameters
maskedMasked version of the key on output.
keyPoints to the 16 bytes of the 128-bit key to be masked.

Keys can be masked to protect them from casual snooping in memory. Or they may be masked for later use by a masked cipher.

Definition at line 28 of file ascon-masked-key.c.

◆ ascon_masked_key_128_randomize()

void ascon_masked_key_128_randomize ( ascon_masked_key_128_t masked)

Randomizes a masked 128-bit key by mixing in fresh random material.

Parameters
maskedPoints to the masked key to randomize.

Long-lived keys should be randomized regularly to mix in fresh randomness.

Definition at line 88 of file ascon-masked-key.c.

◆ ascon_masked_key_160_extract()

void ascon_masked_key_160_extract ( const ascon_masked_key_160_t masked,
unsigned char *  key 
)

Extracts the plain version of a 160-bit key from its masked version.

Parameters
maskedPoints to the masked key to be extracted.
keyPoints to a 20 byte buffer to receive the extracted key.

Definition at line 209 of file ascon-masked-key.c.

◆ ascon_masked_key_160_free()

void ascon_masked_key_160_free ( ascon_masked_key_160_t masked)

Frees a masked 160-bit key and destroys all sensitive material.

Parameters
maskedPoints to the masked key to be freed.

Definition at line 170 of file ascon-masked-key.c.

◆ ascon_masked_key_160_init()

void ascon_masked_key_160_init ( ascon_masked_key_160_t masked,
const unsigned char *  key 
)

Initializes a masked 160-bit key for ASCON.

Parameters
maskedMasked version of the key on output.
keyPoints to the 20 bytes of the 160-bit key to be masked.

Keys can be masked to protect them from casual snooping in memory. Or they may be masked for later use by a masked cipher.

Definition at line 117 of file ascon-masked-key.c.

◆ ascon_masked_key_160_randomize()

void ascon_masked_key_160_randomize ( ascon_masked_key_160_t masked)

Randomizes a masked 160-bit key by mixing in fresh random material.

Parameters
maskedPoints to the masked key to randomize.

Long-lived keys should be randomized regularly to mix in fresh randomness.

Definition at line 201 of file ascon-masked-key.c.