diff options
author | Kazuki Yamaguchi <[email protected]> | 2021-03-21 00:20:04 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <[email protected]> | 2021-10-25 00:40:48 +0900 |
commit | e19186707a78e6e739646dac1430dc3066cf9bad (patch) | |
tree | e9b4e57519ff65aea0a94f827762f8a4330724ae /ext/openssl/ossl_bn.c | |
parent | 1b5ccc8a0c27273d2f944f9914bcbdda3ad803f7 (diff) |
[ruby/openssl] bn: make BN.pseudo_rand{,_range} an alias of BN.rand{,_range}
BN_pseudo_rand() and BN_pseudo_rand_range() are deprecated in
OpenSSL 3.0. Since they are identical to their non-'pseudo' version
anyway, let's make them alias.
https://github.com/ruby/openssl/commit/2d34e85ddf
Diffstat (limited to 'ext/openssl/ossl_bn.c')
-rw-r--r-- | ext/openssl/ossl_bn.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c index 128ffabddc..5d17b13a36 100644 --- a/ext/openssl/ossl_bn.c +++ b/ext/openssl/ossl_bn.c @@ -826,12 +826,6 @@ BIGNUM_SELF_SHIFT(rshift) */ BIGNUM_RAND(rand) -/* - * Document-method: OpenSSL::BN.pseudo_rand - * BN.pseudo_rand(bits [, fill [, odd]]) -> aBN - */ -BIGNUM_RAND(pseudo_rand) - #define BIGNUM_RAND_RANGE(func) \ static VALUE \ ossl_bn_s_##func##_range(VALUE klass, VALUE range) \ @@ -858,14 +852,6 @@ BIGNUM_RAND(pseudo_rand) BIGNUM_RAND_RANGE(rand) /* - * Document-method: OpenSSL::BN.pseudo_rand_range - * call-seq: - * BN.pseudo_rand_range(range) -> aBN - * - */ -BIGNUM_RAND_RANGE(pseudo_rand) - -/* * call-seq: * BN.generate_prime(bits, [, safe [, add [, rem]]]) => bn * @@ -1278,9 +1264,9 @@ Init_ossl_bn(void) * get_word */ rb_define_singleton_method(cBN, "rand", ossl_bn_s_rand, -1); - rb_define_singleton_method(cBN, "pseudo_rand", ossl_bn_s_pseudo_rand, -1); rb_define_singleton_method(cBN, "rand_range", ossl_bn_s_rand_range, 1); - rb_define_singleton_method(cBN, "pseudo_rand_range", ossl_bn_s_pseudo_rand_range, 1); + rb_define_alias(rb_singleton_class(cBN), "pseudo_rand", "rand"); + rb_define_alias(rb_singleton_class(cBN), "pseudo_rand_range", "rand_range"); rb_define_singleton_method(cBN, "generate_prime", ossl_bn_s_generate_prime, -1); rb_define_method(cBN, "prime?", ossl_bn_is_prime, -1); |