23 #include "mantis-parallel.h"
24 #include "skinny-internal.h"
35 void (*crypt)(
void *output,
const void *input,
const void *tweak,
38 } MantisParallelECBVtable_t;
40 void _mantis_parallel_crypt_vec128
41 (
void *output,
const void *input,
const void *tweak,
const MantisKey_t *ks);
43 static MantisParallelECBVtable_t
const mantis_parallel_ecb_vec128 = {
44 _mantis_parallel_crypt_vec128
57 if (_skinny_has_vec128())
58 ecb->
vtable = &mantis_parallel_ecb_vec128;
64 if (ecb && ecb->
ctx) {
73 unsigned rounds,
int mode)
76 if (!ecb || !ecb->
ctx)
85 if (!ecb || !ecb->
ctx)
92 (
void *output,
const void *input,
const void *tweak,
size_t size,
96 const MantisParallelECBVtable_t *vtable;
107 while (size >= psize) {
108 (*(vtable->crypt))(output, input, tweak, ks);
117 while (size >= MANTIS_BLOCK_SIZE) {
State information for Mantis in parallel ECB mode.
void mantis_swap_modes(MantisKey_t *ks)
Swaps the encryption and decryption modes on a Mantis key schedule.
void mantis_parallel_ecb_cleanup(MantisParallelECB_t *ecb)
Cleans up a parallel ECB control block for Mantis.
int mantis_parallel_ecb_init(MantisParallelECB_t *ecb)
Initializes Mantis in parallel ECB mode.
void mantis_parallel_ecb_swap_modes(MantisParallelECB_t *ecb)
Swaps the encryption and decryption modes on a parallel Mantis key schedule.
#define MANTIS_BLOCK_SIZE
Size of a block for Mantis block ciphers.
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.
int mantis_parallel_ecb_crypt(void *output, const void *input, const void *tweak, size_t size, const MantisParallelECB_t *ecb)
Encrypts or decrypts a block of data using Mantis in parallel ECB mode.
Key schedule for Mantis block ciphers.
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...
int mantis_parallel_ecb_set_key(MantisParallelECB_t *ecb, const void *key, unsigned size, unsigned rounds, int mode)
Sets the key schedule for a Mantis block cipher in parallel ECB mode.