-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ChaCha20Poly1305.xml
420 lines (392 loc) · 26.5 KB
/
ChaCha20Poly1305.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<Type Name="ChaCha20Poly1305" FullName="System.Security.Cryptography.ChaCha20Poly1305">
<TypeSignature Language="C#" Value="public sealed class ChaCha20Poly1305 : IDisposable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ChaCha20Poly1305 extends System.Object implements class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:System.Security.Cryptography.ChaCha20Poly1305" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class ChaCha20Poly1305
Implements IDisposable" />
<TypeSignature Language="F#" Value="type ChaCha20Poly1305 = class
 interface IDisposable" />
<TypeSignature Language="C++ CLI" Value="public ref class ChaCha20Poly1305 sealed : IDisposable" />
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.Security.Cryptography.Algorithms" FromVersion="7.0.0.0" To="System.Security.Cryptography" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="System.Security.Cryptography.Algorithms" FromVersion="8.0.0.0" To="System.Security.Cryptography" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="System.Security.Cryptography.Algorithms" FromVersion="9.0.0.0" To="System.Security.Cryptography" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface FrameworkAlternate="net-9.0">
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a symmetric key to be used with the ChaCha20 stream cipher in the combined mode with the Poly1305 authenticator.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ChaCha20Poly1305 (byte[] key);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] key) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.#ctor(System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Sub New (key As Byte())" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.ChaCha20Poly1305 : byte[] -> System.Security.Cryptography.ChaCha20Poly1305" Usage="new System.Security.Cryptography.ChaCha20Poly1305 key" />
<MemberSignature Language="C++ CLI" Value="public:
 ChaCha20Poly1305(cli::array <System::Byte> ^ key);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="key" Type="System.Byte[]" />
</Parameters>
<Docs>
<param name="key">The secret key to use for this instance.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.ChaCha20Poly1305" /> class with a provided key.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="key" /> parameter length is not 32 bytes (256 bits).</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ChaCha20Poly1305 (ReadOnlySpan<byte> key);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.ReadOnlySpan`1<unsigned int8> key) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.#ctor(System.ReadOnlySpan{System.Byte})" />
<MemberSignature Language="VB.NET" Value="Public Sub New (key As ReadOnlySpan(Of Byte))" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.ChaCha20Poly1305 : ReadOnlySpan<byte> -> System.Security.Cryptography.ChaCha20Poly1305" Usage="new System.Security.Cryptography.ChaCha20Poly1305 key" />
<MemberSignature Language="C++ CLI" Value="public:
 ChaCha20Poly1305(ReadOnlySpan<System::Byte> key);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="key" Type="System.ReadOnlySpan<System.Byte>" />
