本文整理汇总了Java中org.bouncycastle.crypto.modes.gcm.Tables8kGCMMultiplier类的典型用法代码示例。如果您正苦于以下问题:Java Tables8kGCMMultiplier类的具体用法?Java Tables8kGCMMultiplier怎么用?Java Tables8kGCMMultiplier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tables8kGCMMultiplier类属于org.bouncycastle.crypto.modes.gcm包,在下文中一共展示了Tables8kGCMMultiplier类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runTestCase
import org.bouncycastle.crypto.modes.gcm.Tables8kGCMMultiplier; //导入依赖的package包/类
private void runTestCase(String[] testVector, int macLength)
throws InvalidCipherTextException
{
int pos = 0;
String testName = testVector[pos++];
byte[] K = Hex.decode(testVector[pos++]);
byte[] P = Hex.decode(testVector[pos++]);
byte[] A = Hex.decode(testVector[pos++]);
byte[] IV = Hex.decode(testVector[pos++]);
byte[] C = Hex.decode(testVector[pos++]);
// For short MAC, take leading bytes
byte[] t = Hex.decode(testVector[pos++]);
byte[] T = new byte[macLength];
System.arraycopy(t, 0, T, 0, T.length);
// Default multiplier
runTestCase(null, null, testName, K, IV, A, P, C, T);
runTestCase(new BasicGCMMultiplier(), new BasicGCMMultiplier(), testName, K, IV, A, P, C, T);
runTestCase(new Tables8kGCMMultiplier(), new Tables8kGCMMultiplier(), testName, K, IV, A, P, C, T);
runTestCase(new Tables64kGCMMultiplier(), new Tables64kGCMMultiplier(), testName, K, IV, A, P, C, T);
}
示例2: randomTests
import org.bouncycastle.crypto.modes.gcm.Tables8kGCMMultiplier; //导入依赖的package包/类
private void randomTests()
throws InvalidCipherTextException
{
SecureRandom srng = new SecureRandom();
srng.setSeed(Times.nanoTime());
randomTests(srng, null);
randomTests(srng, new BasicGCMMultiplier());
randomTests(srng, new Tables8kGCMMultiplier());
randomTests(srng, new Tables64kGCMMultiplier());
}
示例3: randomTests
import org.bouncycastle.crypto.modes.gcm.Tables8kGCMMultiplier; //导入依赖的package包/类
private void randomTests()
throws InvalidCipherTextException
{
SecureRandom srng = new SecureRandom();
for (int i = 0; i < 10; ++i)
{
randomTest(srng, null);
randomTest(srng, new BasicGCMMultiplier());
randomTest(srng, new Tables8kGCMMultiplier());
randomTest(srng, new Tables64kGCMMultiplier());
}
}