myl7/fss 1.1.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
Loading...
Searching...
No Matches
fss::hash::Blake3 Class Reference

BLAKE3 keyed hash (CPU+GPU). More...

Public Member Functions

 Blake3 (cuda::std::span< const int4, 2 > iv)
 Constructor.
 
cuda::std::array< int4, 2 > Hash (cuda::std::span< const int4, 4 > msg)
 Hash a 64B message.
 
cuda::std::array< int4, 4 > Hash (cuda::std::tuple< int4, const int4 > msg)
 XOR-collision-resistant hash.
 

Detailed Description

BLAKE3 keyed hash (CPU+GPU).

The IV replaces BLAKE3's standard IV in keyed-hash mode. The KEYED_HASH flag is set on all compression calls.

Constructor & Destructor Documentation

◆ Blake3()

fss::hash::Blake3::Blake3 ( cuda::std::span< const int4, 2 >  iv)
inlineexplicit

Constructor.

Parameters
ivCustom IV (2 int4s = 32B) replacing BLAKE3's standard IV in keyed-hash mode. Stored by value.

Member Function Documentation

◆ Hash() [1/2]

cuda::std::array< int4, 2 > fss::hash::Blake3::Hash ( cuda::std::span< const int4, 4 >  msg)
inline

Hash a 64B message.

Single BLAKE3 compression: h=iv_, m=msg, counter=0, block_len=64. flags = CHUNK_START | CHUNK_END | ROOT | KEYED_HASH (0x1B).

Parameters
msg4 int4 blocks (64B).
Returns
2 int4 blocks (32B), the first 32B of the compression output.

◆ Hash() [2/2]

cuda::std::array< int4, 4 > fss::hash::Blake3::Hash ( cuda::std::tuple< int4, const int4 >  msg)
inline

XOR-collision-resistant hash.

Produces two 32B digests (one with LSB cleared, one with LSB set) and concatenates them into 64B.

Parameters
msgTuple of (a, b) where a's LSB is used for domain separation.
Returns
4 int4 blocks (64B).

The documentation for this class was generated from the following file: