Bewerken

Share via


Kmac256.HashData Method

Definition

Overloads

HashData(Byte[], Byte[], Int32, Byte[])

Computes the hash of data using the KMAC256 algorithm.

HashData(Byte[], Stream, Int32, Byte[])

Computes the hash of a stream using the KMAC256 algorithm.

HashData(ReadOnlySpan<Byte>, Stream, Int32, ReadOnlySpan<Byte>)

Computes the hash of a stream using the KMAC256 algorithm.

HashData(ReadOnlySpan<Byte>, Stream, Span<Byte>, ReadOnlySpan<Byte>)

Computes the hash of a stream using the KMAC256 algorithm.

HashData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32, ReadOnlySpan<Byte>)

Computes the hash of data using the KMAC256 algorithm.

HashData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)

Computes the hash of data using the KMAC256 algorithm.

HashData(Byte[], Byte[], Int32, Byte[])

Source:
Kmac256.cs

Computes the hash of data using the KMAC256 algorithm.

public static byte[] HashData (byte[] key, byte[] source, int outputLength, byte[]? customizationString = default);
static member HashData : byte[] * byte[] * int * byte[] -> byte[]
Public Shared Function HashData (key As Byte(), source As Byte(), outputLength As Integer, Optional customizationString As Byte() = Nothing) As Byte()

Parameters

key
Byte[]

The KMAC key.

source
Byte[]

The data to hash.

outputLength
Int32

The size of the hash to produce.

customizationString
Byte[]

An optional customization string. The default is no customization string.

Returns

Byte[]

The hash of the data.

Exceptions

outputLength is negative.

key or source is null.

An error has occurred during the operation.

The platform does not support KMAC256. Callers can use the IsSupported property to determine if the platform supports KMAC256.

Applies to

HashData(Byte[], Stream, Int32, Byte[])

Source:
Kmac256.cs

Computes the hash of a stream using the KMAC256 algorithm.

public static byte[] HashData (byte[] key, System.IO.Stream source, int outputLength, byte[]? customizationString = default);
static member HashData : byte[] * System.IO.Stream * int * byte[] -> byte[]
Public Shared Function HashData (key As Byte(), source As Stream, outputLength As Integer, Optional customizationString As Byte() = Nothing) As Byte()

Parameters

key
Byte[]

The KMAC key.

source
Stream

The stream to hash.

outputLength
Int32

The size of the hash to produce.

customizationString
Byte[]

An optional customization string. The default is no customization string.

Returns

Byte[]

The hash of the data.

Exceptions

source does not support reading.

outputLength is negative.

key or source is null.

An error has occurred during the operation.

The platform does not support KMAC256. Callers can use the IsSupported property to determine if the platform supports KMAC256.

Applies to

HashData(ReadOnlySpan<Byte>, Stream, Int32, ReadOnlySpan<Byte>)

Source:
Kmac256.cs

Computes the hash of a stream using the KMAC256 algorithm.

public static byte[] HashData (ReadOnlySpan<byte> key, System.IO.Stream source, int outputLength, ReadOnlySpan<byte> customizationString = default);
static member HashData : ReadOnlySpan<byte> * System.IO.Stream * int * ReadOnlySpan<byte> -> byte[]
Public Shared Function HashData (key As ReadOnlySpan(Of Byte), source As Stream, outputLength As Integer, Optional customizationString As ReadOnlySpan(Of Byte) = Nothing) As Byte()

Parameters

key
ReadOnlySpan<Byte>

The KMAC key.

source
Stream

The stream to hash.

outputLength
Int32

The size of the hash to produce.

customizationString
ReadOnlySpan<Byte>

An optional customization string. The default is no customization string.

Returns

Byte[]

The hash of the data.

Exceptions

source does not support reading.

outputLength is negative.

source is null.

An error has occurred during the operation.

The platform does not support KMAC256. Callers can use the IsSupported property to determine if the platform supports KMAC256.

Applies to

HashData(ReadOnlySpan<Byte>, Stream, Span<Byte>, ReadOnlySpan<Byte>)

Source:
Kmac256.cs

Computes the hash of a stream using the KMAC256 algorithm.

public static void HashData (ReadOnlySpan<byte> key, System.IO.Stream source, Span<byte> destination, ReadOnlySpan<byte> customizationString = default);
static member HashData : ReadOnlySpan<byte> * System.IO.Stream * Span<byte> * ReadOnlySpan<byte> -> unit
Public Shared Sub HashData (key As ReadOnlySpan(Of Byte), source As Stream, destination As Span(Of Byte), Optional customizationString As ReadOnlySpan(Of Byte) = Nothing)

Parameters

key
ReadOnlySpan<Byte>

The KMAC key.

source
Stream

The stream to hash.

destination
Span<Byte>

The buffer to fill with the hash.

customizationString
ReadOnlySpan<Byte>

An optional customization string. The default is no customization string.

Exceptions

source does not support reading.

source is null.

An error has occurred during the operation.

The platform does not support KMAC256. Callers can use the IsSupported property to determine if the platform supports KMAC256.

Applies to

HashData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32, ReadOnlySpan<Byte>)

Source:
Kmac256.cs

Computes the hash of data using the KMAC256 algorithm.

public static byte[] HashData (ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, int outputLength, ReadOnlySpan<byte> customizationString = default);
static member HashData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * int * ReadOnlySpan<byte> -> byte[]
Public Shared Function HashData (key As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte), outputLength As Integer, Optional customizationString As ReadOnlySpan(Of Byte) = Nothing) As Byte()

Parameters

key
ReadOnlySpan<Byte>

The KMAC key.

source
ReadOnlySpan<Byte>

The data to hash.

outputLength
Int32

The size of the hash to produce.

customizationString
ReadOnlySpan<Byte>

An optional customization string. The default is no customization string.

Returns

Byte[]

The hash of the data.

Exceptions

outputLength is negative.

An error has occurred during the operation.

The platform does not support KMAC256. Callers can use the IsSupported property to determine if the platform supports KMAC256.

Applies to

HashData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)

Source:
Kmac256.cs

Computes the hash of data using the KMAC256 algorithm.

public static void HashData (ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, ReadOnlySpan<byte> customizationString = default);
static member HashData : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> unit
Public Shared Sub HashData (key As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), Optional customizationString As ReadOnlySpan(Of Byte) = Nothing)

Parameters

key
ReadOnlySpan<Byte>

The KMAC key.

source
ReadOnlySpan<Byte>

The data to hash.

destination
Span<Byte>

The buffer to fill with the hash.

customizationString
ReadOnlySpan<Byte>

An optional customization string. The default is no customization string.

Exceptions

An error has occurred during the operation.

The platform does not support KMAC256. Callers can use the IsSupported property to determine if the platform supports KMAC256.

Applies to