Table of Contents

Skein512 Class

Definition

Namespace
Bodu.Security.Cryptography
Assembly
Bodu.Security.Cryptography.dll
Package
Bodu.Security.Cryptography 1.2.0
Source
Skein.512.cs

Computes a hash using the Skein-512 variant of the Skein hash function, built on top of the Threefish512Cipher tweakable block cipher. This class cannot be inherited.

public sealed class Skein512 : Skein, ICryptoTransform, IDisposable
Inheritance
Skein512
Implements
Inherited Members
Extension Methods

Examples

using var skein = new Skein512(); // Skein-512-512 (the canonical configuration)
byte[] digest = skein.ComputeHash(message);

using var skeinMac = new Skein512 { Key = key }; // Skein-MAC-512-512
byte[] tag = skeinMac.ComputeHash(message);

Remarks

Skein512 operates on a 512-bit internal state in 64-byte blocks. It is the primary Skein variant recommended by the 1.3 specification for general-purpose use and is the version originally submitted to the NIST SHA-3 competition. The permitted output sizes are 128, 160, 224, 256, 384, and 512 bits; 512 bits is the default.

Supplying a non-empty Key turns the instance into the keyed Skein-MAC-512 variant by prepending a KEY UBI phase to the standard CFG → MSG → OUT pipeline. The key length is not fixed: any byte sequence from zero up to MaxKeySize / 8 bytes is valid.

Parameters at a glance.

  • State / block size: 512 bits (64 bytes).
  • Output sizes: 128, 160, 224, 256, 384, or 512 bits - default 512.
  • Underlying cipher: Threefish512Cipher tweakable block cipher under UBI mode.
  • Optional variable-length key: 0-MaxKeySize / 8 bytes.

When to choose Skein-512. The general-purpose Skein default, recommended by the Skein 1.3 specification - pick this when reproducing or interoperating with Skein-based digests. For new code without an interop requirement Blake2b is faster on contemporary 64-bit hardware and SHA-2 / SHA-3 are more widely deployed. Use Skein256 for narrower state, Skein1024 for the widest.

Constructors

Skein512()

Initializes a new instance of the Skein512 class that produces a 512-bit digest.

public Skein512()

Skein512(int)

Initializes a new instance of the Skein512 class with the specified output size.

public Skein512(int hashSize)

Parameters

hashSize int

The requested output size, in bits. Must be one of 128, 160, 224, 256, 384, or 512.

Exceptions

ArgumentOutOfRangeException

hashSize is not one of the permitted output sizes for Skein-512.

Applies to

ProductVersions
.NET8, 10

See Also