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

Method Div

group/mod/int.go:248–256  ·  view source on GitHub ↗

Div sets the target to a * b^-1 mod M, where b^-1 is the modular inverse of b.

(a, b kyber.Scalar)

Source from the content-addressed store, hash-verified

246
247// Div sets the target to a * b^-1 mod M, where b^-1 is the modular inverse of b.
248func (i *Int) Div(a, b kyber.Scalar) kyber.Scalar {
249 ai := a.(*Int)
250 bi := b.(*Int)
251 var t big.Int
252 i.M = ai.M
253 i.V.Mul(&ai.V, t.ModInverse(&bi.V, i.M))
254 i.V.Mod(&i.V, i.M)
255 return i
256}
257
258// Inv sets the target to the modular inverse of a with respect to modulus M.
259func (i *Int) Inv(a kyber.Scalar) kyber.Scalar {

Callers 4

SetStringMethod · 0.95
TestScalarOpsFunction · 0.45
RecoverSecretFunction · 0.45
RecoverCommitFunction · 0.45

Calls 1

MulMethod · 0.45

Tested by 1

TestScalarOpsFunction · 0.36