mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Fix const-ness in HMQV and FHMQV
This commit is contained in:
parent
176cab0dc5
commit
84c4ae429f
14
fhmqv.h
14
fhmqv.h
@ -126,7 +126,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
|
||||
@ -144,11 +144,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();
|
||||
@ -159,13 +159,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
|
||||
|
14
hmqv.h
14
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
|
||||
|
Loading…
Reference in New Issue
Block a user