public AesCcm(ReadOnlySpan <byte> key) { ThrowIfNotSupported(); AesAEAD.CheckKeySize(key.Length); ImportKey(key); }
private void EncryptInternal( ReadOnlySpan <byte> nonce, ReadOnlySpan <byte> plaintext, Span <byte> ciphertext, Span <byte> tag, ReadOnlySpan <byte> associatedData = default) { AesAEAD.Encrypt(s_aesCcm, _keyHandle, nonce, associatedData, plaintext, ciphertext, tag); }
private void DecryptInternal( ReadOnlySpan <byte> nonce, ReadOnlySpan <byte> ciphertext, ReadOnlySpan <byte> tag, Span <byte> plaintext, ReadOnlySpan <byte> associatedData = default) { AesAEAD.Decrypt(s_aesGcm, _keyHandle, nonce, associatedData, ciphertext, tag, plaintext, clearPlaintextOnFailure: true); }
public AesCcm(byte[] key) { ThrowIfNotSupported(); ArgumentNullException.ThrowIfNull(key); AesAEAD.CheckKeySize(key.Length); ImportKey(key); }
private void DecryptInternal( ReadOnlySpan <byte> nonce, ReadOnlySpan <byte> ciphertext, ReadOnlySpan <byte> tag, Span <byte> plaintext, ReadOnlySpan <byte> associatedData = default) { // BCrypt implementation of CCM clears plaintext for you on failure AesAEAD.Decrypt(s_aesCcm, _keyHandle, nonce, associatedData, ciphertext, tag, plaintext, clearPlaintextOnFailure: false); }
public AesGcm(byte[] key) { if (key == null) { throw new ArgumentNullException(nameof(key)); } AesAEAD.CheckKeySize(key.Length * 8); ImportKey(key); }
public AesCcm(byte[] key) { ThrowIfNotSupported(); if (key == null) { throw new ArgumentNullException(nameof(key)); } AesAEAD.CheckKeySize(key.Length); ImportKey(key); }
public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[] associatedData = null) { AesAEAD.CheckArgumentsForNull(nonce, plaintext, ciphertext, tag); Decrypt((ReadOnlySpan <byte>)nonce, ciphertext, tag, plaintext, associatedData); }
public AesGcm(ReadOnlySpan <byte> key) { AesAEAD.CheckKeySize(key.Length * 8); ImportKey(key); }