List of usage examples for org.bouncycastle.crypto.util Pack longToBigEndian
public static void longToBigEndian(long[] ns, byte[] bs, int off)
From source file:com.licel.jcardsim.crypto.MessageDigestImpl.java
License:Apache License
void getIntermediateDigest(byte[] intermediateDigest, int off) { // get hash state - BouncyCastle specific try {//w w w . j a v a2 s. com for (byte i = 0; i < componentCount; i++) { // some reflection work Field h = digestClass.getDeclaredField("H" + (i + componentStartIdx)); h.setAccessible(true); if (componentSize == 4) { Pack.intToBigEndian(h.getInt(engine), intermediateDigest, off + i * componentSize); } else { Pack.longToBigEndian(h.getLong(engine), intermediateDigest, off + i * componentSize); } } } catch (Exception e) { CryptoException.throwIt(CryptoException.ILLEGAL_USE); } }