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:38:22 +0000 (10:38 +0000)
commit8df98cd98812dff67aa93a3f760860ac91f7f24a
treedf8ea06d2abbf224fe463e06dc3192e0431a6609
parenta7e8ab41fd6d53abba3f63cb34c9bcccb31efda7
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)

(cherry picked from commit 3a4a88f436ed1dd1165e0b59c1ca4a25e9e1d690)
crypto/bn/bn_div.c
crypto/bn/bn_shift.c
crypto/include/internal/bn_int.h