From 4c776ac66d95f0847aa3b7b94af3de7299374ff1 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Tue, 27 Sep 2011 09:38:47 +0200 Subject: [PATCH] Simpify mask formula. --- src/numtheory/fp_prime_random_ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numtheory/fp_prime_random_ex.c b/src/numtheory/fp_prime_random_ex.c index e320f6c..4904d15 100644 --- a/src/numtheory/fp_prime_random_ex.c +++ b/src/numtheory/fp_prime_random_ex.c @@ -37,7 +37,7 @@ int fp_prime_random_ex(fp_int *a, int size, int flags, tfm_prime_callback cb, vo bsize = (size + 7) >> 3; /* calc the maskAND value for the MSbyte */ - maskAND_msb = FP_MASK >> ((DIGIT_BIT - (size & (DIGIT_BIT-1))) & (DIGIT_BIT-1)); + maskAND_msb = FP_MASK >> ((DIGIT_BIT - size) & (DIGIT_BIT-1)); /* get the maskOR_lsb */ maskOR_lsb = 1;