@@ -217,6 +217,7 @@ impl BigNumRef {
217217 }
218218
219219 /// The cryptographically weak counterpart to `rand_in_range`.
220+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
220221 #[ corresponds( BN_pseudo_rand_range ) ]
221222 pub fn pseudo_rand_range ( & self , rnd : & mut BigNumRef ) -> Result < ( ) , ErrorStack > {
222223 unsafe { cvt ( ffi:: BN_pseudo_rand_range ( rnd. as_ptr ( ) , self . as_ptr ( ) ) ) . map ( |_| ( ) ) }
@@ -385,6 +386,7 @@ impl BigNumRef {
385386 }
386387
387388 /// The cryptographically weak counterpart to `rand`. Not suitable for key generation.
389+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
388390 #[ corresponds( BN_pseudo_rand ) ]
389391 #[ allow( clippy:: useless_conversion) ]
390392 pub fn pseudo_rand ( & mut self , bits : i32 , msb : MsbOption , odd : bool ) -> Result < ( ) , ErrorStack > {
@@ -722,6 +724,7 @@ impl BigNumRef {
722724 /// # Return Value
723725 ///
724726 /// Returns `true` if `self` is prime with an error probability of less than `0.25 ^ checks`.
727+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
725728 #[ corresponds( BN_is_prime_ex ) ]
726729 #[ allow( clippy:: useless_conversion) ]
727730 pub fn is_prime ( & self , checks : i32 , ctx : & mut BigNumContextRef ) -> Result < bool , ErrorStack > {
@@ -745,6 +748,7 @@ impl BigNumRef {
745748 /// # Return Value
746749 ///
747750 /// Returns `true` if `self` is prime with an error probability of less than `0.25 ^ checks`.
751+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
748752 #[ corresponds( BN_is_prime_fasttest_ex ) ]
749753 #[ allow( clippy:: useless_conversion) ]
750754 pub fn is_prime_fasttest (
@@ -1388,6 +1392,7 @@ mod tests {
13881392 assert_eq ! ( a, & ( & a << 1 ) >> 1 ) ;
13891393 }
13901394
1395+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
13911396 #[ test]
13921397 fn test_rand_range ( ) {
13931398 let range = BigNum :: from_u32 ( 909_829_283 ) . unwrap ( ) ;
@@ -1396,6 +1401,7 @@ mod tests {
13961401 assert ! ( result >= BigNum :: from_u32( 0 ) . unwrap( ) && result < range) ;
13971402 }
13981403
1404+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
13991405 #[ test]
14001406 fn test_pseudo_rand_range ( ) {
14011407 let range = BigNum :: from_u32 ( 909_829_283 ) . unwrap ( ) ;
@@ -1404,6 +1410,7 @@ mod tests {
14041410 assert ! ( result >= BigNum :: from_u32( 0 ) . unwrap( ) && result < range) ;
14051411 }
14061412
1413+ #[ cfg( not( osslconf = "OPENSSL_NO_DEPRECATED_3_0" ) ) ]
14071414 #[ test]
14081415 fn test_prime_numbers ( ) {
14091416 let a = BigNum :: from_u32 ( 19_029_017 ) . unwrap ( ) ;
0 commit comments