Java 类org.bouncycastle.crypto.macs.VMPCMac 实例源码

项目:irma_future_id    文件:VMPCMacTest.java   
public void performTest() throws Exception
{
    CipherParameters kp = new KeyParameter(
        Hex.decode("9661410AB797D8A9EB767C21172DF6C7"));
    CipherParameters kpwiv = new ParametersWithIV(kp,
        Hex.decode("4B5C2F003E67F39557A8D26F3DA2B155"));

    byte[] m = new byte[256];
    for (int i = 0; i < 256; i++)
    {
        m[i] = (byte) i;
    }

    VMPCMac mac = new VMPCMac();
    mac.init(kpwiv);

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

    byte[] out = new byte[20];
    mac.doFinal(out, 0);

    if (!Arrays.areEqual(out, output1))
    {
        fail("Fail", new String(Hex.encode(output1)), new String(Hex.encode(out)));
    }
}
项目:bc-java    文件:VMPCMacTest.java   
public void performTest() throws Exception
{
    CipherParameters kp = new KeyParameter(
        Hex.decode("9661410AB797D8A9EB767C21172DF6C7"));
    CipherParameters kpwiv = new ParametersWithIV(kp,
        Hex.decode("4B5C2F003E67F39557A8D26F3DA2B155"));

    byte[] m = new byte[256];
    for (int i = 0; i < 256; i++)
    {
        m[i] = (byte) i;
    }

    VMPCMac mac = new VMPCMac();
    mac.init(kpwiv);

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

    byte[] out = new byte[20];
    mac.doFinal(out, 0);

    if (!Arrays.areEqual(out, output1))
    {
        fail("Fail", new String(Hex.encode(output1)), new String(Hex.encode(out)));
    }
}
项目:gwt-crypto    文件:VMPCMacTest.java   
public void performTest() throws Exception
{
    CipherParameters kp = new KeyParameter(
        Hex.decode("9661410AB797D8A9EB767C21172DF6C7"));
    CipherParameters kpwiv = new ParametersWithIV(kp,
        Hex.decode("4B5C2F003E67F39557A8D26F3DA2B155"));

    byte[] m = new byte[512];

    int offset = 117;
    for (int i = 0; i < 256; i++)
    {
        m[offset + i] = (byte) i;
    }

    VMPCMac mac = new VMPCMac();
    mac.init(kpwiv);

    mac.update(m, offset, 256);

    byte[] out = new byte[20];
    mac.doFinal(out, 0);

    if (!Arrays.areEqual(out, output1))
    {
        fail("Fail", new String(Hex.encode(output1)), new String(Hex.encode(out)));
    }
}
项目:ipack    文件:VMPC.java   
public Mac()
{
    super(new VMPCMac());
}
项目:Aki-SSL    文件:VMPC.java   
public Mac()
{
    super(new VMPCMac());
}
项目:CryptMeme    文件:VMPC.java   
public Mac()
{
    super(new VMPCMac());
}
项目:irma_future_id    文件:VMPC.java   
public Mac()
{
    super(new VMPCMac());
}
项目:bc-java    文件:VMPC.java   
public Mac()
{
    super(new VMPCMac());
}