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

Pyjamask block cipher. More...

#include "internal-util.h"

Go to the source code of this file.

Data Structures

struct  pyjamask_128_key_schedule_t
 Structure of the key schedule for the Pyjamask-128 block cipher. More...
 
struct  pyjamask_96_key_schedule_t
 Structure of the key schedule for the Pyjamask-96 block cipher. More...
 

Macros

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

Functions

void pyjamask_128_setup_key (pyjamask_128_key_schedule_t *ks, const unsigned char *key)
 Sets up the key schedule for the Pyjamask-128 block cipher. More...
 
void pyjamask_96_setup_key (pyjamask_96_key_schedule_t *ks, const unsigned char *key)
 Sets up the key schedule for the Pyjamask-96 block cipher. More...
 
void pyjamask_128_encrypt (const pyjamask_128_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Encrypts a 128-bit block with Pyjamask-128. More...
 
void pyjamask_128_decrypt (const pyjamask_128_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Decrypts a 128-bit block with Pyjamask-128. More...
 
void pyjamask_96_encrypt (const pyjamask_96_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Encrypts a 96-bit block with Pyjamask-96. More...
 
void pyjamask_96_decrypt (const pyjamask_96_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Decrypts a 96-bit block with Pyjamask-96. More...
 

Detailed Description

Pyjamask block cipher.

Function Documentation

void pyjamask_128_decrypt ( const pyjamask_128_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Decrypts a 128-bit block with Pyjamask-128.

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_128_encrypt()
void pyjamask_128_encrypt ( const pyjamask_128_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Encrypts a 128-bit block with Pyjamask-128.

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_128_decrypt()
void pyjamask_128_setup_key ( pyjamask_128_key_schedule_t ks,
const unsigned char *  key 
)

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

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

Decrypts a 96-bit block with Pyjamask-96.

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_96_encrypt()
void pyjamask_96_encrypt ( const pyjamask_96_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Encrypts a 96-bit block with Pyjamask-96.

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_96_decrypt()
void pyjamask_96_setup_key ( pyjamask_96_key_schedule_t ks,
const unsigned char *  key 
)

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

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