16#define cbc_context_t( blocksize, ctxsize ) \
18 uint8_t cbc[ (blocksize) ]; \
19 uint8_t raw[ (ctxsize) - (blocksize) ]; \
23 const void *
key,
size_t keylen );
25 const void *
iv,
size_t ivlen );
27 const void *
src,
void *dst,
size_t len );
29 const void *
src,
void *dst,
size_t len );
40#define CBC_CIPHER( _cbc_name, _cbc_cipher, _raw_cipher, _raw_context, \
42struct cipher_algorithm _cbc_cipher = { \
44 .ctxsize = ( _blocksize + sizeof ( _raw_context ) ), \
45 .blocksize = _blocksize, \
46 .alignsize = _blocksize, \
49 .setkey = cbc_setkey, \
51 .encrypt = cbc_encrypt, \
52 .decrypt = cbc_decrypt, \
53 .auth = cipher_null_auth, \
54 .priv = &_raw_cipher, \
struct golan_eq_context ctx
union @162305117151260234136356364136041353210355154177 key
void cbc_encrypt(struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
Encrypt data.
int cbc_setkey(struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)
Set key.
void cbc_decrypt(struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len)
Decrypt data.
int cbc_setiv(struct cipher_algorithm *cipher, void *ctx, const void *iv, size_t ivlen)
Set initialisation vector.
#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.
u8 iv[16]
Initialization vector.