package
Version:
v0.0.0-...-cbd876d
Opens a new window with list of versions in this module.
Published: Dec 3, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
ring
Brief description
The package ring
offers a basic implementation of modular arithmetic ring as well as a few operations on it.
Overview
- Create a new ring modulo 10 with
r = NewRing(big.NewInt(10))
- Add two aribraty-precision numbers in the ring
r
with a = r.Add(big.NewInt(7), big.NewInt(8))
where a
should be equal to 5
Available operations
- Reduction
- Addition
- Subtraction
- Multiplication
- Negation
Documentation
¶
Package ring implement an integer ring with basic operations on big.Int in this ring
type Ring struct {
Q *big.Int
}
Ring represents a ring of integers with modulo Q
NewRing returns a ring with given modulo Q
Add adds a and b in ring r
Mult mulitplies a to b in ring r
Red reduces a big.Int a modulo r.Q
Sub subs b to a in ring r
Source Files
¶
Click to show internal directories.
Click to hide internal directories.