SystemEX  Lacking
Additional generic collection types missing in .net
SystemEx.Hash.GrøstlHash Class Referencesealed
Inheritance diagram for SystemEx.Hash.GrøstlHash:
Collaboration diagram for SystemEx.Hash.GrøstlHash:

Classes

struct  PaddingState

Public Member Functions

 GrøstlHash (Endian endian)
 Craate a new instance.
Hash64 ComputeLong (FixedVector< byte > input, ulong seed)
 Computes a 64-bit hash value based on the Grøstl-512 digest for the specified input buffer, with optional seed mixing and endian-aware extraction.
Hash32 Compute (FixedVector< byte > input, uint seed)
 Computes a 32-bit hash value based on the Grøstl-256 digest for the specified input buffer, with optional seed mixing and endian-aware extraction.

Constructor & Destructor Documentation

◆ GrøstlHash()

SystemEx.Hash.GrøstlHash.GrøstlHash ( Endian endian)

Craate a new instance.

Parameters
endianThe suing endian for creating a hash
54 {
55 m_endian = endian;
56 }

Member Function Documentation

◆ Compute()

Hash32 SystemEx.Hash.GrøstlHash.Compute ( FixedVector< byte > input,
uint seed )

Computes a 32-bit hash value based on the Grøstl-256 digest for the specified input buffer, with optional seed mixing and endian-aware extraction.

Parameters
inputThe input byte sequence to be hashed. This is treated as an opaque binary buffer and processed according to the Grøstl-256 specification, including padding and compression. The full 256-bit digest is computed internally and then reduced to a 32-bit value.
seedAn optional 21-bit seed value that is XOR-mixed into the final hash result. This allows callers to derive distinct hash domains, build keyed hash variants, or introduce additional application-specific entropy without altering the core Grøstl-256 computation.
Returns
A Hash32 instance containing the 32-bit hash value derived from the Grøstl-256 digest of input , after endian-aware extraction and XOR-mixing with seed .

Implements SystemEx.Hash.IHash.

436 {
437
438 uint[] ColumnConstant = { 0x30201000u, 0x70605040u };
439 byte[,] ShiftValues = { { 0, 1, 2, 3, 4, 5, 6, 7 }, { 1, 3, 5, 7, 0, 2, 4, 6 } };
440
441 byte[] digest = Compute_Hash(input, 32, ShiftValues, ColumnConstant); // 32 Bytes (Grøstl-256)
442
443 uint value = digest.ToUInt(m_endian);
444
445 value ^= seed;
446 return new Hash32(value);
447 }

◆ ComputeLong()

Hash64 SystemEx.Hash.GrøstlHash.ComputeLong ( FixedVector< byte > input,
ulong seed )

Computes a 64-bit hash value based on the Grøstl-512 digest for the specified input buffer, with optional seed mixing and endian-aware extraction.

Parameters
inputThe input byte sequence to be hashed. This is treated as an opaque binary buffer and processed according to the Grøstl-512 specification, including padding and compression. The full 512-bit digest is computed internally and then reduced to a 64-bit value.
seedAn optional 64-bit seed value that is XOR-mixed into the final hash result. This allows callers to derive distinct hash domains, build keyed hash variants, or introduce additional application-specific entropy without altering the core Grøstl-512 computation.
Returns
A Hash64 instance containing the 64-bit hash value derived from the Grøstl-512 digest of input , after endian-aware extraction and XOR-mixing with seed .

Implements SystemEx.Hash.IHash.

403 {
404 uint[] ColumnConstant = { 0x30201000, 0x70605040, 0xb0a09080, 0xf0e0d0c0 };
405 byte[,] ShiftValues = { {0, 1, 2, 3, 4, 5, 6, 11}, {1, 3, 5, 11, 0, 2, 4, 6} };
406
407 byte[] digest = Compute_Hash(input, 64, ShiftValues, ColumnConstant); // 64 Bytes (Grøstl-512)
408
409 ulong value = digest.ToULong(m_endian);
410
411 value ^= seed;
412 return new Hash64(value);
413 }

The documentation for this class was generated from the following file:
  • GrøstlHash.cs