Blob Blame History Raw
diff --git a/lib/freebl/ppc-gcm.s b/lib/freebl/ppc-gcm.s
--- a/lib/freebl/ppc-gcm.s
+++ b/lib/freebl/ppc-gcm.s
@@ -692,7 +692,6 @@
 
     mtctr        9
 
-    li           10, 0
     li           25, 0x10
     li           26, 0x20
     li           27, 0x30
@@ -703,6 +702,7 @@
 
 .align 5
 .L8x_loop:
+    li           10, 0
     VEC_LOAD_INC K, KS, 10
 
     vadduwm      CTR1, CTR, I1
diff --git a/lib/freebl/ppc-gcm-wrap.c b/lib/freebl/ppc-gcm-wrap.c
--- a/lib/freebl/ppc-gcm-wrap.c
+++ b/lib/freebl/ppc-gcm-wrap.c
@@ -155,7 +155,7 @@
     /* Promote the counter by 1 */
     gcm->CTR[14] += !(++gcm->CTR[15]);
     gcm->CTR[13] += !(gcm->CTR[15]) && !(gcm->CTR[14]);
-    gcm->CTR[12] += !(gcm->CTR[15]) && !(gcm->CTR[13]) && !(gcm->CTR[12]);
+    gcm->CTR[12] += !(gcm->CTR[15]) && !(gcm->CTR[14]) && !(gcm->CTR[13]);
 
     /* Now hash AAD - it would actually make sense to seperate the context
      * creation from the AAD, because that would allow to reuse the H, which