myl7/fss 1.1.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
Loading...
Searching...
No Matches
fss::group::Uint< T, mod > Struct Template Reference

Unsigned integers with arithmetic addition and optional modulo as a group. More...

Public Member Functions

Uint operator+ (Uint rhs) const
 
Uint operator- () const
 
int4 Into () const
 

Static Public Member Functions

static Uint From (int4 buf)
 

Public Attributes

val
 

Detailed Description

template<typename T, T mod = 0>
requires ((std::is_unsigned_v<T> || std::is_same_v<T, __uint128_t>) && sizeof(T) <= 16 && (sizeof(T) < 16 || (mod > 0 && mod <= static_cast<T>(1) << 127)))
struct fss::group::Uint< T, mod >

Unsigned integers with arithmetic addition and optional modulo as a group.

Template Parameters
TType to store the value. From uint8_t to __uint128_t.
modModulus, making the group addition defined as \(a + b \mod mod\). If 0, use \(a + b\) as the group addition, i.e., same as \(mod = 2^{sizeof(T) * 8}\).

When T = __uint128_t, because elements are clamped, any element has < 2^127 and 0 < mod <= 2^127.

Note that if you will use these groups as fields, i.e., perform multiplication, you must set mod to a prime number so that for random \(a, b\), \(a \cdot b\) is uniformly distributed in the field.


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