Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
 public override void Init(byte[] key, byte[] iv) => crypto = AEADCryptoCreate.AesGcm(key);
Ejemplo n.º 3
0
 protected override IAEADCrypto CreateCrypto(ReadOnlySpan <byte> key)
 {
     return(AEADCryptoCreate.AesGcm(key));
 }