Example #1
0
        public void Initialize(ReadOnlySpan <byte> key, ReadOnlySpan <byte> iv)
        {
            Debug.Assert(iv.Length == Aes.BlockSize);

            _aesCore = new AesCore();
            _aesCore.Initialize(key, ReadOnlySpan <byte> .Empty, CipherMode.ECB, false);

            Iv = Unsafe.ReadUnaligned <Buffer16>(ref MemoryMarshal.GetReference(iv));
        }
Example #2
0
 public void Initialize(ReadOnlySpan <byte> key, ReadOnlySpan <byte> iv, bool isDecrypting)
 {
     _aesCore = new AesCore();
     _aesCore.Initialize(key, iv, CipherMode.CBC, isDecrypting);
 }
Example #3
0
 public void Initialize(ReadOnlySpan <byte> key, bool isDecrypting)
 {
     _aesCore = new AesCore();
     _aesCore.Initialize(key, ReadOnlySpan <byte> .Empty, CipherMode.ECB, isDecrypting);
 }