public void Test(string keyHex, string nonceHex, string associatedDataHex, string tagHex, string plainHex, string cipherHex) { var key = keyHex.FromHex(); Test(new BcXChaCha20Poly1305Crypto(key), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); Test(AEADCryptoCreate.XChaCha20Poly1305(key), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); }
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 void Test(string keyHex, string nonceHex, string associatedDataHex, string tagHex, string plainHex, string cipherHex) { var key = keyHex.FromHex(); Test(AEADCryptoCreate.Sm4Gcm(key), nonceHex, associatedDataHex, tagHex, plainHex, cipherHex); }
protected override IAEADCrypto CreateCrypto(ReadOnlySpan<byte> key) { return AEADCryptoCreate.Sm4Gcm(key); }
public override void Init(byte[] key, byte[] iv) => crypto = AEADCryptoCreate.AesGcm(key);
public override void Init(byte[] key, byte[] iv) => crypto = AEADCryptoCreate.ChaCha20Poly1305(key);
public void Encrypt() { TestEncrypt(AEADCryptoCreate.ChaCha20Poly1305(_randomKey)); }
protected override IAEADCrypto CreateCrypto(ReadOnlySpan <byte> key) { return(AEADCryptoCreate.XChaCha20Poly1305(key)); }
protected override IAEADCrypto CreateCrypto(ReadOnlySpan <byte> key) { return(AEADCryptoCreate.AesGcm(key)); }
public void SM4GCMEncrypt() { TestEncrypt(AEADCryptoCreate.Sm4Gcm(_randomKey)); }