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

SHA-256 keyed hash. More...

Public Member Functions

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

Detailed Description

SHA-256 keyed hash.

Only for host side.

Constructor & Destructor Documentation

◆ Sha256()

fss::hash::Sha256::Sha256 ( int4  key)
inlineexplicit

Constructor.

Parameters
key16B key stored by value.

Member Function Documentation

◆ Hash() [1/2]

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

Hash a 64B message with the key.

Parameters
msg4 int4 blocks (64B).
Returns
2 int4 blocks (32B) SHA-256 digest.

◆ Hash() [2/2]

cuda::std::array< int4, 4 > fss::hash::Sha256::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: