More optimisations for EC P-256 "i15" (specialised squaring function, mixed coordinates addition with a 4-bit window when the base point is the conventional generator).

This commit is contained in:
Thomas Pornin 2017-01-13 05:10:43 +01:00
parent 21743ae69e
commit 44c79c1add
14 changed files with 804 additions and 56 deletions

View file

@ -286,10 +286,7 @@ make_pms_ecdh(br_ssl_client_context *ctx, unsigned ecdhe, int prf_id)
*/
br_ssl_engine_compute_master(&ctx->eng, prf_id, point + 1, glen >> 1);
memcpy(point, generator, glen);
if (!ctx->eng.iec->mul(point, glen, key, olen, curve)) {
return -BR_ERR_INVALID_ALGORITHM;
}
ctx->eng.iec->mulgen(point, key, olen, curve);
memcpy(ctx->eng.pad, point, glen);
return (int)glen;
}