本文整理汇总了Java中org.bouncycastle.crypto.digests.Blake2bDigest类的典型用法代码示例。如果您正苦于以下问题:Java Blake2bDigest类的具体用法?Java Blake2bDigest怎么用?Java Blake2bDigest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Blake2bDigest类属于org.bouncycastle.crypto.digests包,在下文中一共展示了Blake2bDigest类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initDigesters
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
private static void initDigesters() {
digesters.put("Blake2b", Blake2bDigest.class);
digesters.put("GOST3411", GOST3411Digest.class);
digesters.put("Keccak", KeccakDigest.class);
digesters.put("MD2", MD2Digest.class);
digesters.put("MD4", MD4Digest.class);
digesters.put("MD5", MD5Digest.class);
digesters.put("RIPEMD128", RIPEMD128Digest.class);
digesters.put("RIPEMD160", RIPEMD160Digest.class);
digesters.put("RIPEMD256", RIPEMD256Digest.class);
digesters.put("RIPEMD320", RIPEMD320Digest.class);
digesters.put("SHA1", SHA1Digest.class);
digesters.put("SHA224", SHA224Digest.class);
digesters.put("SHA256", SHA256Digest.class);
digesters.put("SHA384", SHA384Digest.class);
digesters.put("SHA3-512", SHA3Digest.class);
digesters.put("SHA3-256", SHA3Digest.class);
digesters.put("SHA3-224", SHA3Digest.class);
digesters.put("SHA3-384", SHA3Digest.class);
digesters.put("SHA512", SHA512Digest.class);
digesters.put("SHAKE-128", SHAKEDigest.class);
digesters.put("SHAKE-256", SHAKEDigest.class);
digesters.put("Skein256", SkeinDigest.class);
digesters.put("Skein512", SkeinDigest.class);
digesters.put("Skein1024", SkeinDigest.class);
digesters.put("SM3", SM3Digest.class);
digesters.put("Tiger", TigerDigest.class);
digesters.put("Whirlpool", WhirlpoolDigest.class);
}
开发者ID:shilongdai,项目名称:vsDiaryWriter,代码行数:30,代码来源:Digesters.java
示例2: clone
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
public Object clone()
throws CloneNotSupportedException
{
Blake2b512 d = (Blake2b512)super.clone();
d.digest = new Blake2bDigest((Blake2bDigest)digest);
return d;
}
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:9,代码来源:Blake2b.java
示例3: performTest
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
public void performTest() throws Exception
{
// test keyed test vectors:
Blake2bDigest blake2bkeyed = new Blake2bDigest(Hex.decode(keyedTestVectors[0][1]));
for (int tv = 0; tv < keyedTestVectors.length; tv++)
{
byte[] input = Hex.decode(keyedTestVectors[tv][0]);
blake2bkeyed.reset();
blake2bkeyed.update(input, 0, input.length);
byte[] keyedHash = new byte[64];
blake2bkeyed.doFinal(keyedHash, 0);
if (!Arrays.areEqual(Hex.decode(keyedTestVectors[tv][2]), keyedHash))
{
fail("Blake2b mismatch on test vector ",
keyedTestVectors[tv][2],
new String(Hex.encode(keyedHash)));
}
offsetTest(blake2bkeyed, input, keyedHash);
}
Blake2bDigest blake2bunkeyed = new Blake2bDigest();
// test unkeyed test vectors:
for (int i = 0; i < unkeyedTestVectors.length; i++)
{
try
{
// blake2bunkeyed.update(
// unkeyedTestVectors[i][1].getBytes("UTF-8"));
// test update(byte b)
byte[] unkeyedInput = unkeyedTestVectors[i][1]
.getBytes("UTF-8");
for (int j = 0; j < unkeyedInput.length; j++)
{
blake2bunkeyed.update(unkeyedInput[j]);
}
} catch (UnsupportedEncodingException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
byte[] unkeyedHash = new byte[64];
blake2bunkeyed.doFinal(unkeyedHash, 0);
blake2bunkeyed.reset();
if (!Arrays.areEqual(Hex.decode(unkeyedTestVectors[i][0]),
unkeyedHash))
{
fail("Blake2b mismatch on test vector ",
unkeyedTestVectors[i][0],
new String(Hex.encode(unkeyedHash)));
}
}
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:60,代码来源:Blake2bDigestTest.java
示例4: Blake2b512
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
public Blake2b512()
{
super(new Blake2bDigest(512));
}
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:5,代码来源:Blake2b.java
示例5: Blake2b384
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
public Blake2b384()
{
super(new Blake2bDigest(384));
}
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:5,代码来源:Blake2b.java
示例6: Blake2b256
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
public Blake2b256()
{
super(new Blake2bDigest(256));
}
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:5,代码来源:Blake2b.java
示例7: Blake2b160
import org.bouncycastle.crypto.digests.Blake2bDigest; //导入依赖的package包/类
public Blake2b160()
{
super(new Blake2bDigest(160));
}
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:5,代码来源:Blake2b.java
注:本文中的org.bouncycastle.crypto.digests.Blake2bDigest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论