Skip to content

OnixLabs.Security.Cryptography.Sha3Hash224

matthew edited this page May 27, 2026 · 1 revision

Sha3Hash224 Class

Represents the FIPS 202 SHA-3 224-bit fixed-length hash algorithm.

Namespace OnixLabs.Security.Cryptography
Assembly OnixLabs.Security.Cryptography.dll (NuGet)
Inheritance object → HashAlgorithm → Sha3 → Sha3Hash224

Definition

public sealed class Sha3Hash224 : Sha3

Remarks

Sha3Hash224 implements the SHA3-224 variant of the FIPS 202 standard. It always produces a 224-bit (28-byte) digest. The sponge rate is fixed at 144 bytes and the domain-separation delimiter 0x06 (HashDelimiter) is applied during padding, as required by FIPS 202 for the fixed-length hash family.

Because the output length is baked into the constructor, the digest size cannot be changed after construction. Use Sha3Shake128 or Sha3Shake256 if a variable-length output is needed.

The preferred instantiation path is the static factory method Sha3.CreateSha3Hash224(). Constructing directly with new Sha3Hash224() is equivalent.

Because Sha3Hash224 extends HashAlgorithm, it integrates with all BCL hashing idioms: ComputeHash, TransformBlock / TransformFinalBlock, the using-disposable pattern, and Hash.Compute all work without modification.

Examples

Computing a SHA3-224 digest

using OnixLabs.Security.Cryptography;

byte[] input = System.Text.Encoding.UTF8.GetBytes("Hello, World!");

using Sha3Hash224 sha3 = Sha3.CreateSha3Hash224();
byte[] hash = sha3.ComputeHash(input);

Console.WriteLine(Convert.ToHexString(hash));
// 853048A46D57D84357E54A763CC7C5CF01B7E2A5EA1D2B70ACB5B4C

Computing a SHA3-224 digest via the Hash wrapper

using System.Security.Cryptography;
using OnixLabs.Security.Cryptography;

byte[] input = System.Text.Encoding.UTF8.GetBytes("Hello, World!");

using HashAlgorithm sha3 = new Sha3Hash224();
Hash hash = Hash.Compute(sha3, input);

Console.WriteLine(hash); // lowercase hex, 56 characters

Constructors

Constructor Description
Sha3Hash224() Initializes a new instance of the Sha3Hash224 class.

Sha3Hash224()

public Sha3Hash224()

Initializes a new instance of the Sha3Hash224 class, configuring the Keccak sponge with a rate of 144 bytes and a 224-bit output length. The sponge state is reset immediately via Initialize.

See Also

ONIXLabs .NET Library


Clone this wiki locally