23 #include "skinny64-parallel.h"
24 #include "skinny-internal.h"
35 void (*encrypt)(
void *output,
const void *input,
const Skinny64Key_t *ks);
36 void (*decrypt)(
void *output,
const void *input,
const Skinny64Key_t *ks);
38 } Skinny64ParallelECBVtable_t;
40 void _skinny64_parallel_encrypt_vec128
42 void _skinny64_parallel_decrypt_vec128
45 static Skinny64ParallelECBVtable_t
const skinny64_parallel_ecb_vec128 = {
46 _skinny64_parallel_encrypt_vec128,
47 _skinny64_parallel_decrypt_vec128
60 if (_skinny_has_vec128())
61 ecb->
vtable = &skinny64_parallel_ecb_vec128;
67 if (ecb && ecb->
ctx) {
78 if (!ecb || !ecb->
ctx)
85 (
void *output,
const void *input,
size_t size,
89 const Skinny64ParallelECBVtable_t *vtable;
100 while (size >= psize) {
101 (*(vtable->encrypt))(output, input, ks);
109 while (size >= SKINNY64_BLOCK_SIZE) {
119 (
void *output,
const void *input,
size_t size,
123 const Skinny64ParallelECBVtable_t *vtable;
134 while (size >= psize) {
135 (*(vtable->decrypt))(output, input, ks);
143 while (size >= SKINNY64_BLOCK_SIZE) {
int skinny64_parallel_ecb_init(Skinny64ParallelECB_t *ecb)
Initializes Skinny-64 in parallel ECB mode.
int skinny64_set_key(Skinny64Key_t *ks, const void *key, unsigned size)
Sets the key schedule for a Skinny64 block cipher.
void skinny64_ecb_decrypt(void *output, const void *input, const Skinny64Key_t *ks)
Decrypts a single block using the Skinny64 block cipher in ECB mode.
void skinny64_ecb_encrypt(void *output, const void *input, const Skinny64Key_t *ks)
Encrypts a single block using the Skinny64 block cipher in ECB mode.
void skinny64_parallel_ecb_cleanup(Skinny64ParallelECB_t *ecb)
Cleans up a parallel ECB control block for Skinny-64.
Key schedule for Skinny64 block ciphers.
#define SKINNY64_BLOCK_SIZE
Size of a block for Skinny64 block ciphers.
int skinny64_parallel_ecb_set_key(Skinny64ParallelECB_t *ecb, const void *key, unsigned size)
Sets the key schedule for a Skinny64 block cipher in parallel ECB mode.
State information for Skinny-64 in parallel ECB mode.
int skinny64_parallel_ecb_decrypt(void *output, const void *input, size_t size, const Skinny64ParallelECB_t *ecb)
Decrypt a block of data using Skinny-64 in parallel ECB mode.
int skinny64_parallel_ecb_encrypt(void *output, const void *input, size_t size, const Skinny64ParallelECB_t *ecb)
Encrypt a block of data using Skinny-64 in parallel ECB mode.