public void Test(string keyHex, string nonceHex, string associatedDataHex, string tagHex, string plainHex, string cipherHex) { var key = keyHex.FromHex(); Test(new DefaultAesGcmCrypto(key), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); Test(new BcAesGcmCrypto(key), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); Test(new GcmCryptoMode(AESUtils.CreateECB(key)), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); Test(AEADCryptoCreate.AesGcm(key), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); }
public override void Init(byte[] key, byte[] iv) => crypto = AEADCryptoCreate.AesGcm(key);
protected override IAEADCrypto CreateCrypto(ReadOnlySpan <byte> key) { return(AEADCryptoCreate.AesGcm(key)); }