diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-07-16 14:40:51 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-11 13:38:05 +0000 |
commit | 869b3bf824387ae50ab28be9bce66caae21bcae9 (patch) | |
tree | 498d9c1ba8c9429036a312688cf49ff947265dd3 /src/crypto | |
parent | bulletproofs: reject points not in the main subgroup (diff) | |
download | monero-869b3bf824387ae50ab28be9bce66caae21bcae9.tar.xz |
bulletproofs: a few fixes from the Kudelski review
- fix integer overflow in n_bulletproof_amounts
- check input scalars are in range
- remove use of environment variable to tweak straus performance
- do not use implementation defined signed shift for signum
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/crypto-ops.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/crypto/crypto-ops.c b/src/crypto/crypto-ops.c index 45d412ac6..c1fff1d44 100644 --- a/src/crypto/crypto-ops.c +++ b/src/crypto/crypto-ops.c @@ -3707,9 +3707,8 @@ void sc_muladd(unsigned char *s, const unsigned char *a, const unsigned char *b, s[31] = s11 >> 17; } -/* Assumes that a != INT64_MIN */ static int64_t signum(int64_t a) { - return (a >> 63) - ((-a) >> 63); + return a > 0 ? 1 : a < 0 ? -1 : 0; } int sc_check(const unsigned char *s) { |