diff options
author | Matt Caswell <matt@openssl.org> | 2018-02-01 14:23:13 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-02-20 12:59:30 +0000 |
commit | 756b5af71c50a5e66525b06daa4372b44cf1040e (patch) | |
tree | 7593f8d91d792cf3ea1cd54f7f35a81ae3e7eada /crypto/ec/curve448 | |
parent | 8855a9a110d4a8e6b9f2ea3a7cd9f591a30cbc11 (diff) |
Use NLIMBS where appropriate to simplify the code
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5105)
Diffstat (limited to 'crypto/ec/curve448')
-rw-r--r-- | crypto/ec/curve448/arch_32/f_impl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/curve448/arch_32/f_impl.h b/crypto/ec/curve448/arch_32/f_impl.h index 78971e8576..7c87e972e2 100644 --- a/crypto/ec/curve448/arch_32/f_impl.h +++ b/crypto/ec/curve448/arch_32/f_impl.h @@ -29,7 +29,7 @@ void gf_sub_RAW(gf out, const gf a, const gf b) { unsigned int i; - for (i = 0; i < sizeof(*out) / sizeof(out->limb[0]); i++) { + for (i = 0; i < NLIMBS; i++) { out->limb[i] = a->limb[i] - b->limb[i]; } } @@ -39,7 +39,7 @@ void gf_bias(gf a, int amt) unsigned int i; uint32_t co1 = ((1 << 28) - 1) * amt, co2 = co1 - amt; - for (i = 0; i < sizeof(*a) / sizeof(a->limb[0]); i++) + for (i = 0; i < NLIMBS; i++) a->limb[i] += (i == sizeof(*a) / sizeof(a->limb[0]) / 2) ? co2 : co1; } |