Documentation
¶
Overview ¶
Copyright 2019 (c) NSPCC
Package gf127 implements the GF(2^127) arithmetic modulo reduction polynomial x^127 + x^63 + 1 . Implementation is in pure Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Inv ¶
func Inv(a, b *GF127)
Inv sets b to a^-1 Algorithm is based on Extended Euclidean Algorithm and is described by Hankerson, Hernandez, Menezes in https://link.springer.com/content/pdf/10.1007/3-540-44499-8_1.pdf
Types ¶
type GF127 ¶
type GF127 [2]uint64
GF127 represents element of GF(2^127)
func New ¶
New constructs new element of GF(2^127) as hi*x^64 + lo. It is assumed that hi has zero MSB.
func Random ¶
func Random() *GF127
Random returns random element from GF(2^127). Is used mostly for testing.
func (*GF127) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*GF127) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.