diff options
| author | Ben Toews <benjamin.toews@gmail.com> | 2022-10-17 07:31:40 -0600 |
|---|---|---|
| committer | Kazuki Yamaguchi <k@rhe.jp> | 2022-10-17 23:38:34 +0900 |
| commit | 149cb049f1d7f5fd2edf5ab467c33037ec993a47 (patch) | |
| tree | 9e06e7bdaf19eee07d500f1e0c881166b49705cb /test/openssl/test_bn.rb | |
| parent | e037731c9f840b0c74eb68a808a109fdef3c6d5e (diff) | |
[ruby/openssl] add BN#mod_sqrt
https://github.com/ruby/openssl/commit/4619ab3e76
Diffstat (limited to 'test/openssl/test_bn.rb')
| -rw-r--r-- | test/openssl/test_bn.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/openssl/test_bn.rb b/test/openssl/test_bn.rb index 346602dada..77af14091e 100644 --- a/test/openssl/test_bn.rb +++ b/test/openssl/test_bn.rb @@ -174,6 +174,12 @@ class OpenSSL::TestBN < OpenSSL::TestCase assert_equal(0, 59.to_bn.mod_sqr(59)) end + def test_mod_sqrt + assert_equal(3, 4.to_bn.mod_sqrt(5)) + assert_equal(0, 5.to_bn.mod_sqrt(5)) + assert_raise(OpenSSL::BNError) { 3.to_bn.mod_sqrt(5) } + end + def test_mod_inverse assert_equal(2, 3.to_bn.mod_inverse(5)) assert_raise(OpenSSL::BNError) { 3.to_bn.mod_inverse(6) } |
