mp_rand: remove superflous mp_clamp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
diff --git a/bn_mp_rand.c b/bn_mp_rand.c
index 9e85895..bdcc0cf 100644
--- a/bn_mp_rand.c
+++ b/bn_mp_rand.c
@@ -206,7 +206,6 @@ int mp_rand(mp_int *a, int digits)
a->dp[i] &= MP_MASK;
}
- mp_clamp(a);
return MP_OKAY;
}
#endif
diff --git a/callgraph.txt b/callgraph.txt
index 47e77db..000409a 100644
--- a/callgraph.txt
+++ b/callgraph.txt
@@ -7378,7 +7378,6 @@ BN_MP_PRIME_IS_PRIME_C
+--->BN_MP_RAND_C
| +--->BN_MP_ZERO_C
| +--->BN_MP_GROW_C
-| +--->BN_MP_CLAMP_C
+--->BN_MP_DIV_2D_C
| +--->BN_MP_COPY_C
| | +--->BN_MP_GROW_C
@@ -9967,7 +9966,6 @@ BN_MP_PRIME_NEXT_PRIME_C
| +--->BN_MP_RAND_C
| | +--->BN_MP_ZERO_C
| | +--->BN_MP_GROW_C
-| | +--->BN_MP_CLAMP_C
| +--->BN_MP_DIV_2D_C
| | +--->BN_MP_COPY_C
| | | +--->BN_MP_GROW_C
@@ -11764,7 +11762,6 @@ BN_MP_PRIME_RANDOM_EX_C
| +--->BN_MP_RAND_C
| | +--->BN_MP_ZERO_C
| | +--->BN_MP_GROW_C
-| | +--->BN_MP_CLAMP_C
| +--->BN_MP_DIV_2D_C
| | +--->BN_MP_COPY_C
| | | +--->BN_MP_GROW_C
@@ -12160,7 +12157,6 @@ BN_MP_RADIX_SMAP_C
BN_MP_RAND_C
+--->BN_MP_ZERO_C
+--->BN_MP_GROW_C
-+--->BN_MP_CLAMP_C
BN_MP_READ_RADIX_C
diff --git a/tommath_class.h b/tommath_class.h
index 85cb105..e96ff6f 100644
--- a/tommath_class.h
+++ b/tommath_class.h
@@ -764,7 +764,6 @@
# define BN_MP_RAND_DIGIT_C
# define BN_MP_ZERO_C
# define BN_MP_GROW_C
-# define BN_MP_CLAMP_C
#endif
#if defined(BN_MP_READ_RADIX_C)