Class Keccak384
- Namespace
- CryptoHives.Foundation.Security.Cryptography.Hash
- Assembly
- CryptoHives.Foundation.Security.Cryptography.dll
Computes the Keccak-384 hash for the input data.
public sealed class Keccak384 : KeccakHashCore, ICryptoTransform, IDisposable, IResettable
- Inheritance
-
Keccak384
- Implements
- Inherited Members
Remarks
This is the original Keccak-384 algorithm, which differs from SHA3-384 in the domain separator byte (0x01 vs 0x06).
Keccak-384 produces a 384-bit (48-byte) hash value.
Constructors
Keccak384()
Initializes a new instance of the Keccak384 class.
public Keccak384()
Fields
HashSizeBits
The hash size in bits.
public const int HashSizeBits = 384
Field Value
HashSizeBytes
The hash size in bytes.
public const int HashSizeBytes = 48
Field Value
RateBytes
The rate in bytes (832 bits for Keccak-384).
public const int RateBytes = 104
Field Value
Properties
AlgorithmName
Gets the name of the hash algorithm.
public override string AlgorithmName { get; }
Property Value
BlockSize
Gets the block size in bytes used by the hash algorithm.
public override int BlockSize { get; }
Property Value
Methods
Create()
Creates a new instance of the Keccak384 class.
public static Keccak384 Create()
Returns
- Keccak384
A new Keccak-384 hash algorithm instance.
HashData(in ReadOnlySequence<byte>)
Computes the Keccak-384 hash of source and returns it as a new byte array.
public static byte[] HashData(in ReadOnlySequence<byte> source)
Parameters
sourceReadOnlySequence<byte>The (possibly multi-segment) input sequence to hash.
Returns
- byte[]
A new byte array containing the Keccak-384 hash.
HashData(ReadOnlySpan<byte>)
Computes the Keccak-384 hash of source and returns it as a new byte array.
public static byte[] HashData(ReadOnlySpan<byte> source)
Parameters
sourceReadOnlySpan<byte>The input data to hash.
Returns
- byte[]
A new byte array containing the Keccak-384 hash.
TryHashData(in ReadOnlySequence<byte>, Span<byte>, out int)
Computes the Keccak-384 hash of source and writes it into destination.
public static bool TryHashData(in ReadOnlySequence<byte> source, Span<byte> destination, out int bytesWritten)
Parameters
sourceReadOnlySequence<byte>The (possibly multi-segment) input sequence to hash.
destinationSpan<byte>The buffer to receive the hash value. Must be at least HashSizeBytes bytes.
bytesWrittenintWhen this method returns, the number of bytes written into
destination.
Returns
TryHashData(ReadOnlySpan<byte>, Span<byte>, out int)
Computes the Keccak-384 hash of source and writes it into destination.
public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
Parameters
sourceReadOnlySpan<byte>The input data to hash.
destinationSpan<byte>The buffer to receive the hash value. Must be at least HashSizeBytes bytes.
bytesWrittenintWhen this method returns, the number of bytes written into
destination.