add comments
This commit is contained in:
@@ -46,6 +46,9 @@ func solveCRT(a1, n1, a2, n2 *big.Int) (*big.Int, *big.Int) {
|
||||
return x, N
|
||||
}
|
||||
|
||||
/*
|
||||
Given a system of congruences - defined by slices of remainders and moduli such that x = remainders[i] (mod moduli[i]) for each index i - CRTSolution outputs a solution to the system.
|
||||
*/
|
||||
func CRTSolution(remainders, moduli []*big.Int) (*big.Int, *big.Int) {
|
||||
n1 := new(big.Int)
|
||||
a1 := new(big.Int)
|
||||
@@ -63,6 +66,9 @@ func CRTSolution(remainders, moduli []*big.Int) (*big.Int, *big.Int) {
|
||||
return a1, n1
|
||||
}
|
||||
|
||||
/*
|
||||
ArePairwiseCoprime returns true if each pair of values in the input slice are coprime.
|
||||
*/
|
||||
func ArePairwiseCoprime(moduli []*big.Int) bool {
|
||||
z := new(big.Int)
|
||||
for i, a := range moduli {
|
||||
|
||||
Reference in New Issue
Block a user