语言

MLKem.Decapsulate 方法

定义

从提供的密码文本中解封共享机密。

重载

名称 说明
Decapsulate(Byte[])

从提供的密码文本中解封共享机密。

Decapsulate(ReadOnlySpan<Byte>, Span<Byte>)

从提供的密码文本中解封共享机密。

Decapsulate(Byte[])

Source:
MLKem.cs
Source:
MLKem.cs
Source:
MLKem.cs

从提供的密码文本中解封共享机密。

public:
 cli::array <System::Byte> ^ Decapsulate(cli::array <System::Byte> ^ ciphertext);
public byte[] Decapsulate(byte[] ciphertext);
member this.Decapsulate : byte[] -> byte[]
Public Function Decapsulate (ciphertext As Byte()) As Byte()

参数

ciphertext
Byte[]

密码文本。

返回

Byte[]

共享机密。

例外

在解封期间出错。

ciphertext 大小不正确。

ciphertext 是 null。

对象已释放。

注解

解封只能解封使用解封密钥的相应封装密钥创建的共享机密。 如果使用其他键,则 ML-KEM 执行隐式拒绝。

隐式拒绝意味着不会返回错误。 相反,共享机密将是一个确定性但不正确的结果。

检测不正确的密钥使用是 ML-KEM 算法使用者关注的问题。

有关详细信息,请参阅 FIPS 203 第 6.3 节。

适用于

Decapsulate(ReadOnlySpan<Byte>, Span<Byte>)

Source:
MLKem.cs
Source:
MLKem.cs
Source:
MLKem.cs

从提供的密码文本中解封共享机密。

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

参数

ciphertext
ReadOnlySpan<Byte>

密码文本。

sharedSecret
Span<Byte>

用于接收共享机密的缓冲区。

例外

在解封期间出错。

ciphertext 大小不正确。

-或者-

sharedSecret 大小不正确。

对象已释放。

注解

解封只能解封使用解封密钥的相应封装密钥创建的共享机密。 如果使用其他键,则 ML-KEM 执行隐式拒绝。

隐式拒绝意味着不会返回错误。 相反,共享机密将是一个确定性但不正确的结果。

检测不正确的密钥使用是 ML-KEM 算法使用者关注的问题。

有关详细信息,请参阅 FIPS 203 第 6.3 节。

适用于