Whitespace cleanup in crypto

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1264)
This commit is contained in:
FdaSilvaYY 2016-06-28 22:51:01 +02:00 committed by Rich Salz
parent 0517ffc47c
commit 02e112a885
23 changed files with 30 additions and 31 deletions

View File

@ -130,7 +130,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
# endif /* OPENSSL_NO_ASM */ # endif /* OPENSSL_NO_ASM */
/*- /*-
* BN_div computes dv := num / divisor, rounding towards * BN_div computes dv := num / divisor, rounding towards
* zero, and sets up rm such that dv*divisor + rm = num holds. * zero, and sets up rm such that dv*divisor + rm = num holds.
* Thus: * Thus:
* dv->neg == num->neg ^ divisor->neg (unless the result is zero) * dv->neg == num->neg ^ divisor->neg (unless the result is zero)

View File

@ -97,7 +97,7 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
bn_check_top(m); bn_check_top(m);
/*- /*-
* For even modulus m = 2^k*m_odd, it might make sense to compute * For even modulus m = 2^k*m_odd, it might make sense to compute
* a^p mod m_odd and a^p mod 2^k separately (with Montgomery * a^p mod m_odd and a^p mod 2^k separately (with Montgomery
* exponentiation for the odd part), using appropriate exponent * exponentiation for the odd part), using appropriate exponent
* reductions, and combine the results using the CRT. * reductions, and combine the results using the CRT.

View File

@ -370,7 +370,7 @@ BIGNUM *int_bn_mod_inverse(BIGNUM *in,
* i.e. * i.e.
* sign*(Y + D*X)*a == B (mod |n|). * sign*(Y + D*X)*a == B (mod |n|).
* *
* So if we set (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at * So if we set (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
* -sign*X*a == B (mod |n|), * -sign*X*a == B (mod |n|),
* sign*Y*a == A (mod |n|). * sign*Y*a == A (mod |n|).
* Note that X and Y stay non-negative all the time. * Note that X and Y stay non-negative all the time.
@ -565,7 +565,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
* i.e. * i.e.
* sign*(Y + D*X)*a == B (mod |n|). * sign*(Y + D*X)*a == B (mod |n|).
* *
* So if we set (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at * So if we set (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
* -sign*X*a == B (mod |n|), * -sign*X*a == B (mod |n|),
* sign*Y*a == A (mod |n|). * sign*Y*a == A (mod |n|).
* Note that X and Y stay non-negative all the time. * Note that X and Y stay non-negative all the time.

View File

@ -284,7 +284,6 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
} else } else
BN_zero(group->cofactor); BN_zero(group->cofactor);
/* /*
* Some groups have an order with * Some groups have an order with
* factors of two, which makes the Montgomery setup fail. * factors of two, which makes the Montgomery setup fail.

View File

@ -230,7 +230,7 @@ int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
/* /*
* Spec says IV is 120 bits or fewer - it allows non byte aligned lengths. * Spec says IV is 120 bits or fewer - it allows non byte aligned lengths.
* We don't support this at this stage * We don't support this at this stage
*/ */
if ((len > 15) || (len < 1) || (taglen > 16) || (taglen < 1)) { if ((len > 15) || (len < 1) || (taglen > 16) || (taglen < 1)) {
return -1; return -1;

View File

@ -582,7 +582,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
BIO_free_all(btmp); BIO_free_all(btmp);
BIO_free_all(etmp); BIO_free_all(etmp);
BIO_free_all(bio); BIO_free_all(bio);
return NULL; return NULL;
} }
static BIO *PKCS7_find_digest(EVP_MD_CTX **pmd, BIO *bio, int nid) static BIO *PKCS7_find_digest(EVP_MD_CTX **pmd, BIO *bio, int nid)

View File

@ -183,7 +183,7 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
/* /*
* Always do this zero-padding copy (even when num == flen) to avoid * Always do this zero-padding copy (even when num == flen) to avoid
* leaking that information. The copy still leaks some side-channel * leaking that information. The copy still leaks some side-channel
* information, but it's impossible to have a fixed memory access * information, but it's impossible to have a fixed memory access
* pattern since we can't read out of the bounds of |from|. * pattern since we can't read out of the bounds of |from|.
* *
* TODO(emilia): Consider porting BN_bn2bin_padded from BoringSSL. * TODO(emilia): Consider porting BN_bn2bin_padded from BoringSSL.

View File

@ -2538,7 +2538,7 @@ static int dane_match(X509_STORE_CTX *ctx, X509 *cert, int depth)
/* /*
* If we've previously matched a PKIX-?? record, no need to test any * If we've previously matched a PKIX-?? record, no need to test any
* further PKIX-?? records, it remains to just build the PKIX chain. * further PKIX-?? records, it remains to just build the PKIX chain.
* Had the match been a DANE-?? record, we'd be done already. * Had the match been a DANE-?? record, we'd be done already.
*/ */
if (dane->mdpth >= 0) if (dane->mdpth >= 0)

View File

@ -90,7 +90,7 @@ int BN_get_flags(const BIGNUM *b, int n);
*/ */
void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags); void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags);
/* Wrapper function to make using BN_GENCB easier, */ /* Wrapper function to make using BN_GENCB easier */
int BN_GENCB_call(BN_GENCB *cb, int a, int b); int BN_GENCB_call(BN_GENCB *cb, int a, int b);
BN_GENCB *BN_GENCB_new(void); BN_GENCB *BN_GENCB_new(void);