Examples of update()


Examples of org.bouncycastle.crypto.digests.SHA256Digest.update()

       
        byte[] keyByteArray = keyingMaterial.toByteArray();
       
        byte[] output = new byte[digest.getDigestSize()];
       
        digest.update(keyByteArray, 0, keyByteArray.length);

        digest.doFinal(output, 0);

        return new BigInteger(output);
    }
View Full Code Here

Examples of org.bouncycastle.crypto.digests.SHA384Digest.update()

        //
        // test 2
        //
        byte[]  bytes = Hex.decode(testVec2);

        digest.update(bytes, 0, bytes.length);

        digest.doFinal(resBuf, 0);

        resStr = new String(Hex.encode(resBuf));
        if (!resVec2.equals(resStr))
View Full Code Here

Examples of org.bouncycastle.crypto.digests.SHA512Digest.update()

        //
        // test 2
        //
        byte[]  bytes = Hex.decode(testVec2);

        digest.update(bytes, 0, bytes.length);

        digest.doFinal(resBuf, 0);

        resStr = new String(Hex.encode(resBuf));
        if (!resVec2.equals(resStr))
View Full Code Here

Examples of org.bouncycastle.crypto.digests.TigerDigest.update()

        int failCount = 0;

        for (int i = 0; i < messages.length; i++)
        {
            byte[] m = messages[i].getBytes();
            digest.update(m, 0, m.length);
            digest.doFinal(resBuf, 0);

            if (!arraysEqual(resBuf, Hex.decode(digests[i])))
            {
                return new SimpleTestResult(false, getName() + ": Vector " + i + " failed got " + new String(Hex.encode(resBuf)));
View Full Code Here

Examples of org.bouncycastle.crypto.macs.CBCBlockCipherMac.update()

            b0[b0.length - count] = (byte)(q & 0xff);
            q >>>= 8;
            count++;
        }
       
        cMac.update(b0, 0, b0.length);
       
        //
        // process associated text
        //
        if (hasAssociatedText())
View Full Code Here

Examples of org.bouncycastle.crypto.macs.HMac.update()

        byte[] buf = new byte[mac.getMacSize()];
        byte[] buf2 = new byte[mac.getMacSize()];
        for (int i = 0; i < iterations; i++)
        {
            mac.init(param);
            mac.update(a, 0, a.length);
            mac.doFinal(buf, 0);
            a = buf;
            mac.init(param);
            mac.update(a, 0, a.length);
            mac.update(seed, 0, seed.length);
View Full Code Here

Examples of org.bouncycastle.crypto.signers.ISO9796d2PSSSigner.update()

        eng.init(true, sigParameters);

        try
        {
            eng.update(msg7[0]);
            eng.update(msg7, 1, msg7.length - 1);

            data = eng.generateSignature();
        }
        catch (Exception e)
View Full Code Here

Examples of org.bouncycastle.crypto.signers.ISO9796d2Signer.update()

        eng.init(true, privParameters);

        try
        {
            eng.update(msg4[0]);
            eng.update(msg4, 1, msg4.length - 1);

            data = eng.generateSignature();
        }
        catch (Exception e)
View Full Code Here

Examples of org.bouncycastle.crypto.signers.PSSSigner.update()

        eng.init(true, new ParametersWithRandom(prv, new FixedRandom(slt)));

        try
        {
            eng.update(msg, 0, msg.length);

            byte[]  s = eng.generateSignature();

            if (!isEqualTo(s, sig))
            {
View Full Code Here

Examples of org.bouncycastle.jce.PKCS7SignedData.update()

            PKCS7SignedData         pkcs7sd = new PKCS7SignedData(
                                            privKey, certs, "MD5");

            byte[]  bytes = Hex.decode("0102030405060708091011121314");

            pkcs7sd.update(bytes, 0, bytes.length);

            byte[]  p = pkcs7sd.getEncoded();

            pkcs7sd = new PKCS7SignedData(p);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.