23 #ifndef MANTIS_CIPHER_h
24 #define MANTIS_CIPHER_h
59 #define MANTIS_BLOCK_SIZE 8
64 #define MANTIS_KEY_SIZE 16
69 #define MANTIS_TWEAK_SIZE 8
77 #define MANTIS_MIN_ROUNDS 5
82 #define MANTIS_MAX_ROUNDS 8
87 #define MANTIS_ENCRYPT 1
92 #define MANTIS_DECRYPT 0
166 unsigned rounds,
int mode);
235 (
void *output,
const void *input,
const void *tweak,
const MantisKey_t *ks);
277 (
MantisCTR_t *ctr,
const void *key,
unsigned size,
unsigned rounds);
299 (
MantisCTR_t *ctr,
const void *tweak,
unsigned tweak_size);
325 (
MantisCTR_t *ctr,
const void *counter,
unsigned size);
341 (
void *output,
const void *input,
size_t size,
MantisCTR_t *ctr);
void mantis_swap_modes(MantisKey_t *ks)
Swaps the encryption and decryption modes on a Mantis key schedule.
int mantis_ctr_encrypt(void *output, const void *input, size_t size, MantisCTR_t *ctr)
Encrypt a block of data using Mantis in CTR mode.
void mantis_ecb_crypt(void *output, const void *input, const MantisKey_t *ks)
Encrypts or decrypts a single block using the Mantis block cipher in ECB mode.
int mantis_set_tweak(MantisKey_t *ks, const void *tweak, unsigned size)
Sets the tweak value for a previously-initialized key schedule.
void mantis_ctr_cleanup(MantisCTR_t *ctr)
Cleans up a CTR control block for Mantis.
int mantis_ctr_init(MantisCTR_t *ctr)
Initializes Mantis in CTR mode.
int mantis_set_key(MantisKey_t *ks, const void *key, unsigned size, unsigned rounds, int mode)
Sets the key schedule for a Mantis block cipher.
State information for Mantis in CTR mode.
int mantis_ctr_set_counter(MantisCTR_t *ctr, const void *counter, unsigned size)
Sets the counter value in a Mantis CTR control block.
int mantis_ctr_set_tweak(MantisCTR_t *ctr, const void *tweak, unsigned tweak_size)
Changes the tweak value for a previously-initialized key schedule.
Key schedule for Mantis block ciphers.
int mantis_ctr_set_key(MantisCTR_t *ctr, const void *key, unsigned size, unsigned rounds)
Sets the key schedule for a Mantis block cipher in CTR mode.
void mantis_ecb_crypt_tweaked(void *output, const void *input, const void *tweak, const MantisKey_t *ks)
Encrypts or decrypts a single block using the Mantis block cipher in ECB mode, with the tweak supplie...
Union that describes a 64-bit 4x4 array of cells.