public CMAC() { super(new CMac(new SEEDEngine())); } }
public CMAC() { super(new CMac(new BlowfishEngine())); } }
public CMAC() { super(new CMac(new DESedeEngine())); } }
public CMAC() { super(new CMac(new Shacal2Engine())); } }
public CMAC() { super(new CMac(new DESEngine())); } }
public CMAC() { super(new CMac(new DESedeEngine())); } }
public AESCMAC() { super(new CMac(new AESEngine())); } }
public AESCMAC() { super(new CMac(new AESFastEngine())); } }
public CMAC_256() { super(new CMac(new ThreefishEngine(256))); } }
public CMAC_512() { super(new CMac(new ThreefishEngine(512))); } }
public CMAC_1024() { super(new CMac(new ThreefishEngine(1024))); } }
public CMAC() { super(new CMac(new SM4Engine())); } }
public CMAC() { super(new CMac(new DESEngine())); } }
@Override public byte[] getMAC(final byte[] data) { byte[] n = new byte[this.sscBytes.length + data.length]; System.arraycopy(this.sscBytes, 0, n, 0, this.sscBytes.length); System.arraycopy(data, 0, n, this.sscBytes.length, data.length); n = addPadding(n); final BlockCipher cipher = new AESEngine(); final Mac mac = new CMac(cipher, 64); mac.init(this.keyP); mac.update(n, 0, n.length); final byte[] out = new byte[mac.getMacSize()]; mac.doFinal(out, 0); return out; }
/** * Constructor that accepts an instance of a block cipher engine. * * @param cipher the engine to use */ public EAXBlockCipher(BlockCipher cipher) { blockSize = cipher.getBlockSize(); mac = new CMac(cipher); macBlock = new byte[blockSize]; associatedTextMac = new byte[mac.getMacSize()]; nonceMac = new byte[mac.getMacSize()]; this.cipher = new SICBlockCipher(cipher); }
/** * Constructor that accepts an instance of a block cipher engine. * * @param cipher the engine to use */ public EAXBlockCipher(BlockCipher cipher) { blockSize = cipher.getBlockSize(); mac = new CMac(cipher); macBlock = new byte[blockSize]; bufBlock = new byte[blockSize * 2]; associatedTextMac = new byte[mac.getMacSize()]; nonceMac = new byte[mac.getMacSize()]; this.cipher = new SICBlockCipher(cipher); }
public static byte[] calculateCMAC(final byte[] data, final byte[] key) { final byte[] cmac = new byte[16]; CipherParameters cipherParameters = new KeyParameter(key); BlockCipher blockCipher = new AESEngine(); CMac mac = new CMac(blockCipher); mac.init(cipherParameters); mac.update(data, 0, data.length); mac.doFinal(cmac, 0); return cmac; }
@Override public byte[] doAesCmac(final byte[] data, final byte[] key) { final BlockCipher cipher = new AESEngine(); final org.spongycastle.crypto.Mac mac = new CMac(cipher, 64); final KeyParameter keyP = new KeyParameter(key); mac.init(keyP); mac.update(data, 0, data.length); final byte[] out = new byte[8]; mac.doFinal(out, 0); return out; }
public static byte[] calculateCMAC(final byte[] data, final byte[] key, final int offset) { final byte[] cmac = new byte[data.length]; CipherParameters cipherParameters = new KeyParameter(key); BlockCipher blockCipher = new AESEngine(); CMac mac = new CMac(blockCipher); mac.init(cipherParameters); mac.update(data, offset, data.length); mac.doFinal(cmac, 0); return cmac; }
CMac mac = new CMac(cypher, 64); mac.init(new KeyParameter(authKey)); byte[] counter = Utilities.intToByteArray(Integer.parseInt(seqNum, 16));