summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorBen Toews <benjamin.toews@gmail.com>2022-10-17 07:31:40 -0600
committerKazuki Yamaguchi <k@rhe.jp>2022-10-17 23:38:34 +0900
commit149cb049f1d7f5fd2edf5ab467c33037ec993a47 (patch)
tree9e06e7bdaf19eee07d500f1e0c881166b49705cb /ext/openssl
parente037731c9f840b0c74eb68a808a109fdef3c6d5e (diff)
downloadruby-149cb049f1d7f5fd2edf5ab467c33037ec993a47.tar.gz
[ruby/openssl] add BN#mod_sqrt
https://github.com/ruby/openssl/commit/4619ab3e76
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/ossl_bn.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c
index 7eb1bc79a5..06647b5b62 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -592,6 +592,13 @@ BIGNUM_2c(mod_sqr)
}
/*
+ * Document-method: OpenSSL::BN#mod_sqrt
+ * call-seq:
+ * bn.mod_sqrt(bn2) => aBN
+ */
+BIGNUM_2cr(mod_sqrt)
+
+/*
* call-seq:
* bn.mod_inverse(bn2) => aBN
*/
@@ -1237,6 +1244,7 @@ Init_ossl_bn(void)
rb_define_method(cBN, "mod_sub", ossl_bn_mod_sub, 2);
rb_define_method(cBN, "mod_mul", ossl_bn_mod_mul, 2);
rb_define_method(cBN, "mod_sqr", ossl_bn_mod_sqr, 1);
+ rb_define_method(cBN, "mod_sqrt", ossl_bn_mod_sqrt, 1);
rb_define_method(cBN, "**", ossl_bn_exp, 1);
rb_define_method(cBN, "mod_exp", ossl_bn_mod_exp, 2);
rb_define_method(cBN, "gcd", ossl_bn_gcd, 1);