summaryrefslogtreecommitdiff
path: root/pssr.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-07-17 21:44:53 -0400
committerJeffrey Walton <noloader@gmail.com>2015-07-17 21:44:53 -0400
commit20962b51a04ca04fa6a3209c2262afb795249871 (patch)
tree0702fc5ebfab8386f1ec72ca56f45a030190b6ad /pssr.cpp
parent434c56fcd27119d902aa71201283f9537697ed91 (diff)
downloadcryptopp-git-20962b51a04ca04fa6a3209c2262afb795249871.tar.gz
Changed guard on memcpy use to make it less intrusive. More closely resembles original code
Diffstat (limited to 'pssr.cpp')
-rw-r--r--pssr.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/pssr.cpp b/pssr.cpp
index f76f994a..b9698407 100644
--- a/pssr.cpp
+++ b/pssr.cpp
@@ -76,15 +76,9 @@ void PSSR_MEM_Base::ComputeMessageRepresentative(RandomNumberGenerator &rng,
xorbuf(xorStart + 1, recoverableMessage, recoverableMessageLength);
xorbuf(xorStart + 1 + recoverableMessageLength, salt, salt.size());
- if(representative && hashIdentifier.first && hashIdentifier.second)
- {
+ if(representative && hashIdentifier.first)
memcpy(representative + representativeByteLength - u, hashIdentifier.first, hashIdentifier.second);
- representative[representativeByteLength - 1] = 0xcc;
- }
- else
- {
- representative[representativeByteLength - 1] = 0xbc;
- }
+ representative[representativeByteLength - 1] = hashIdentifier.second ? 0xcc : 0xbc;
if (representativeBitLength % 8 != 0)
representative[0] = (byte)Crop(representative[0], representativeBitLength % 8);