Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
internal-romulus.h File Reference

Common functions for Romulus AEAD modes. More...

#include "internal-skinny-plus.h"

Go to the source code of this file.

Macros

#define romulus_set_domain(ks, domain)   ((ks)->TK1[7] = (domain))
 Sets the domain separation value for Romulus-N, M, and T. More...
 

Functions

void romulus_update_counter (uint8_t TK1[16])
 Updates the 56-bit LFSR block counter for Romulus-N, M, and T. More...
 
void romulus_schedule_init (skinny_plus_key_schedule_t *ks, const unsigned char *k, const unsigned char *npub)
 Initializes the key schedule for Romulus-N, M, or T. More...
 
void romulus_rho (unsigned char S[16], unsigned char C[16], const unsigned char M[16])
 Applies the Romulus rho function. More...
 
void romulus_rho_inverse (unsigned char S[16], unsigned char M[16], const unsigned char C[16])
 Applies the inverse of the Romulus rho function. More...
 
void romulus_rho_short (unsigned char S[16], unsigned char C[16], const unsigned char M[16], unsigned len)
 Applies the Romulus rho function to a short block. More...
 
void romulus_rho_inverse_short (unsigned char S[16], unsigned char M[16], const unsigned char C[16], unsigned len)
 Applies the inverse of the Romulus rho function to a short block. More...
 
void romulus_generate_tag (unsigned char T[16], const unsigned char S[16])
 Generates the authentication tag from the rolling Romulus state. More...
 

Detailed Description

Common functions for Romulus AEAD modes.

Macro Definition Documentation

#define romulus_set_domain (   ks,
  domain 
)    ((ks)->TK1[7] = (domain))

Sets the domain separation value for Romulus-N, M, and T.

Parameters
ksThe key schedule to set the domain separation value into.
domainThe domain separation value.

Function Documentation

void romulus_generate_tag ( unsigned char  T[16],
const unsigned char  S[16] 
)

Generates the authentication tag from the rolling Romulus state.

Parameters
TBuffer to receive the generated tag; can be the same as S.
SThe rolling Romulus state.
void romulus_rho ( unsigned char  S[16],
unsigned char  C[16],
const unsigned char  M[16] 
)

Applies the Romulus rho function.

Parameters
SThe rolling Romulus state.
CCiphertext message output block.
MPlaintext message input block.
void romulus_rho_inverse ( unsigned char  S[16],
unsigned char  M[16],
const unsigned char  C[16] 
)

Applies the inverse of the Romulus rho function.

Parameters
SThe rolling Romulus state.
MPlaintext message output block.
CCiphertext message input block.
void romulus_rho_inverse_short ( unsigned char  S[16],
unsigned char  M[16],
const unsigned char  C[16],
unsigned  len 
)

Applies the inverse of the Romulus rho function to a short block.

Parameters
SThe rolling Romulus state.
MPlaintext message output block.
CCiphertext message input block.
lenLength of the short block, must be less than 16.
void romulus_rho_short ( unsigned char  S[16],
unsigned char  C[16],
const unsigned char  M[16],
unsigned  len 
)

Applies the Romulus rho function to a short block.

Parameters
SThe rolling Romulus state.
CCiphertext message output block.
MPlaintext message input block.
lenLength of the short block, must be less than 16.
void romulus_schedule_init ( skinny_plus_key_schedule_t ks,
const unsigned char *  k,
const unsigned char *  npub 
)

Initializes the key schedule for Romulus-N, M, or T.

Parameters
ksPoints to the key schedule to initialize.
kPoints to the 16 bytes of the key.
npubPoints to the 16 bytes of the nonce.
void romulus_update_counter ( uint8_t  TK1[16])

Updates the 56-bit LFSR block counter for Romulus-N, M, and T.

Parameters
TK1Points to the TK1 part of the key schedule containing the LFSR.