Documentation
¶
Overview ¶
Offers functions to work with Hyper-Complex numbers modulo P.
Index ¶
- type Modulus
- func (m Modulus) Add(a, b MultiComp) MultiComp
- func (m Modulus) Counterpart(a MultiComp) MultiComp
- func (m Modulus) Deterministic(source io.Reader, size int) (MultiComp, error)
- func (m Modulus) Exp(g MultiComp, exp []byte) MultiComp
- func (m Modulus) Inverse(a MultiComp) MultiComp
- func (m Modulus) Multiply(a, b MultiComp) MultiComp
- func (m Modulus) Neg(a MultiComp) MultiComp
- func (m Modulus) Sub(a, b MultiComp) MultiComp
- type MultiComp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modulus ¶
func (Modulus) Counterpart ¶
For a given 'a = (r,i)' it returns '(r,-i mod P)'.
func (Modulus) Deterministic ¶
Creates a MultiComp over the modulus group of the given length 'size'. The argument 'size' must be a power of two.
This function chooses them deterministically. This function is meant to be used with SHAKE-128, SHAKE-256 or similar XOF hash functions. However, the regular "crypto/rand" rand.Reader can be used as well.
type MultiComp ¶
Represents a Hyper-Complex number. The number is represented as an array of integers (*big.Int), where the length is a power of two. If a MultiComp contains only one element, it represents an ordinary Number. Otherwise, it consists of two equal-sized halves, where the first one represents the real part and the second one represents the imaginary part.