Neg sets the target to -a mod M.
(a kyber.Scalar)
| 224 | |
| 225 | // Neg sets the target to -a mod M. |
| 226 | func (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. |
no test coverage detected