29#define ECB_CIPHER( _ecb_name, _ecb_cipher, _raw_cipher, _raw_context, \
31static int _ecb_name ## _setkey ( void *ctx, const void *key, \
33 return cipher_setkey ( &_raw_cipher, ctx, key, keylen ); \
35static void _ecb_name ## _setiv ( void *ctx, const void *iv, \
37 cipher_setiv ( &_raw_cipher, ctx, iv, ivlen ); \
39static void _ecb_name ## _encrypt ( void *ctx, const void *src, \
40 void *dst, size_t len ) { \
41 ecb_encrypt ( ctx, src, dst, len, &_raw_cipher ); \
43static void _ecb_name ## _decrypt ( void *ctx, const void *src, \
44 void *dst, size_t len ) { \
45 ecb_decrypt ( ctx, src, dst, len, &_raw_cipher ); \
47struct 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, \
struct golan_eq_context ctx
void ecb_decrypt(void *ctx, const void *src, void *dst, size_t len, struct cipher_algorithm *raw_cipher)
Decrypt data.
void ecb_encrypt(void *ctx, const void *src, void *dst, size_t len, struct cipher_algorithm *raw_cipher)
Encrypt data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.