File tree Expand file tree Collapse file tree 2 files changed +0
-23
lines changed
src/toolbox/sigma/sage_test Expand file tree Collapse file tree 2 files changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ use bls12_381::G1Projective;
55use subtle:: CtOption ;
66use num_bigint:: BigUint ;
77use hex:: FromHex ;
8- use num_traits:: One ;
9- use crate :: rand:: RngCore ;
108
119impl SInput for G1Projective {
1210 fn scalar_from_hex_be (
@@ -32,22 +30,6 @@ impl SInput for G1Projective {
3230}
3331
3432impl SRandom < TestDRNG > for G1Projective {
35- fn randint_big ( rng : & mut TestDRNG , l : & BigUint , h : & BigUint ) -> BigUint {
36- assert ! ( l <= h) ;
37- let range = h - l + BigUint :: one ( ) ;
38- let bits = range. bits ( ) ;
39- let bytes_needed = ( ( bits + 7 ) / 8 ) as usize ;
40-
41- loop {
42- let mut buf = vec ! [ 0u8 ; bytes_needed] ;
43- rng. fill_bytes ( & mut buf) ;
44- let val = BigUint :: from_bytes_be ( & buf) ;
45- if val. bits ( ) <= bits {
46- return l + ( val % & range) ;
47- }
48- }
49- }
50-
5133 fn srandom (
5234 rng : & mut TestDRNG
5335 ) -> Self :: Scalar {
Original file line number Diff line number Diff line change 11use group:: { Group , GroupEncoding } ;
22use rand:: { Rng , CryptoRng } ;
3- use num_bigint:: BigUint ;
43
54pub trait SInput : Group + GroupEncoding {
65 fn scalar_from_hex_be (
@@ -9,10 +8,6 @@ pub trait SInput: Group + GroupEncoding {
98}
109
1110pub trait SRandom < DRNG : Rng + CryptoRng > : Group {
12- fn randint_big (
13- rng : & mut DRNG , l : & BigUint , h : & BigUint
14- ) -> BigUint ;
15-
1611 fn srandom (
1712 rng : & mut DRNG
1813 ) -> Self :: Scalar ;
You can’t perform that action at this time.
0 commit comments