diff options
author | tb <> | 2019-06-04 18:12:26 +0000 |
---|---|---|
committer | tb <> | 2019-06-04 18:12:26 +0000 |
commit | c37acb14ff755777750095c3edd59e1923c97c17 (patch) | |
tree | 72d841549a90b3b6bede2abaccfec310edcb157e /src | |
parent | a23b4d931c9340b198ce07c0b475a4757eb86a37 (diff) | |
download | openbsd-c37acb14ff755777750095c3edd59e1923c97c17.tar.gz openbsd-c37acb14ff755777750095c3edd59e1923c97c17.tar.bz2 openbsd-c37acb14ff755777750095c3edd59e1923c97c17.zip |
Readability tweaks for comments that explain the blinding.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_ossl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c index 50a73c0fa9..ecf2662467 100644 --- a/src/lib/libcrypto/dsa/dsa_ossl.c +++ b/src/lib/libcrypto/dsa/dsa_ossl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_ossl.c,v 1.41 2019/06/04 18:10:11 tb Exp $ */ | 1 | /* $OpenBSD: dsa_ossl.c,v 1.42 2019/06/04 18:12:26 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -148,7 +148,7 @@ dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
148 | * In order to reduce the possibility of a side-channel attack, the | 148 | * In order to reduce the possibility of a side-channel attack, the |
149 | * following is calculated using a blinding value: | 149 | * following is calculated using a blinding value: |
150 | * | 150 | * |
151 | * s = inv(k)inv(b)(bm + bxr) mod q | 151 | * s = inv(b)(bm + bxr)inv(k) mod q |
152 | * | 152 | * |
153 | * Where b is a random value in the range [1, q). | 153 | * Where b is a random value in the range [1, q). |
154 | */ | 154 | */ |
@@ -159,11 +159,11 @@ dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
159 | 159 | ||
160 | if (!BN_mod_mul(&bxr, &b, dsa->priv_key, dsa->q, ctx)) /* bx */ | 160 | if (!BN_mod_mul(&bxr, &b, dsa->priv_key, dsa->q, ctx)) /* bx */ |
161 | goto err; | 161 | goto err; |
162 | if (!BN_mod_mul(&bxr, &bxr, r, dsa->q, ctx)) /* bxr */ | 162 | if (!BN_mod_mul(&bxr, &bxr, r, dsa->q, ctx)) /* bxr */ |
163 | goto err; | 163 | goto err; |
164 | if (!BN_mod_mul(&bm, &b, &m, dsa->q, ctx)) /* bm */ | 164 | if (!BN_mod_mul(&bm, &b, &m, dsa->q, ctx)) /* bm */ |
165 | goto err; | 165 | goto err; |
166 | if (!BN_mod_add(s, &bxr, &bm, dsa->q, ctx)) /* s = bm + bxr */ | 166 | if (!BN_mod_add(s, &bxr, &bm, dsa->q, ctx)) /* s = bm + bxr */ |
167 | goto err; | 167 | goto err; |
168 | if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) /* s = b(m + xr)k^-1 */ | 168 | if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) /* s = b(m + xr)k^-1 */ |
169 | goto err; | 169 | goto err; |