Remove unnecessary window size cases.

The optimization for wsize = 1 only kicks in for 19-bit primes. The
cases for b >= 800 and cannot happen due to EC_MAX_SCALAR_BYTES.

Change-Id: If5ca908563f027172cdf31c9a22342152fecd12f
Reviewed-on: https://boringssl-review.googlesource.com/25145
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2018-01-20 09:15:11 -05:00 committed by Adam Langley
parent 4111dd2fc2
commit 5d9408714c

View File

@ -208,14 +208,6 @@ err:
// sometimes smaller windows will give better performance
// (thus the boundaries should be increased)
static size_t window_bits_for_scalar_size(size_t b) {
if (b >= 2000) {
return 6;
}
if (b >= 800) {
return 5;
}
if (b >= 300) {
return 4;
}
@ -369,7 +361,6 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r,
goto err;
}
if (wsize > 1) {
if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx)) {
goto err;
}
@ -379,7 +370,6 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r,
}
}
}
}
#if 1 // optional; window_bits_for_scalar_size assumes we do this step
if (!EC_POINTs_make_affine(group, num_val, val, ctx)) {