From 0bdacf1496d51e6e99a98e7cd900443c6e8680c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 13 Dec 2018 03:39:01 -0500 Subject: [PATCH] Fix missing semi-colon in non-ASM path --- donna_32.cpp | 6 +++--- xed25519.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/donna_32.cpp b/donna_32.cpp index ffcf5558..00b81c6b 100644 --- a/donna_32.cpp +++ b/donna_32.cpp @@ -68,8 +68,8 @@ // Some compilers don't handle the code for the arithmetic shifts well. // For compilers we know how to support we will issue the asm to sidestep -// believe the problem. We also switch to a slightly different pattern. -// We believe the pattern preserves the existing properties without a +// the problem. We also switch to a slightly different pattern. We +// believe the pattern preserves the existing properties without a // branch. The ASM uses one intruction, while the C statement use 2 to 6 // instructions, depending on the compiler. #if (__GNUC__ >= 3) || (__SUNPRO_CC >= 0x5100) @@ -137,7 +137,7 @@ inline unsigned int SignExtend(unsigned int val) #else // GCC and SunCC compile down to a shift and neg. // Also see the comments for CRYPTOPP_ASR_ASM. - const signed int v = (signed int)(val >> S) + const signed int v = (signed int)(val >> S); return (unsigned int)(v * -1); #endif } diff --git a/xed25519.cpp b/xed25519.cpp index 3ac6d615..997202f1 100644 --- a/xed25519.cpp +++ b/xed25519.cpp @@ -129,10 +129,11 @@ x25519::x25519(BufferedTransformation ¶ms) size_t read; byte unused; BERSequenceDecoder sk(seq, BIT_STRING); + CRYPTOPP_ASSERT(sk.MaxRetrievable() >= 33); + read = sk.Get(unused); // unused bits CRYPTOPP_ASSERT(read == 1 && unused == 0); - - CRYPTOPP_ASSERT(sk.MaxRetrievable() >= 32); + read = sk.Get(m_sk, 32); sk.MessageEnd(); @@ -236,8 +237,7 @@ void x25519::GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKe { CRYPTOPP_UNUSED(rng); - const byte base[32] = {9}; - (void)Donna::curve25519(publicKey, privateKey, base); + (void)Donna::curve25519(publicKey, privateKey); } bool x25519::Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey) const