Bug 1566124 - Fix counter increase in ppc-gcm-wrap.c r=bbeurdouche
Differential Revision:
https://phabricator.services.mozilla.com/D116297
--- a/lib/freebl/ppc-gcm-wrap.c
+++ b/lib/freebl/ppc-gcm-wrap.c
@@ -150,17 +150,17 @@ ppc_aes_gcmInitCounter(ppc_AES_GCMContex
AES_BLOCK_SIZE, AES_BLOCK_SIZE);
if (rv != SECSuccess) {
return SECFailure;
}
/* 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
* only changes when the AES key changes, and not every package, like the
* IV and AAD */
ppc_aes_gcmHASH(gcm->Htbl, aad, aadLen, gcm->T);
gcm->Alen += aadLen;
return SECSuccess;