bn/bn_lib.c: add BN_FLG_FIXED_TOP flag.
authorAndy Polyakov <appro@openssl.org>
Fri, 6 Jul 2018 13:02:29 +0000 (15:02 +0200)
committerAndy Polyakov <appro@openssl.org>
Thu, 26 Jul 2018 12:19:06 +0000 (14:19 +0200)
commitb7862891fed4cfb5ec36a31d35e14b51bf26d01e
treef598242e7e6cf60434238fb80e1c434d06e29998
parent616153f2f9c07f51212fb5e85170e89a4ebaadbb
bn/bn_lib.c: add BN_FLG_FIXED_TOP flag.

The new flag marks vectors that were not treated with bn_correct_top,
in other words such vectors are permitted to be zero padded. For now
it's BN_DEBUG-only flag, as initial use case for zero-padded vectors
would be controlled Montgomery multiplication/exponentiation, not
general purpose. For general purpose use another type might be more
appropriate. Advantage of this suggestion is that it's possible to
back-port it...

bn/bn_div.c: fix memory sanitizer problem.
bn/bn_sqr.c: harmonize with BN_mul.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6707)

(cherry picked from commit 305b68f1a2b6d4d0aa07a6ab47ac372f067a40bb)

Resolved conflicts:
crypto/bn/bn_lcl.h
crypto/bn/bn_div.c
crypto/bn/bn_lcl.h
crypto/bn/bn_lib.c
crypto/bn/bn_sqr.c