diff options
Diffstat (limited to 'src/lib/libcrypto/modes/ccm128.c')
-rw-r--r-- | src/lib/libcrypto/modes/ccm128.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/modes/ccm128.c b/src/lib/libcrypto/modes/ccm128.c index 3ce11d0d98..13bc7adf31 100644 --- a/src/lib/libcrypto/modes/ccm128.c +++ b/src/lib/libcrypto/modes/ccm128.c | |||
@@ -197,7 +197,7 @@ int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, | |||
197 | if (ctx->blocks > (U64(1)<<61)) return -2; /* too much data */ | 197 | if (ctx->blocks > (U64(1)<<61)) return -2; /* too much data */ |
198 | 198 | ||
199 | while (len>=16) { | 199 | while (len>=16) { |
200 | #if defined(STRICT_ALIGNMENT) | 200 | #ifdef __STRICT_ALIGNMENT |
201 | union { u64 u[2]; u8 c[16]; } temp; | 201 | union { u64 u[2]; u8 c[16]; } temp; |
202 | 202 | ||
203 | memcpy (temp.c,inp,16); | 203 | memcpy (temp.c,inp,16); |
@@ -210,7 +210,7 @@ int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, | |||
210 | (*block)(ctx->cmac.c,ctx->cmac.c,key); | 210 | (*block)(ctx->cmac.c,ctx->cmac.c,key); |
211 | (*block)(ctx->nonce.c,scratch.c,key); | 211 | (*block)(ctx->nonce.c,scratch.c,key); |
212 | ctr64_inc(ctx->nonce.c); | 212 | ctr64_inc(ctx->nonce.c); |
213 | #if defined(STRICT_ALIGNMENT) | 213 | #ifdef __STRICT_ALIGNMENT |
214 | temp.u[0] ^= scratch.u[0]; | 214 | temp.u[0] ^= scratch.u[0]; |
215 | temp.u[1] ^= scratch.u[1]; | 215 | temp.u[1] ^= scratch.u[1]; |
216 | memcpy(out,temp.c,16); | 216 | memcpy(out,temp.c,16); |
@@ -268,12 +268,12 @@ int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, | |||
268 | if (n!=len) return -1; | 268 | if (n!=len) return -1; |
269 | 269 | ||
270 | while (len>=16) { | 270 | while (len>=16) { |
271 | #if defined(STRICT_ALIGNMENT) | 271 | #ifdef __STRICT_ALIGNMENT |
272 | union { u64 u[2]; u8 c[16]; } temp; | 272 | union { u64 u[2]; u8 c[16]; } temp; |
273 | #endif | 273 | #endif |
274 | (*block)(ctx->nonce.c,scratch.c,key); | 274 | (*block)(ctx->nonce.c,scratch.c,key); |
275 | ctr64_inc(ctx->nonce.c); | 275 | ctr64_inc(ctx->nonce.c); |
276 | #if defined(STRICT_ALIGNMENT) | 276 | #ifdef __STRICT_ALIGNMENT |
277 | memcpy (temp.c,inp,16); | 277 | memcpy (temp.c,inp,16); |
278 | ctx->cmac.u[0] ^= (scratch.u[0] ^= temp.u[0]); | 278 | ctx->cmac.u[0] ^= (scratch.u[0] ^= temp.u[0]); |
279 | ctx->cmac.u[1] ^= (scratch.u[1] ^= temp.u[1]); | 279 | ctx->cmac.u[1] ^= (scratch.u[1] ^= temp.u[1]); |