what-the-bank/sources/org/bouncycastle/crypto/modes/gcm/BasicGCMExponentiator.java

30 lines
878 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.modes.gcm;
import org.bouncycastle.util.Arrays;
/* loaded from: classes6.dex */
public class BasicGCMExponentiator implements GCMExponentiator {
private int[] x;
@Override // org.bouncycastle.crypto.modes.gcm.GCMExponentiator
public void init(byte[] bArr) {
this.x = GCMUtil.asInts(bArr);
}
@Override // org.bouncycastle.crypto.modes.gcm.GCMExponentiator
public void exponentiateX(long j, byte[] bArr) {
int[] oneAsInts = GCMUtil.oneAsInts();
if (j > 0) {
int[] clone = Arrays.clone(this.x);
do {
if ((1 & j) != 0) {
GCMUtil.multiply(oneAsInts, clone);
}
GCMUtil.multiply(clone, clone);
j >>>= 1;
} while (j > 0);
}
GCMUtil.asBytes(oneAsInts, bArr);
}
}