Table of Contents

Class Sha3Digest

Namespace
Org.BouncyCastle.Crypto.Digests
Assembly
BouncyCastle.Cryptography.dll

Implementation of SHA-3 based on following KeccakNISTInterface.c from http://keccak.noekeon.org/

public class Sha3Digest : KeccakDigest, IDigest, IMemoable
Inheritance
Sha3Digest
Implements
Inherited Members

Remarks

Following the naming conventions used in the C source code to enable easy review of the implementation.

Constructors

Sha3Digest()

public Sha3Digest()

Sha3Digest(Sha3Digest)

public Sha3Digest(Sha3Digest source)

Parameters

source Sha3Digest

Sha3Digest(int)

public Sha3Digest(int bitLength)

Parameters

bitLength int

Properties

AlgorithmName

The algorithm name.

public override string AlgorithmName { get; }

Property Value

string

Methods

Copy()

Produce a copy of this object with its configuration and in its current state.

public override IMemoable Copy()

Returns

IMemoable

Remarks

The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.

DoFinal(byte[], int)

Close the digest, producing the final digest value.

public override int DoFinal(byte[] output, int outOff)

Parameters

output byte[]

The byte array the digest is to be copied into.

outOff int

The offset into the byte array the digest is to start at.

Returns

int

The number of bytes written.

Remarks

This call leaves the digest reset.

DoFinal(byte[], int, byte, int)

protected override int DoFinal(byte[] output, int outOff, byte partialByte, int partialBits)

Parameters

output byte[]
outOff int
partialByte byte
partialBits int

Returns

int

DoFinal(Span<byte>)

Close the digest, producing the final digest value.

public override int DoFinal(Span<byte> output)

Parameters

output Span<byte>

The span the digest is to be copied into.

Returns

int

The number of bytes written.

Remarks

This call leaves the digest reset.