public CMAC() { super(new CMac(new DESedeEngine())); } }
public CMAC() { super(new CMac(new SEEDEngine())); } }
public CMAC_256() { super(new CMac(new ThreefishEngine(256))); } }
public CMAC_512() { super(new CMac(new ThreefishEngine(512))); } }
public CMAC() { super(new CMac(new DESEngine())); } }
public Mac() { super(new CMac(new GOST3412_2015Engine())); } }
public CMAC() { super(new CMac(new Shacal2Engine())); } }
public AESCMAC() { super(new CMac(new AESEngine())); } }
public CMAC_1024() { super(new CMac(new ThreefishEngine(1024))); } }
public CMAC() { super(new CMac(new SM4Engine())); } }
public CMAC() { super(new CMac(new BlowfishEngine())); } }
/** * 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]; associatedTextMac = new byte[mac.getMacSize()]; nonceMac = new byte[mac.getMacSize()]; this.cipher = new SICBlockCipher(cipher); }
public static byte[] scp03_mac(byte[] keybytes, byte[] msg, int lengthBits) { // Use BouncyCastle light interface. BlockCipher cipher = new AESEngine(); CMac cmac = new CMac(cipher); cmac.init(new KeyParameter(keybytes)); cmac.update(msg, 0, msg.length); byte[] out = new byte[cmac.getMacSize()]; cmac.doFinal(out, 0); return Arrays.copyOf(out, lengthBits / 8); }
public static byte[] scp03_kdf(byte[] key, byte[] a, byte[] b, int bytes) { BlockCipher cipher = new AESEngine(); CMac cmac = new CMac(cipher); KDFCounterBytesGenerator kdf = new KDFCounterBytesGenerator(cmac); kdf.init(new KDFCounterParameters(key, a, b, 8)); // counter size is in bits byte[] cgram = new byte[bytes]; kdf.generateBytes(cgram, 0, cgram.length); return cgram; }
public static byte[] generateCmac(byte[] key, String msg) throws UnsupportedEncodingException { CMac cmac = new CMac(new AESFastEngine()); byte[] data = msg.getBytes("UTF-8"); byte[] output = new byte[cmac.getMacSize()]; cmac.init(new KeyParameter(key)); cmac.reset(); cmac.update(data, 0, data.length); cmac.doFinal(output, 0); return output; }