29 #define ECB_CIPHER( _ecb_name, _ecb_cipher, _raw_cipher, _raw_context, \ 31 static int _ecb_name ## _setkey ( void *ctx, const void *key, \ 33 return cipher_setkey ( &_raw_cipher, ctx, key, keylen ); \ 35 static void _ecb_name ## _setiv ( void *ctx, const void *iv, \ 37 cipher_setiv ( &_raw_cipher, ctx, iv, ivlen ); \ 39 static void _ecb_name ## _encrypt ( void *ctx, const void *src, \ 40 void *dst, size_t len ) { \ 41 ecb_encrypt ( ctx, src, dst, len, &_raw_cipher ); \ 43 static void _ecb_name ## _decrypt ( void *ctx, const void *src, \ 44 void *dst, size_t len ) { \ 45 ecb_decrypt ( ctx, src, dst, len, &_raw_cipher ); \ 47 struct cipher_algorithm _ecb_cipher = { \ 49 .ctxsize = sizeof ( _raw_context ), \ 50 .blocksize = _blocksize, \ 51 .alignsize = _blocksize, \ 53 .setkey = _ecb_name ## _setkey, \ 54 .setiv = _ecb_name ## _setiv, \ 55 .encrypt = _ecb_name ## _encrypt, \ 56 .decrypt = _ecb_name ## _decrypt, \ 57 .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.