File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ def test_to_bn
50
50
51
51
bn = OpenSSL ::BN . new ( '1234567890123456789012345678901234567890' )
52
52
assert_equal bn , 1234567890123456789012345678901234567890 . to_bn
53
+
54
+ e1 = OpenSSL ::BN . new ( 999 . to_s ( 16 ) , 16 )
55
+ e2 = OpenSSL ::BN . new ( ( 2 **107 -1 ) . to_s ( 16 ) , 16 )
56
+ assert_equal ( e1 , 999 . to_bn )
57
+ assert_equal ( e2 , ( 2 **107 -1 ) . to_bn )
53
58
end
54
59
55
60
def test_comparison
@@ -103,13 +108,6 @@ def test_new_integer
103
108
assert_equal ( ( -( 2 ** 107 - 1 ) ) . to_bn , OpenSSL ::BN . new ( -( 2 ** 107 - 1 ) ) )
104
109
end
105
110
106
- def test_to_bn
107
- e1 = OpenSSL ::BN . new ( 999 . to_s ( 16 ) , 16 )
108
- e2 = OpenSSL ::BN . new ( ( 2 **107 -1 ) . to_s ( 16 ) , 16 )
109
- assert_equal ( e1 , 999 . to_bn )
110
- assert_equal ( e2 , ( 2 **107 -1 ) . to_bn )
111
- end
112
-
113
111
def test_prime_p
114
112
assert_equal ( true , OpenSSL ::BN . new ( ( 2 ** 107 - 1 ) . to_s ( 16 ) , 16 ) . prime? )
115
113
assert_equal ( true , OpenSSL ::BN . new ( ( 2 ** 127 - 1 ) . to_s ( 16 ) , 16 ) . prime? ( 1 ) )
You can’t perform that action at this time.
0 commit comments