Fix missing semi-colon in non-ASM path
parent
459035fcaa
commit
0bdacf1496
|
|
@ -68,8 +68,8 @@
|
||||||
|
|
||||||
// Some compilers don't handle the code for the arithmetic shifts well.
|
// 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
|
// 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.
|
// the problem. We also switch to a slightly different pattern. We
|
||||||
// We believe the pattern preserves the existing properties without a
|
// believe the pattern preserves the existing properties without a
|
||||||
// branch. The ASM uses one intruction, while the C statement use 2 to 6
|
// branch. The ASM uses one intruction, while the C statement use 2 to 6
|
||||||
// instructions, depending on the compiler.
|
// instructions, depending on the compiler.
|
||||||
#if (__GNUC__ >= 3) || (__SUNPRO_CC >= 0x5100)
|
#if (__GNUC__ >= 3) || (__SUNPRO_CC >= 0x5100)
|
||||||
|
|
@ -137,7 +137,7 @@ inline unsigned int SignExtend(unsigned int val)
|
||||||
#else
|
#else
|
||||||
// GCC and SunCC compile down to a shift and neg.
|
// GCC and SunCC compile down to a shift and neg.
|
||||||
// Also see the comments for CRYPTOPP_ASR_ASM.
|
// 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);
|
return (unsigned int)(v * -1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,10 +129,11 @@ x25519::x25519(BufferedTransformation ¶ms)
|
||||||
size_t read; byte unused;
|
size_t read; byte unused;
|
||||||
|
|
||||||
BERSequenceDecoder sk(seq, BIT_STRING);
|
BERSequenceDecoder sk(seq, BIT_STRING);
|
||||||
|
CRYPTOPP_ASSERT(sk.MaxRetrievable() >= 33);
|
||||||
|
|
||||||
read = sk.Get(unused); // unused bits
|
read = sk.Get(unused); // unused bits
|
||||||
CRYPTOPP_ASSERT(read == 1 && unused == 0);
|
CRYPTOPP_ASSERT(read == 1 && unused == 0);
|
||||||
|
|
||||||
CRYPTOPP_ASSERT(sk.MaxRetrievable() >= 32);
|
|
||||||
read = sk.Get(m_sk, 32);
|
read = sk.Get(m_sk, 32);
|
||||||
sk.MessageEnd();
|
sk.MessageEnd();
|
||||||
|
|
||||||
|
|
@ -236,8 +237,7 @@ void x25519::GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKe
|
||||||
{
|
{
|
||||||
CRYPTOPP_UNUSED(rng);
|
CRYPTOPP_UNUSED(rng);
|
||||||
|
|
||||||
const byte base[32] = {9};
|
(void)Donna::curve25519(publicKey, privateKey);
|
||||||
(void)Donna::curve25519(publicKey, privateKey, base);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool x25519::Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey) const
|
bool x25519::Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey) const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue