ocb3 fix
Karel Miko
6 years ago
113 | 113 | return CRYPT_INVALID_ARG; |
114 | 114 | } |
115 | 115 | |
116 | /* Make sure taglen isn't too long */ | |
117 | if (taglen > (unsigned long)cipher_descriptor[cipher].block_length) { | |
118 | taglen = cipher_descriptor[cipher].block_length; | |
116 | /* The blockcipher must have a 128-bit blocksize */ | |
117 | if (cipher_descriptor[cipher].block_length != 16) { | |
118 | return CRYPT_INVALID_ARG; | |
119 | } | |
120 | ||
121 | /* The TAGLEN may be any value up to 128 (bits) */ | |
122 | if (taglen > 16) { | |
123 | return CRYPT_INVALID_ARG; | |
119 | 124 | } |
120 | 125 | ocb->tag_len = taglen; |
121 | 126 |