</Parameters>
<Docs>
<param name="key">The secret key to use for this instance.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.ChaCha20Poly1305" /> class with a provided key.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="key" /> parameter length is not 32 bytes (256 bits).</exception>
</Docs>
</Member>
<Member MemberName="Decrypt">
<MemberSignature Language="C#" Value="public void Decrypt (byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Decrypt(unsigned int8[] nonce, unsigned int8[] ciphertext, unsigned int8[] tag, unsigned int8[] plaintext, unsigned int8[] associatedData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.Decrypt(System.Byte[],System.Byte[],System.Byte[],System.Byte[],System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Sub Decrypt (nonce As Byte(), ciphertext As Byte(), tag As Byte(), plaintext As Byte(), Optional associatedData As Byte() = Nothing)" />
<MemberSignature Language="F#" Value="member this.Decrypt : byte[] * byte[] * byte[] * byte[] * byte[] -> unit" Usage="chaCha20Poly1305.Decrypt (nonce, ciphertext, tag, plaintext, associatedData)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="nonce" Type="System.Byte[]" />
<Parameter Name="ciphertext" Type="System.Byte[]" />
<Parameter Name="tag" Type="System.Byte[]" />
<Parameter Name="plaintext" Type="System.Byte[]" />
<Parameter Name="associatedData" Type="System.Byte[]">
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="nonce">The nonce associated with this message, which must match the value provided during encryption.</param>
<param name="ciphertext">The encrypted content to decrypt.</param>
<param name="tag">The authentication tag produced for this message during encryption.</param>
<param name="plaintext">The byte array to receive the decrypted contents.</param>
<param name="associatedData">Extra data associated with this message, which must match the value provided during encryption.</param>
<summary>Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If `tag` cannot be validated (using the key, `nonce`, `ciphertext`, and `associatedData` values), then `plaintext` is cleared.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="plaintext" /> parameter and the <paramref name="ciphertext" /> do not have the same length.
-or-
The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
-or-
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
</Docs>
</Member>
<Member MemberName="Decrypt">
<MemberSignature Language="C#" Value="public void Decrypt (ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> tag, Span<byte> plaintext, ReadOnlySpan<byte> associatedData = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Decrypt(valuetype System.ReadOnlySpan`1<unsigned int8> nonce, valuetype System.ReadOnlySpan`1<unsigned int8> ciphertext, valuetype System.ReadOnlySpan`1<unsigned int8> tag, valuetype System.Span`1<unsigned int8> plaintext, valuetype System.ReadOnlySpan`1<unsigned int8> associatedData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.Decrypt(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte},System.Span{System.Byte},System.ReadOnlySpan{System.Byte})" />
<MemberSignature Language="VB.NET" Value="Public Sub Decrypt (nonce As ReadOnlySpan(Of Byte), ciphertext As ReadOnlySpan(Of Byte), tag As ReadOnlySpan(Of Byte), plaintext As Span(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing)" />
<MemberSignature Language="F#" Value="member this.Decrypt : ReadOnlySpan<byte> * ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> unit" Usage="chaCha20Poly1305.Decrypt (nonce, ciphertext, tag, plaintext, associatedData)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="nonce" Type="System.ReadOnlySpan<System.Byte>" />
<Parameter Name="ciphertext" Type="System.ReadOnlySpan<System.Byte>" />
<Parameter Name="tag" Type="System.ReadOnlySpan<System.Byte>" />
<Parameter Name="plaintext" Type="System.Span<System.Byte>" />
<Parameter Name="associatedData" Type="System.ReadOnlySpan<System.Byte>" />
</Parameters>
<Docs>
<param name="nonce">The nonce associated with this message, which must match the value provided during encryption.</param>
<param name="ciphertext">The encrypted content to decrypt.</param>
<param name="tag">The authentication tag produced for this message during encryption.</param>
<param name="plaintext">The byte array to receive the decrypted contents.</param>
<param name="associatedData">Extra data associated with this message, which must match the value provided during encryption.</param>
<summary>Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If `tag` cannot be validated (using the key, `nonce`, `ciphertext`, and `associatedData` values), then `plaintext` is cleared.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="plaintext" /> parameter and the <paramref name="ciphertext" /> do not have the same length.
-or-
The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
-or-
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit" Usage="chaCha20Poly1305.Dispose " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Dispose();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Encrypt">
<MemberSignature Language="C#" Value="public void Encrypt (byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Encrypt(unsigned int8[] nonce, unsigned int8[] plaintext, unsigned int8[] ciphertext, unsigned int8[] tag, unsigned int8[] associatedData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.Encrypt(System.Byte[],System.Byte[],System.Byte[],System.Byte[],System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Sub Encrypt (nonce As Byte(), plaintext As Byte(), ciphertext As Byte(), tag As Byte(), Optional associatedData As Byte() = Nothing)" />
<MemberSignature Language="F#" Value="member this.Encrypt : byte[] * byte[] * byte[] * byte[] * byte[] -> unit" Usage="chaCha20Poly1305.Encrypt (nonce, plaintext, ciphertext, tag, associatedData)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="nonce" Type="System.Byte[]" />
<Parameter Name="plaintext" Type="System.Byte[]" />
<Parameter Name="ciphertext" Type="System.Byte[]" />
<Parameter Name="tag" Type="System.Byte[]" />
<Parameter Name="associatedData" Type="System.Byte[]">
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="nonce">The nonce associated with this message, which should be a unique value for every operation with the same key.</param>
<param name="plaintext">The content to encrypt.</param>
<param name="ciphertext">The byte array to receive the encrypted contents.</param>
<param name="tag">The byte array to receive the generated authentication tag.</param>
<param name="associatedData">Extra data associated with this message, which must also be provided during decryption.</param>
<summary>Encrypts the plaintext into the ciphertext destination buffer and generates the authentication tag into a separate buffer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The security guarantees of the ChaCha20/Poly1305 algorithm mode require that the same nonce value is never used twice with the same key.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="plaintext" /> parameter and the <paramref name="ciphertext" /> do not have the same length.
-or-
The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
-or-
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.Security.Cryptography.CryptographicException">The encryption operation failed.</exception>
</Docs>
</Member>
<Member MemberName="Encrypt">
<MemberSignature Language="C#" Value="public void Encrypt (ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> plaintext, Span<byte> ciphertext, Span<byte> tag, ReadOnlySpan<byte> associatedData = default);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Encrypt(valuetype System.ReadOnlySpan`1<unsigned int8> nonce, valuetype System.ReadOnlySpan`1<unsigned int8> plaintext, valuetype System.Span`1<unsigned int8> ciphertext, valuetype System.Span`1<unsigned int8> tag, valuetype System.ReadOnlySpan`1<unsigned int8> associatedData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.ChaCha20Poly1305.Encrypt(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte},System.Span{System.Byte},System.Span{System.Byte},System.ReadOnlySpan{System.Byte})" />
<MemberSignature Language="VB.NET" Value="Public Sub Encrypt (nonce As ReadOnlySpan(Of Byte), plaintext As ReadOnlySpan(Of Byte), ciphertext As Span(Of Byte), tag As Span(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing)" />
<MemberSignature Language="F#" Value="member this.Encrypt : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * Span<byte> * ReadOnlySpan<byte> -> unit" Usage="chaCha20Poly1305.Encrypt (nonce, plaintext, ciphertext, tag, associatedData)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="nonce" Type="System.ReadOnlySpan<System.Byte>" />
<Parameter Name="plaintext" Type="System.ReadOnlySpan<System.Byte>" />
<Parameter Name="ciphertext" Type="System.Span<System.Byte>" />
<Parameter Name="tag" Type="System.Span<System.Byte>" />
<Parameter Name="associatedData" Type="System.ReadOnlySpan<System.Byte>" />
</Parameters>
<Docs>
<param name="nonce">The nonce associated with this message, which should be a unique value for every operation with the same key.</param>
<param name="plaintext">The content to encrypt.</param>
<param name="ciphertext">The byte array to receive the encrypted contents.</param>
<param name="tag">The byte array to receive the generated authentication tag.</param>
<param name="associatedData">Extra data associated with this message, which must also be provided during decryption.</param>
<summary>Encrypts the plaintext into the ciphertext destination buffer and generates the authentication tag into a separate buffer.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The security guarantees of the ChaCha20/Poly1305 algorithm mode require that the same nonce value is never used twice with the same key.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="plaintext" /> parameter and the <paramref name="ciphertext" /> do not have the same length.
-or-
The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
-or-
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.Security.Cryptography.CryptographicException">The encryption operation failed.</exception>
</Docs>
</Member>
<Member MemberName="IsSupported">
<MemberSignature Language="C#" Value="public static bool IsSupported { get; }" />
<MemberSignature Language="ILAsm" Value=".property bool IsSupported" />
<MemberSignature Language="DocId" Value="P:System.Security.Cryptography.ChaCha20Poly1305.IsSupported" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly Property IsSupported As Boolean" />
<MemberSignature Language="F#" Value="static member IsSupported : bool" Usage="System.Security.Cryptography.ChaCha20Poly1305.IsSupported" />
<MemberSignature Language="C++ CLI" Value="public:
 static property bool IsSupported { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Algorithms</AssemblyName>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the algorithm is supported on the current platform.</summary>
<value>
<see langword="true" /> if the algorithm is supported; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>