bn/bn_{div|shift}.c: introduce fixed-top interfaces.
authorAndy Polyakov <appro@openssl.org>
Fri, 23 Nov 2018 16:23:31 +0000 (17:23 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 5 Dec 2018 10:33:57 +0000 (10:33 +0000)
commit3a4a88f436ed1dd1165e0b59c1ca4a25e9e1d690
tree2a457f25f6824e8417472ba2f0074035a0e75a29
parent3da2e9c4ee45989a426ff513dc6c6250d1e460de
bn/bn_{div|shift}.c: introduce fixed-top interfaces.

Fixed-top interfaces tolerate zero-padded inputs and facilitate
constant-time-ness. bn_div_fixed_top tolerates zero-padded dividend,
but not divisor. It's argued that divisor's length is public even
when value is secret.

[extended tests]

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7589)
crypto/bn/bn_div.c
crypto/bn/bn_shift.c
crypto/include/internal/bn_int.h