Block ciphers - HMBSbige/CryptoBase GitHub Wiki

Create

AES

IBlock16Cipher<AesCipher> cipher = AesCipher.Create(key);

SM4

IBlock16Cipher<Sm4Cipher> cipher = Sm4Cipher.Create(key);

Properties

Property Description
Name Human-readable name of the cipher implementation.
IsSupported Indicates whether this cipher implementation is supported on the current runtime/platform.
HardwareAcceleration Indicates the level of hardware acceleration available for this cipher.

Methods

Method Description
void Dispose() Releases any unmanaged resources or pooled buffers held by the instance.
static TSelf Create(in ReadOnlySpan<byte> key) Creates a new cipher instance initialized with the provided key bytes. The method takes a read-only span of key material and returns a configured TSelf instance.
VectorBuffer{16,32,64,128} Encrypt(scoped in VectorBuffer{16,32,64,128} source) Encrypts the provided input vectors/buffer and returns an encrypted vectors/buffer of the same size.
VectorBuffer{16,32,64,128} Decrypt(scoped in VectorBuffer{16,32,64,128} source) Decrypts the provided input vectors/buffer and returns a decrypted vectors/buffer of the same size.
VectorBuffer{128,256} EncryptV256(scoped in VectorBuffer{128,256} source), VectorBuffer{128,256} DecryptV256(scoped in VectorBuffer{128,256} source) V256 variant operating
VectorBuffer{256,512} EncryptV512(scoped in VectorBuffer{256,512} source), VectorBuffer{256,512} DecryptV512(scoped in VectorBuffer{256,512} source) V512 variant operating
⚠️ **GitHub.com Fallback** ⚠️