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

Method Neg

group/mod/int.go:226–235  ·  view source on GitHub ↗

Neg sets the target to -a mod M.

(a kyber.Scalar)

Source from the content-addressed store, hash-verified

224
225// Neg sets the target to -a mod M.
226func (i *Int) Neg(a kyber.Scalar) kyber.Scalar {
227 ai := a.(*Int)
228 i.M = ai.M
229 if ai.V.Sign() > 0 {
230 i.V.Sub(i.M, &ai.V)
231 } else {
232 i.V.SetUint64(0)
233 }
234 return i
235}
236
237// Mul sets the target to a * b mod M.
238// Target receives a's modulus.

Callers 2

xMinusConstFunction · 0.45
VerifyFunction · 0.45

Calls 2

SetUint64Method · 0.80
SubMethod · 0.45

Tested by

no test coverage detected