28 #define ECB_CIPHER( _ecb_name, _ecb_cipher, _raw_cipher, _raw_context, \ 30 static int _ecb_name ## _setkey ( void *ctx, const void *key, \ 32 return cipher_setkey ( &_raw_cipher, ctx, key, keylen ); \ 34 static void _ecb_name ## _setiv ( void *ctx, const void *iv, \ 36 cipher_setiv ( &_raw_cipher, ctx, iv, ivlen ); \ 38 static void _ecb_name ## _encrypt ( void *ctx, const void *src, \ 39 void *dst, size_t len ) { \ 40 ecb_encrypt ( ctx, src, dst, len, &_raw_cipher ); \ 42 static void _ecb_name ## _decrypt ( void *ctx, const void *src, \ 43 void *dst, size_t len ) { \ 44 ecb_decrypt ( ctx, src, dst, len, &_raw_cipher ); \ 46 struct cipher_algorithm _ecb_cipher = { \ 48 .ctxsize = sizeof ( _raw_context ), \ 49 .blocksize = _blocksize, \ 50 .alignsize = _blocksize, \ 52 .setkey = _ecb_name ## _setkey, \ 53 .setiv = _ecb_name ## _setiv, \ 54 .encrypt = _ecb_name ## _encrypt, \ 55 .decrypt = _ecb_name ## _decrypt, \ 56 .auth = cipher_null_auth, \
void ecb_encrypt(void *ctx, const void *src, void *dst, size_t len, struct cipher_algorithm *raw_cipher)
Encrypt data.
struct golan_eq_context ctx
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void ecb_decrypt(void *ctx, const void *src, void *dst, size_t len, struct cipher_algorithm *raw_cipher)
Decrypt data.