MCPcopy Create free account
hub / github.com/DOSNetwork/core / Jacobi

Method Jacobi

group/mod/int.go:280–285  ·  view source on GitHub ↗

Jacobi computes the Jacobi symbol of (a/M), which indicates whether a is zero (0), a positive square in M (1), or a non-square in M (-1).

(as kyber.Scalar)

Source from the content-addressed store, hash-verified

278// Jacobi computes the Jacobi symbol of (a/M), which indicates whether a is
279// zero (0), a positive square in M (1), or a non-square in M (-1).
280func (i *Int) Jacobi(as kyber.Scalar) kyber.Scalar {
281 ai := as.(*Int)
282 i.M = ai.M
283 i.V.SetInt64(int64(big.Jacobi(&ai.V, i.M)))
284 return i
285}
286
287// Sqrt computes some square root of a mod M of one exists.
288// Assumes the modulus M is an odd prime.

Callers

nothing calls this directly

Calls 1

SetInt64Method · 0.45

Tested by

no test coverage detected