X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=transform-cbcmac.c;h=26e0a127d37cf8dcd7297eab6768795811453629;hp=1e8a5e9b8acc4bc181f3b9cdbff5b32a2142abb9;hb=ccf25024a3b46e9ca2b1842883b2f0953daf4842;hpb=92a7d254975db245c3320855515bffc1aebda9e4 diff --git a/transform-cbcmac.c b/transform-cbcmac.c index 1e8a5e9..26e0a12 100644 --- a/transform-cbcmac.c +++ b/transform-cbcmac.c @@ -40,7 +40,8 @@ struct transform_inst { #define PKCS5_MASK 15 -static bool_t transform_setkey(void *sst, uint8_t *key, int32_t keylen) +static bool_t transform_setkey(void *sst, uint8_t *key, int32_t keylen, + bool_t direction) { struct transform_inst *ti=sst; @@ -260,9 +261,8 @@ static list_t *transform_apply(closure_t *self, struct cloc loc, st->cl.apply=NULL; st->cl.interface=&st->ops; st->ops.st=st; - st->ops.max_start_pad=28; /* 4byte seqnum, 16byte pad, 4byte MACIV, - 4byte IV */ - st->ops.max_end_pad=16; /* 16byte CBCMAC */ + update_max_start_pad(&transform_max_start_pad, 28); + /* 4byte seqnum, 16byte pad, 4byte MACIV, 4byte IV */ /* We need 256*2 bits for serpent keys, 32 bits for CBC-IV and 32 bits for CBCMAC-IV, and 32 bits for init sequence number */ @@ -278,6 +278,8 @@ static list_t *transform_apply(closure_t *self, struct cloc loc, st->max_seq_skew=dict_read_number(dict, "max-sequence-skew", False, "serpent-cbc256", loc, 10); + SET_CAPAB_TRANSFORMNUM(CAPAB_TRANSFORMNUM_SERPENT256CBC); + return new_closure(&st->cl); }