public Mac() { super(new VMPCMac()); } }
public void reset() { initKey(this.workingKey, this.workingIV); g = x1 = x2 = x3 = x4 = n = 0; T = new byte[32]; for (int i = 0; i < 32; i++) { T[i] = 0; } }
public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException { if ((inOff + len) > in.length) { throw new DataLengthException("input buffer too short"); } for (int i = 0; i < len; i++) { update(in[inOff + i]); } } }
public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException { if ((inOff + len) > in.length) { throw new DataLengthException("input buffer too short"); } for (int i = 0; i < len; i++) { update(in[i]); } } }
public void init(CipherParameters params) throws IllegalArgumentException { if (!(params instanceof ParametersWithIV)) { throw new IllegalArgumentException( "VMPC-MAC Init parameters must include an IV"); } ParametersWithIV ivParams = (ParametersWithIV) params; KeyParameter key = (KeyParameter) ivParams.getParameters(); if (!(ivParams.getParameters() instanceof KeyParameter)) { throw new IllegalArgumentException( "VMPC-MAC Init parameters must include a key"); } this.workingIV = ivParams.getIV(); if (workingIV == null || workingIV.length < 1 || workingIV.length > 768) { throw new IllegalArgumentException( "VMPC-MAC requires 1 to 768 bytes of IV"); } this.workingKey = key.getKey(); reset(); }
public Mac() { super(new VMPCMac()); } }
public void reset() { initKey(this.workingKey, this.workingIV); g = x1 = x2 = x3 = x4 = n = 0; T = new byte[32]; for (int i = 0; i < 32; i++) { T[i] = 0; } }
public void init(CipherParameters params) throws IllegalArgumentException { if (!(params instanceof ParametersWithIV)) { throw new IllegalArgumentException( "VMPC-MAC Init parameters must include an IV"); } ParametersWithIV ivParams = (ParametersWithIV) params; KeyParameter key = (KeyParameter) ivParams.getParameters(); if (!(ivParams.getParameters() instanceof KeyParameter)) { throw new IllegalArgumentException( "VMPC-MAC Init parameters must include a key"); } this.workingIV = ivParams.getIV(); if (workingIV == null || workingIV.length < 1 || workingIV.length > 768) { throw new IllegalArgumentException( "VMPC-MAC requires 1 to 768 bytes of IV"); } this.workingKey = key.getKey(); reset(); }