summaryrefslogtreecommitdiff
path: root/hmqv.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-08-03 03:24:26 -0400
committerJeffrey Walton <noloader@gmail.com>2019-08-03 03:24:26 -0400
commit84c4ae429f643cf1e84b5ef11cb2f5f12a5d6d76 (patch)
treec0d8d1751015e70438167defd78c5da3ec0a8b5f /hmqv.h
parent176cab0dc5747391168bb41f6b4d7c4b14ea0c0c (diff)
downloadcryptopp-git-84c4ae429f643cf1e84b5ef11cb2f5f12a5d6d76.tar.gz
Fix const-ness in HMQV and FHMQV
Diffstat (limited to 'hmqv.h')
-rw-r--r--hmqv.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/hmqv.h b/hmqv.h
index 3834a619..f3c99731 100644
--- a/hmqv.h
+++ b/hmqv.h
@@ -125,7 +125,7 @@ public:
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
bool validateStaticOtherPublicKey=true) const
{
- byte *XX = NULLPTR, *YY = NULLPTR, *AA = NULLPTR, *BB = NULLPTR;
+ const byte *XX = NULLPTR, *YY = NULLPTR, *AA = NULLPTR, *BB = NULLPTR;
size_t xxs = 0, yys = 0, aas = 0, bbs = 0;
// Depending on the role, this will hold either A's or B's static
@@ -143,11 +143,11 @@ public:
Element B = params.ExponentiateBase(b);
params.EncodeElement(true, B, tt);
- XX = const_cast<byte*>(ephemeralOtherPublicKey);
+ XX = ephemeralOtherPublicKey;
xxs = EphemeralPublicKeyLength();
- YY = const_cast<byte*>(ephemeralPrivateKey) + StaticPrivateKeyLength();
+ YY = ephemeralPrivateKey + StaticPrivateKeyLength();
yys = EphemeralPublicKeyLength();
- AA = const_cast<byte*>(staticOtherPublicKey);
+ AA = staticOtherPublicKey;
aas = StaticPublicKeyLength();
BB = tt.BytePtr();
bbs = tt.SizeInBytes();
@@ -158,13 +158,13 @@ public:
Element A = params.ExponentiateBase(a);
params.EncodeElement(true, A, tt);
- XX = const_cast<byte*>(ephemeralPrivateKey) + StaticPrivateKeyLength();
+ XX = ephemeralPrivateKey + StaticPrivateKeyLength();
xxs = EphemeralPublicKeyLength();
- YY = const_cast<byte*>(ephemeralOtherPublicKey);
+ YY = ephemeralOtherPublicKey;
yys = EphemeralPublicKeyLength();
AA = tt.BytePtr();
aas = tt.SizeInBytes();
- BB = const_cast<byte*>(staticOtherPublicKey);
+ BB = staticOtherPublicKey;
bbs = StaticPublicKeyLength();
}
else