Package org.bouncycastle.crypto

Examples of org.bouncycastle.crypto.Mac.update()


            extra = (extra + associatedText.length) % 16;
            if (extra != 0)
            {
                for (int i = 0; i != 16 - extra; i++)
                {
                    cMac.update((byte)0x00);
                }
            }
        }
       
        //
View Full Code Here


        }
       
        //
        // add the text
        //
        cMac.update(data, dataOff, dataLen);

        return cMac.doFinal(macBlock, 0);
    }

    private boolean hasAssociatedText()
View Full Code Here

        //
        // standard DAC - zero IV
        //
        mac.init(key);

        mac.update(input1, 0, input1.length);

        byte[]  out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

        //
        ParametersWithIV    param = new ParametersWithIV(key, ivBytes);

        mac.init(param);

        mac.update(input1, 0, input1.length);

        out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

        mac = new CFBBlockCipherMac(cipher);

        mac.init(param);

        mac.update(input1, 0, input1.length);

        out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

        //
        // word aligned data - zero IV
        //
        mac.init(key);

        mac.update(input2, 0, input2.length);

        out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

        //
        mac = new CBCBlockCipherMac(cipher, new PKCS7Padding());

        mac.init(key);

        mac.update(input2, 0, input2.length);

        out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

        //
        // non-word aligned data - zero IV - CBC padding
        //
        mac.reset();

        mac.update(input1, 0, input1.length);

        out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

        //
        // non-word aligned data - zero IV - CBC padding
        //
        mac.init(key);

        mac.update(input1, 0, input1.length);

        out = new byte[4];

        mac.doFinal(out, 0);
View Full Code Here

            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

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.