Edit

Share via


MLKem.Encapsulate Method

Definition

Overloads

Encapsulate(Byte[], Byte[])

Creates an encapsulation ciphertext and shared secret.

Encapsulate(Span<Byte>, Span<Byte>)

Creates an encapsulation ciphertext and shared secret, writing them into the provided buffers.

Encapsulate(Byte[], Byte[])

Source:
MLKem.cs
Source:
MLKem.cs

Creates an encapsulation ciphertext and shared secret.

public:
 void Encapsulate([Runtime::InteropServices::Out] cli::array <System::Byte> ^ % ciphertext, [Runtime::InteropServices::Out] cli::array <System::Byte> ^ % sharedSecret);
public void Encapsulate(out byte[] ciphertext, out byte[] sharedSecret);
member this.Encapsulate : Byte[] * Byte[] -> unit
Public Sub Encapsulate (ByRef ciphertext As Byte(), ByRef sharedSecret As Byte())

Parameters

ciphertext
Byte[]

When this method returns, contains the ciphertext.

sharedSecret
Byte[]

When this method returns, contains the shared secret.

Exceptions

An error occurred during encapsulation.

The object has already been disposed.

Applies to

Encapsulate(Span<Byte>, Span<Byte>)

Source:
MLKem.cs
Source:
MLKem.cs

Creates an encapsulation ciphertext and shared secret, writing them into the provided buffers.

public:
 void Encapsulate(Span<System::Byte> ciphertext, Span<System::Byte> sharedSecret);
public void Encapsulate(Span<byte> ciphertext, Span<byte> sharedSecret);
member this.Encapsulate : Span<byte> * Span<byte> -> unit
Public Sub Encapsulate (ciphertext As Span(Of Byte), sharedSecret As Span(Of Byte))

Parameters

ciphertext
Span<Byte>

The buffer to receive the ciphertext.

sharedSecret
Span<Byte>

The buffer to receive the shared secret.

Exceptions

An error occurred during encapsulation.

-or -

ciphertext overlaps with sharedSecret.

ciphertext is not the correct size.

-or-

sharedSecret is not the correct size.

The object has already been disposed.

Applies to