summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cmac/cmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/cmac/cmac.c')
-rw-r--r--src/lib/libcrypto/cmac/cmac.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cmac/cmac.c b/src/lib/libcrypto/cmac/cmac.c
index b2f77c59bd..b717f786f1 100644
--- a/src/lib/libcrypto/cmac/cmac.c
+++ b/src/lib/libcrypto/cmac/cmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cmac.c,v 1.6 2014/06/21 12:07:02 miod Exp $ */ 1/* $OpenBSD: cmac.c,v 1.7 2014/06/21 13:42:14 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -217,7 +217,7 @@ CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
217 return 1; 217 return 1;
218 data += nleft; 218 data += nleft;
219 /* Else not final block so encrypt it */ 219 /* Else not final block so encrypt it */
220 if (!EVP_Cipher(&ctx->cctx, ctx->tbl, ctx->last_block,bl)) 220 if (!EVP_Cipher(&ctx->cctx, ctx->tbl, ctx->last_block, bl))
221 return 0; 221 return 0;
222 } 222 }
223 /* Encrypt all but one of the complete blocks left */ 223 /* Encrypt all but one of the complete blocks left */
@@ -257,7 +257,7 @@ CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen)
257 out[i] = ctx->last_block[i] ^ ctx->k2[i]; 257 out[i] = ctx->last_block[i] ^ ctx->k2[i];
258 } 258 }
259 if (!EVP_Cipher(&ctx->cctx, out, out, bl)) { 259 if (!EVP_Cipher(&ctx->cctx, out, out, bl)) {
260 OPENSSL_cleanse(out, bl); 260 OPENSSL_cleanse(out, bl);
261 return 0; 261 return 0;
262 } 262 }
263 return 1; 263 return 1;
@@ -272,7 +272,7 @@ CMAC_resume(CMAC_CTX *ctx)
272 * which is the last IV (or all zeroes if no last encrypted block). 272 * which is the last IV (or all zeroes if no last encrypted block).
273 * The last block has not been modified since CMAC_final(). 273 * The last block has not been modified since CMAC_final().
274 * So reinitialising using the last decrypted block will allow 274 * So reinitialising using the last decrypted block will allow
275 * CMAC to continue after calling CMAC_Final(). 275 * CMAC to continue after calling CMAC_Final().
276 */ 276 */
277 return EVP_EncryptInit_ex(&ctx->cctx, NULL, NULL, NULL, ctx->tbl); 277 return EVP_EncryptInit_ex(&ctx->cctx, NULL, NULL, NULL, ctx->tbl);
278} 278}