Class Kalyna512
- Namespace
- CryptoHives.Foundation.Security.Cryptography.Cipher
- Assembly
- CryptoHives.Foundation.Security.Cryptography.dll
Kalyna-512 symmetric cipher implementation (DSTU 7624:2014).
public sealed class Kalyna512 : SymmetricCipher, IDisposable
- Inheritance
-
Kalyna512
- Implements
- Inherited Members
Remarks
Kalyna-512 uses a 256-bit block with a 512-bit key (18 rounds). This is the widest Kalyna configuration supported by the standard.
Constructors
Kalyna512()
Initializes a new instance of the Kalyna512 class.
public Kalyna512()
Fields
BlockSizeBits
Block size in bits.
public const int BlockSizeBits = 256
Field Value
BlockSizeBytes
Block size in bytes.
public const int BlockSizeBytes = 32
Field Value
KeySizeBits
Key size in bits.
public const int KeySizeBits = 512
Field Value
KeySizeBytes
Key size in bytes.
public const int KeySizeBytes = 64
Field Value
Properties
AlgorithmName
Gets the name of the cipher algorithm.
public override string AlgorithmName { get; }
Property Value
Examples
"AES-256", "ChaCha20", "AES-256-GCM"
IVSize
Gets the required IV/nonce size in bytes for the current mode.
public override int IVSize { get; }
Property Value
Key
Gets or sets the secret key for the cipher operation.
public override byte[] Key { get; set; }
Property Value
- byte[]
Exceptions
- ArgumentNullException
Value is null.
- CryptographicException
Value has an invalid size.
Methods
Create()
Creates a new instance of the Kalyna512 cipher.
public static Kalyna512 Create()
Returns
CreateCipherDecryptor(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Creates a decryptor transform using the specified key and IV.
protected override ICipherTransform CreateCipherDecryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
Parameters
keyReadOnlySpan<byte>The secret key.
ivReadOnlySpan<byte>The initialization vector or nonce.
Returns
- ICipherTransform
A new cipher decryptor transform.
CreateCipherEncryptor(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Creates an encryptor transform using the specified key and IV.
protected override ICipherTransform CreateCipherEncryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)
Parameters
keyReadOnlySpan<byte>The secret key.
ivReadOnlySpan<byte>The initialization vector or nonce.
Returns
- ICipherTransform
A new cipher encryptor transform.