Java 类org.bouncycastle.crypto.util.Pack 实例源码

项目:keepass2android    文件:SHA256Digest.java   
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;
}
项目:keepass2android    文件:SHA1Digest.java   
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;
}
项目:ipack    文件:ECDHKEKGenerator.java   
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);
}
项目:ipack    文件:SipHash.java   
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();
}
项目:ipack    文件:SHA384Digest.java   
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;
}
项目:ipack    文件:SHA256Digest.java   
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;
}
项目:ipack    文件:SHA1Digest.java   
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;
}
项目:ipack    文件:SHA512Digest.java   
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;
}
项目:ipack    文件:SHA224Digest.java   
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;
}
项目:ipack    文件:Tables64kGCMMultiplier.java   
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);
    }
项目:ipack    文件:Tables8kGCMMultiplier.java   
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);
    }
项目:Cryptguard    文件:SHA512Digest.java   
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;
}
项目:KeePass2Android    文件:SHA256Digest.java   
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;
}
项目:KeePass2Android    文件:SHA1Digest.java   
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;
}
项目:CryptMeme    文件:ECDHKEKGenerator.java   
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);
}
项目:CryptMeme    文件:SipHash.java   
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();
}
项目:CryptMeme    文件:SHA384Digest.java   
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;
}
项目:CryptMeme    文件:SHA256Digest.java   
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;
}
项目:CryptMeme    文件:SHA1Digest.java   
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;
}
项目:CryptMeme    文件:SM3Digest.java   
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;
}
项目:CryptMeme    文件:SHA512Digest.java   
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;
}
项目:CryptMeme    文件:SHA224Digest.java   
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;
}
项目:CryptMeme    文件:Tables64kGCMMultiplier.java   
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);
    }
项目:CryptMeme    文件:Tables8kGCMMultiplier.java   
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);
    }
项目:google-authenticator    文件:SHA1Digest.java   
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;
}
项目:irma_future_id    文件:ECDHKEKGenerator.java   
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);
}
项目:irma_future_id    文件:SipHash.java   
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();
}
项目:irma_future_id    文件:SHA384Digest.java   
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;
}
项目:irma_future_id    文件:SHA256Digest.java   
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;
}
项目:irma_future_id    文件:SHA1Digest.java   
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;
}
项目:irma_future_id    文件:SM3Digest.java   
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;
}
项目:irma_future_id    文件:SHA512Digest.java   
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;
}
项目:irma_future_id    文件:SHA224Digest.java   
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;
}
项目:irma_future_id    文件:Tables64kGCMMultiplier.java   
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);
    }
项目:irma_future_id    文件:Tables8kGCMMultiplier.java   
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);
    }
项目:bc-java    文件:ECDHKEKGenerator.java   
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);
}
项目:bc-java    文件:SipHash.java   
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();
}
项目:bc-java    文件:SHA384Digest.java   
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;
}
项目:bc-java    文件:SHA256Digest.java   
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;
}
项目:bc-java    文件:SHA1Digest.java   
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;
}