From 627ddf9b745f4fa8da61e0cedb11d024c5b0ddeb Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Wed, 17 Jan 2018 10:47:23 +0100
Subject: [PATCH 2/3] cmac: block_mulx: simplify shifts

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
---
 cmac.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/cmac.c b/cmac.c
index a4d2468a..27df917e 100644
--- a/cmac.c
+++ b/cmac.c
@@ -57,14 +57,10 @@ static inline void block_mulx(union nettle_block16 *out,
 {
 	uint64_t b1 = READ_UINT64(in->b);
 	uint64_t b2 = READ_UINT64(in->b+8);
-	unsigned overflow = (b2 & UINT64_C(0x8000000000000000))?1:0;
 
-	b1 <<= 1;
+	b1 = (b1 << 1) | (b2 >> 63);
 	b2 <<= 1;
 
-	if (overflow)
-		b1 |= 0x01;
-
 	if (in->b[0] & 0x80)
 		b2 ^= 0x87;
 
-- 
2.14.3

