23 #include "skinny128-parallel.h"
24 #include "skinny-internal.h"
35 void (*encrypt)(
void *output,
const void *input,
const Skinny128Key_t *ks);
36 void (*decrypt)(
void *output,
const void *input,
const Skinny128Key_t *ks);
38 } Skinny128ParallelECBVtable_t;
40 void _skinny128_parallel_encrypt_vec128
42 void _skinny128_parallel_decrypt_vec128
45 static Skinny128ParallelECBVtable_t
const skinny128_parallel_ecb_vec128 = {
46 _skinny128_parallel_encrypt_vec128,
47 _skinny128_parallel_decrypt_vec128
50 void _skinny128_parallel_encrypt_vec256
52 void _skinny128_parallel_decrypt_vec256
55 static Skinny128ParallelECBVtable_t
const skinny128_parallel_ecb_vec256 = {
56 _skinny128_parallel_encrypt_vec256,
57 _skinny128_parallel_decrypt_vec256
70 if (_skinny_has_vec128())
71 ecb->
vtable = &skinny128_parallel_ecb_vec128;
72 if (_skinny_has_vec256()) {
73 ecb->
vtable = &skinny128_parallel_ecb_vec256;
81 if (ecb && ecb->
ctx) {
92 if (!ecb || !ecb->
ctx)
99 (
void *output,
const void *input,
size_t size,
103 const Skinny128ParallelECBVtable_t *vtable;
114 while (size >= psize) {
115 (*(vtable->encrypt))(output, input, ks);
123 while (size >= SKINNY128_BLOCK_SIZE) {
133 (
void *output,
const void *input,
size_t size,
137 const Skinny128ParallelECBVtable_t *vtable;
148 while (size >= psize) {
149 (*(vtable->decrypt))(output, input, ks);
157 while (size >= SKINNY128_BLOCK_SIZE) {
void skinny128_ecb_encrypt(void *output, const void *input, const Skinny128Key_t *ks)
Encrypts a single block using the Skinny128 block cipher in ECB mode.
Key schedule for Skinny128 block ciphers.
State information for Skinny-128 in parallel ECB mode.
int skinny128_parallel_ecb_encrypt(void *output, const void *input, size_t size, const Skinny128ParallelECB_t *ecb)
Encrypt a block of data using Skinny-128 in parallel ECB mode.
void skinny128_ecb_decrypt(void *output, const void *input, const Skinny128Key_t *ks)
Decrypts a single block using the Skinny128 block cipher in ECB mode.
int skinny128_parallel_ecb_decrypt(void *output, const void *input, size_t size, const Skinny128ParallelECB_t *ecb)
Decrypt a block of data using Skinny-128 in parallel ECB mode.
int skinny128_set_key(Skinny128Key_t *ks, const void *key, unsigned size)
Sets the key schedule for a Skinny128 block cipher.
#define SKINNY128_BLOCK_SIZE
Size of a block for Skinny128 block ciphers.
void skinny128_parallel_ecb_cleanup(Skinny128ParallelECB_t *ecb)
Cleans up a parallel ECB control block for Skinny-128.
int skinny128_parallel_ecb_init(Skinny128ParallelECB_t *ecb)
Initializes Skinny-128 in parallel ECB mode.
int skinny128_parallel_ecb_set_key(Skinny128ParallelECB_t *ecb, const void *key, unsigned size)
Sets the key schedule for a Skinny128 block cipher in parallel ECB mode.