コード例 #1
0
        static AesDecryptorBenchmark()
        {
            plaintext  = new byte[2048 * 16 + 16];
            key        = SymmetricJwk.GenerateKey(128).AsSpan().ToArray();
            nonce      = new byte[] { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 };
            _encryptor = new AesCbcEncryptor(EncryptionAlgorithm.A128CbcHS256);
            _decryptor = new AesCbcDecryptor(EncryptionAlgorithm.A128CbcHS256);
#if SUPPORT_SIMD
            _decryptorNi = new Aes128CbcDecryptor();
#endif
        }
コード例 #2
0
        static AesDecryptorBenchmark()
        {
            plaintext = new byte[2048 * 16 + 16];
            var key = SymmetricJwk.GenerateKey(128);

            nonce      = new byte[] { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 };
            _encryptor = new AesCbcEncryptor(key.K, EncryptionAlgorithm.Aes128CbcHmacSha256);
            _decryptor = new AesCbcDecryptor(key.K, EncryptionAlgorithm.Aes128CbcHmacSha256);
#if NETCOREAPP3_0
            _decryptorNi = new Aes128NiCbcDecryptor(key.K);
#endif
        }