コード例 #1
0
ファイル: AesCtrMode.cs プロジェクト: garoxas/LibHac
        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));
        }
コード例 #2
0
 public void Initialize(ReadOnlySpan <byte> key, bool isDecrypting)
 {
     _aesCore = new AesCore();
     _aesCore.Initialize(key, ReadOnlySpan <byte> .Empty, CipherMode.ECB, isDecrypting);
 }
コード例 #3
0
 public void Initialize(ReadOnlySpan <byte> key, ReadOnlySpan <byte> iv, bool isDecrypting)
 {
     _aesCore = new AesCore();
     _aesCore.Initialize(key, iv, CipherMode.CBC, isDecrypting);
 }