oa::FnHash

FnHash namespace in the OA Crypto public surface.

NsC++ public headers

Public Functions

Matrix oa::FnHash::keccakF1600(const Matrix & inA)
Matrix oa::FnHash::merkleRoot(const Matrix & inA)
Matrix oa::FnHash::shake128(const Matrix & inA, oa::U32 inOutputLength = 16)
Matrix oa::FnHash::shake256(const Matrix & inA, oa::U32 inOutputLength = 32)

Function Documentation

Matrix oa::FnHash::keccakF1600( const Matrix & inA )
Batch Keccak-f[1600] permutation. input/output [N, 200] bytes (25 lanes × u64 per state). out-of-place.

Parameters

inA
const Matrix &

Returns

Matrix

The declared return value.

Matrix oa::FnHash::merkleRoot( const Matrix & inA )
Merkle root by GPU SHAKE-256 pair reduction. input [N, 32] leaf hashes, N a power of two; output [1, 32] root. Bit-identical to oa::merkleRoot for power-of-two leaf counts. Use oa::merkleRoot (CPU) for arbitrary counts, and oa::verifyMerkleProof (CPU) for inclusion proofs.

Parameters

inA
const Matrix &

Returns

Matrix

The declared return value.

Matrix oa::FnHash::shake128( const Matrix & inA, oa::U32 inOutputLength = 16 )
SHAKE-128 batch XOF. input [N, msgLen] bytes; output [N, ceil(outLen/8)*8] bytes (16-byte default). Row i = SHAKE128(message i).

Parameters

inA
const Matrix &

inOutputLength
oa::U32

Default: 16

Returns

Matrix

The declared return value.

Matrix oa::FnHash::shake256( const Matrix & inA, oa::U32 inOutputLength = 32 )
SHAKE-256 batch XOF. input [N, msgLen] bytes; output [N, ceil(outLen/8)*8] bytes (32-byte default). Row i = SHAKE256(message i).

Parameters

inA
const Matrix &

inOutputLength
oa::U32

Default: 32

Returns

Matrix

The declared return value.