Table of Contents

Class Sm4Gcm

Namespace
CryptoHives.Foundation.Security.Cryptography.Cipher
Assembly
CryptoHives.Foundation.Security.Cryptography.dll

SM4-GCM authenticated encryption (SM4 per GB/T 32907-2016; the TLS 1.3 suite TLS_SM4_GCM_SM3 of RFC 8998).

public sealed class Sm4Gcm : GcmCipher, IAeadCipher, IDisposable
Inheritance
Sm4Gcm
Implements
Inherited Members

Constructors

Sm4Gcm(ReadOnlySpan<byte>)

Initializes a new instance of the Sm4Gcm class.

public Sm4Gcm(ReadOnlySpan<byte> key)

Parameters

key ReadOnlySpan<byte>

The 16-byte SM4 key.

Exceptions

ArgumentException

The key has the wrong length.

Properties

AlgorithmName

Gets the algorithm name.

public override string AlgorithmName { get; }

Property Value

string

Methods

Create(ReadOnlySpan<byte>)

Creates a new SM4-GCM instance.

public static Sm4Gcm Create(ReadOnlySpan<byte> key)

Parameters

key ReadOnlySpan<byte>

The 16-byte SM4 key.

Returns

Sm4Gcm

A new SM4-GCM instance.