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

Masked version of the Pyjamask block cipher. More...

#include "internal-util.h"
#include "internal-masking.h"

Go to the source code of this file.

Data Structures

struct  pyjamask_masked_128_key_schedule_t
 Structure of the key schedule for masked Pyjamask-128. More...
 
struct  pyjamask_masked_96_key_schedule_t
 Structure of the key schedule for masked Pyjamask-96. More...
 

Macros

#define PYJAMASK_MASKED_ROUNDS   14
 Number of rounds in the masked Pyjamask block cipher.
 

Functions

void pyjamask_masked_128_setup_key (pyjamask_masked_128_key_schedule_t *ks, const unsigned char *key)
 Sets up the key schedule for the masked Pyjamask-128 block cipher. More...
 
void pyjamask_masked_96_setup_key (pyjamask_masked_96_key_schedule_t *ks, const unsigned char *key)
 Sets up the key schedule for the masked Pyjamask-96 block cipher. More...
 
void pyjamask_masked_128_encrypt (const pyjamask_masked_128_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Encrypts a 128-bit block with Pyjamask-128 in masked mode. More...
 
void pyjamask_masked_128_decrypt (const pyjamask_masked_128_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Decrypts a 128-bit block with Pyjamask-128 in masked mode. More...
 
void pyjamask_masked_96_encrypt (const pyjamask_masked_96_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Encrypts a 96-bit block with Pyjamask-96 in masked mode. More...
 
void pyjamask_masked_96_decrypt (const pyjamask_masked_96_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Decrypts a 96-bit block with Pyjamask-96 in masked mode. More...
 

Detailed Description

Masked version of the Pyjamask block cipher.

Function Documentation

void pyjamask_masked_128_decrypt ( const pyjamask_masked_128_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Decrypts a 128-bit block with Pyjamask-128 in masked mode.

Parameters
ksPoints to the key schedule.
outputOutput buffer which must be at least 16 bytes in length.
inputInput buffer which must be at least 16 bytes in length.

The input and output buffers can be the same buffer for in-place decryption.

See Also
pyjamask_masked_128_encrypt()
void pyjamask_masked_128_encrypt ( const pyjamask_masked_128_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Encrypts a 128-bit block with Pyjamask-128 in masked mode.

Parameters
ksPoints to the key schedule.
outputOutput buffer which must be at least 16 bytes in length.
inputInput buffer which must be at least 16 bytes in length.

The input and output buffers can be the same buffer for in-place encryption.

See Also
pyjamask_masked_128_decrypt()
void pyjamask_masked_128_setup_key ( pyjamask_masked_128_key_schedule_t ks,
const unsigned char *  key 
)

Sets up the key schedule for the masked Pyjamask-128 block cipher.

Parameters
ksThe key schedule on output.
keyThe 16 bytes of the key on input.
void pyjamask_masked_96_decrypt ( const pyjamask_masked_96_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Decrypts a 96-bit block with Pyjamask-96 in masked mode.

Parameters
ksPoints to the key schedule.
outputOutput buffer which must be at least 12 bytes in length.
inputInput buffer which must be at least 12 bytes in length.

The input and output buffers can be the same buffer for in-place decryption.

See Also
pyjamask_masked_96_encrypt()
void pyjamask_masked_96_encrypt ( const pyjamask_masked_96_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Encrypts a 96-bit block with Pyjamask-96 in masked mode.

Parameters
ksPoints to the key schedule.
outputOutput buffer which must be at least 12 bytes in length.
inputInput buffer which must be at least 12 bytes in length.

The input and output buffers can be the same buffer for in-place encryption.

See Also
pyjamask_masked_96_decrypt()
void pyjamask_masked_96_setup_key ( pyjamask_masked_96_key_schedule_t ks,
const unsigned char *  key 
)

Sets up the key schedule for the masked Pyjamask-96 block cipher.

Parameters
ksThe key schedule on output.
keyThe 16 bytes of the key on input.