interop: add interop API for MODMUL, MODPOW opcodes
This commit is contained in:
parent
e66e82278c
commit
e31f4ca331
2 changed files with 51 additions and 0 deletions
|
@ -44,3 +44,14 @@ func Min(a, b int) int {
|
|||
func Within(x, a, b int) bool {
|
||||
return neogointernal.Opcode3("WITHIN", x, a, b).(bool)
|
||||
}
|
||||
|
||||
// ModMul returns the result of modulus division on a*b.
|
||||
func ModMul(a, b, mod int) int {
|
||||
return neogointernal.Opcode3("MODMUL", a, b, mod).(int)
|
||||
}
|
||||
|
||||
// ModPow returns the result of modulus division on a^b. If b is -1,
|
||||
// it returns the modular inverse of a.
|
||||
func ModPow(a, b, mod int) int {
|
||||
return neogointernal.Opcode3("MODPOW", a, b, mod).(int)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue