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

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

Public Member Functions

Uint operator+ (Uint rhs) const
 Return the group sum.
Uint operator- () const
 Return the additive inverse.
 Uint ()
 Construct the additive identity.
int4 Into () const
 Encode this group element as a clamped block.
T Value () const
 Return a copy of the underlying unsigned integer value.

Static Public Member Functions

static Uint From (int4 buf)
 Convert a clamped block to a group element, reducing modulo mod when set.

Detailed Description

template<typename T, T mod = 0>
requires (std::is_unsigned_v<T> && sizeof(T) <= 8)
class 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 uint64_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}\).

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 class was generated from the following file: