diff options
Diffstat (limited to 'crypto/bn/check_bn_tests.go')
-rw-r--r-- | crypto/bn/check_bn_tests.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/bn/check_bn_tests.go b/crypto/bn/check_bn_tests.go index 9a1b65e7..0d2042e1 100644 --- a/crypto/bn/check_bn_tests.go +++ b/crypto/bn/check_bn_tests.go @@ -247,6 +247,11 @@ func main() { } } } + case "ModInv": + if checkKeys(test, "A", "M", "ModInv") { + r := new(big.Int).ModInverse(test.Values["A"], test.Values["M"]) + checkResult(test, "A ^ -1 (mod M)", "ModInv", r) + } default: fmt.Fprintf(os.Stderr, "Line %d: unknown test type %q.\n", test.LineNumber, test.Type) } |