Initial project import
This commit is contained in:
commit
23f2d29e32
11957 files changed
+1754577
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import math.big
|
||||
import crypto.rand
|
||||
|
||||
fn test_int_big() {
|
||||
z := big.integer_from_int(0)
|
||||
if _ := rand.int_big(z) {
|
||||
assert false
|
||||
} else {
|
||||
assert true
|
||||
}
|
||||
|
||||
n := big.integer_from_int(-1)
|
||||
if _ := rand.int_big(n) {
|
||||
assert false
|
||||
} else {
|
||||
assert true
|
||||
}
|
||||
|
||||
m := big.integer_from_int(1).left_shift(128)
|
||||
l := rand.int_big(m)! // actual large number
|
||||
assert l < m
|
||||
assert l > n
|
||||
}
|
||||
Reference in new issue
Block a user