本文整理汇总了Java中org.bouncycastle.crypto.util.Pack类的典型用法代码示例。如果您正苦于以下问题:Java Pack类的具体用法?Java Pack怎么用?Java Pack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pack类属于org.bouncycastle.crypto.util包,在下文中一共展示了Pack类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doFinal
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int doFinal(
byte[] out,
int outOff)
{
finish();
Pack.intToBigEndian(H1, out, outOff);
Pack.intToBigEndian(H2, out, outOff + 4);
Pack.intToBigEndian(H3, out, outOff + 8);
Pack.intToBigEndian(H4, out, outOff + 12);
Pack.intToBigEndian(H5, out, outOff + 16);
Pack.intToBigEndian(H6, out, outOff + 20);
Pack.intToBigEndian(H7, out, outOff + 24);
Pack.intToBigEndian(H8, out, outOff + 28);
reset();
return DIGEST_LENGTH;
}
开发者ID:PhilippC,项目名称:keepass2android,代码行数:20,代码来源:SHA256Digest.java
示例2: doFinal
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int doFinal(
byte[] out,
int outOff)
{
finish();
Pack.intToBigEndian(H1, out, outOff);
Pack.intToBigEndian(H2, out, outOff + 4);
Pack.intToBigEndian(H3, out, outOff + 8);
Pack.intToBigEndian(H4, out, outOff + 12);
Pack.intToBigEndian(H5, out, outOff + 16);
reset();
return DIGEST_LENGTH;
}
开发者ID:PhilippC,项目名称:keepass2android,代码行数:17,代码来源:SHA1Digest.java
示例3: generateBytes
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int generateBytes(byte[] out, int outOff, int len)
throws DataLengthException, IllegalArgumentException
{
// TODO Create an ASN.1 class for this (RFC3278)
// ECC-CMS-SharedInfo
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new AlgorithmIdentifier(algorithm, DERNull.INSTANCE));
v.add(new DERTaggedObject(true, 2, new DEROctetString(Pack.intToBigEndian(keySize))));
try
{
kdf.init(new KDFParameters(z, new DERSequence(v).getEncoded(ASN1Encoding.DER)));
}
catch (IOException e)
{
throw new IllegalArgumentException("unable to initialise kdf: " + e.getMessage());
}
return kdf.generateBytes(out, outOff, len);
}
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:ECDHKEKGenerator.java
示例4: init
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public void init(CipherParameters params)
throws IllegalArgumentException
{
if (!(params instanceof KeyParameter))
{
throw new IllegalArgumentException("'params' must be an instance of KeyParameter");
}
KeyParameter keyParameter = (KeyParameter)params;
byte[] key = keyParameter.getKey();
if (key.length != 16)
{
throw new IllegalArgumentException("'params' must be a 128-bit key");
}
this.k0 = Pack.littleEndianToLong(key, 0);
this.k1 = Pack.littleEndianToLong(key, 8);
reset();
}
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:SipHash.java
示例5: doFinal
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int doFinal(
byte[] out,
int outOff)
{
finish();
Pack.longToBigEndian(H1, out, outOff);
Pack.longToBigEndian(H2, out, outOff + 8);
Pack.longToBigEndian(H3, out, outOff + 16);
Pack.longToBigEndian(H4, out, outOff + 24);
Pack.longToBigEndian(H5, out, outOff + 32);
Pack.longToBigEndian(H6, out, outOff + 40);
reset();
return DIGEST_LENGTH;
}
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:SHA384Digest.java
示例6: doFinal
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int doFinal(
byte[] out,
int outOff)
{
finish();
Pack.longToBigEndian(H1, out, outOff);
Pack.longToBigEndian(H2, out, outOff + 8);
Pack.longToBigEndian(H3, out, outOff + 16);
Pack.longToBigEndian(H4, out, outOff + 24);
Pack.longToBigEndian(H5, out, outOff + 32);
Pack.longToBigEndian(H6, out, outOff + 40);
Pack.longToBigEndian(H7, out, outOff + 48);
Pack.longToBigEndian(H8, out, outOff + 56);
reset();
return DIGEST_LENGTH;
}
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:SHA512Digest.java
示例7: doFinal
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int doFinal(
byte[] out,
int outOff)
{
finish();
Pack.intToBigEndian(H1, out, outOff);
Pack.intToBigEndian(H2, out, outOff + 4);
Pack.intToBigEndian(H3, out, outOff + 8);
Pack.intToBigEndian(H4, out, outOff + 12);
Pack.intToBigEndian(H5, out, outOff + 16);
Pack.intToBigEndian(H6, out, outOff + 20);
Pack.intToBigEndian(H7, out, outOff + 24);
reset();
return DIGEST_LENGTH;
}
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:SHA224Digest.java
示例8: multiplyH
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
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);
}
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:Tables64kGCMMultiplier.java
示例9: multiplyH
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
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 + i][x[i] & 0x0f]);
int[] m = M[i + i][x[i] & 0x0f];
z[0] ^= m[0];
z[1] ^= m[1];
z[2] ^= m[2];
z[3] ^= m[3];
// GCMUtil.xor(z, M[i + i + 1][(x[i] & 0xf0) >>> 4]);
m = M[i + i + 1][(x[i] & 0xf0) >>> 4];
z[0] ^= m[0];
z[1] ^= m[1];
z[2] ^= m[2];
z[3] ^= m[3];
}
Pack.intToBigEndian(z, x, 0);
}
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:Tables8kGCMMultiplier.java
示例10: doFinal
import org.bouncycastle.crypto.util.Pack; //导入依赖的package包/类
public int doFinal(byte[] out,
int outOff)
{
finish();
Pack.intToBigEndian(this.V[0], out, outOff + 0);
Pack.intToBigEndian(this.V[1], out, outOff + 4);
Pack.intToBigEndian(this.V[2], out, outOff + 8);
Pack.intToBigEndian(this.V[3], out, outOff + 12);
Pack.intToBigEndian(this.V[4], out, outOff + 16);
Pack.intToBigEndian(this.V[5], out, outOff + 20);
Pack.intToBigEndian(this.V[6], out, outOff + 24);
Pack.intToBigEndian(this.V[7], out, outOff + 28);
reset();
return DIGEST_LENGTH;
}
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:19,代码来源:SM3Digest.java
注:本文中的org.bouncycastle.crypto.util.Pack类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论