diff options
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm')
4 files changed, 0 insertions, 132 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/BasicGCMExponentiator.java b/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/BasicGCMExponentiator.java deleted file mode 100644 index fc25810..0000000 --- a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/BasicGCMExponentiator.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.bouncycastle.crypto.modes.gcm; - -import org.bouncycastle.util.Arrays; - -public class BasicGCMExponentiator implements GCMExponentiator -{ - private int[] x; - - public void init(byte[] x) - { - this.x = GCMUtil.asInts(x); - } - - public void exponentiateX(long pow, byte[] output) - { - // Initial value is little-endian 1 - int[] y = GCMUtil.oneAsInts(); - - if (pow > 0) - { - int[] powX = Arrays.clone(x); - do - { - if ((pow & 1L) != 0) - { - GCMUtil.multiply(y, powX); - } - GCMUtil.multiply(powX, powX); - pow >>>= 1; - } - while (pow > 0); - } - - GCMUtil.asBytes(y, output); - } -} diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/BasicGCMMultiplier.java b/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/BasicGCMMultiplier.java deleted file mode 100644 index 2afb18f..0000000 --- a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/BasicGCMMultiplier.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.bouncycastle.crypto.modes.gcm; - -public class BasicGCMMultiplier implements GCMMultiplier -{ - private int[] H; - - public void init(byte[] H) - { - this.H = GCMUtil.asInts(H); - } - - public void multiplyH(byte[] x) - { - int[] t = GCMUtil.asInts(x); - GCMUtil.multiply(t, H); - GCMUtil.asBytes(t, x); - } -} diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/Tables64kGCMMultiplier.java b/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/Tables64kGCMMultiplier.java deleted file mode 100644 index 4f32a0d..0000000 --- a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/Tables64kGCMMultiplier.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.bouncycastle.crypto.modes.gcm; - -import org.bouncycastle.util.Arrays; -import org.bouncycastle.util.Pack; - -public class Tables64kGCMMultiplier implements GCMMultiplier -{ - private byte[] H; - private int[][][] M; - - public void init(byte[] H) - { - if (M == null) - { - M = new int[16][256][4]; - } - else if (Arrays.areEqual(this.H, H)) - { - return; - } - - this.H = Arrays.clone(H); - - // M[0][0] is ZEROES; - GCMUtil.asInts(H, M[0][128]); - - for (int j = 64; j >= 1; j >>= 1) - { - GCMUtil.multiplyP(M[0][j + j], M[0][j]); - } - - int i = 0; - for (;;) - { - for (int j = 2; j < 256; j += j) - { - for (int k = 1; k < j; ++k) - { - GCMUtil.xor(M[i][j], M[i][k], M[i][j + k]); - } - } - - if (++i == 16) - { - return; - } - - // M[i][0] is ZEROES; - for (int j = 128; j > 0; j >>= 1) - { - GCMUtil.multiplyP8(M[i - 1][j], M[i][j]); - } - } - } - - public void multiplyH(byte[] x) - { -// assert x.Length == 16; - - int[] z = new int[4]; - for (int i = 15; i >= 0; --i) - { -// GCMUtil.xor(z, M[i][x[i] & 0xff]); - int[] m = M[i][x[i] & 0xff]; - z[0] ^= m[0]; - z[1] ^= m[1]; - z[2] ^= m[2]; - z[3] ^= m[3]; - } - - Pack.intToBigEndian(z, x, 0); - } -} diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/package.html b/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/package.html deleted file mode 100644 index 09c42f0..0000000 --- a/bcprov/src/main/java/org/bouncycastle/crypto/modes/gcm/package.html +++ /dev/null @@ -1,5 +0,0 @@ -<html> -<body bgcolor="#ffffff"> -GCM mode support classes. -</body> -</html> |