8[UnsupportedOSPlatform(
"browser")]
9[UnsupportedOSPlatform(
"ios")]
10[UnsupportedOSPlatform(
"tvos")]
37 if (keySizeInBytes != 32)
43 public void Encrypt(
byte[] nonce,
byte[] plaintext,
byte[] ciphertext,
byte[] tag,
byte[]? associatedData =
null)
52 EncryptCore(nonce, plaintext, ciphertext, tag, associatedData);
55 public void Decrypt(
byte[] nonce,
byte[] ciphertext,
byte[] tag,
byte[] plaintext,
byte[]? associatedData =
null)
64 DecryptCore(nonce, ciphertext, tag, plaintext, associatedData);
91 [MemberNotNull(
"_keyHandle")]
static bool IsChaCha20Poly1305Supported
static SafeAlgorithmHandle ChaCha20Poly1305
static string Cryptography_AlgorithmNotSupported
static string Cryptography_InvalidNonceLength
static string Format(string resourceFormat, object p1)
static string Cryptography_PlaintextCiphertextLengthMismatch
static string Cryptography_InvalidKeySize
static string Cryptography_InvalidTagLength
static void CheckArgumentsForNull(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag)
static unsafe void Decrypt(SafeKeyHandle keyHandle, ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > associatedData, ReadOnlySpan< byte > ciphertext, ReadOnlySpan< byte > tag, Span< byte > plaintext, bool clearPlaintextOnFailure)
static unsafe void Encrypt(SafeKeyHandle keyHandle, ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > associatedData, ReadOnlySpan< byte > plaintext, Span< byte > ciphertext, Span< byte > tag)
void EncryptCore(ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > plaintext, Span< byte > ciphertext, Span< byte > tag, ReadOnlySpan< byte > associatedData=default(ReadOnlySpan< byte >))
void DecryptCore(ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > ciphertext, ReadOnlySpan< byte > tag, Span< byte > plaintext, ReadOnlySpan< byte > associatedData=default(ReadOnlySpan< byte >))
static void CheckKeySize(int keySizeInBytes)
void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData=null)
void ImportKey(ReadOnlySpan< byte > key)
static void CheckParameters(ReadOnlySpan< byte > plaintext, ReadOnlySpan< byte > ciphertext, ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > tag)
void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData=null)
void Encrypt(ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > plaintext, Span< byte > ciphertext, Span< byte > tag, ReadOnlySpan< byte > associatedData=default(ReadOnlySpan< byte >))
void Decrypt(ReadOnlySpan< byte > nonce, ReadOnlySpan< byte > ciphertext, ReadOnlySpan< byte > tag, Span< byte > plaintext, ReadOnlySpan< byte > associatedData=default(ReadOnlySpan< byte >))
ChaCha20Poly1305(byte[] key)
ChaCha20Poly1305(ReadOnlySpan< byte > key)
static void ThrowIfNotSupported()
override void Dispose(bool disposing)