summaryrefslogtreecommitdiff
path: root/hmqv.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-03-01 06:10:06 -0500
committerJeffrey Walton <noloader@gmail.com>2017-03-01 06:10:06 -0500
commit5efb019d8bdc593b3c1a0b57d615b170c7dab02a (patch)
treee2c10e737542fd13ea50b58480e0791bbc455e47 /hmqv.h
parent5fb2f5d45b9bb2cd86db5d01f4b30d606a2a4c80 (diff)
downloadcryptopp-git-5efb019d8bdc593b3c1a0b57d615b170c7dab02a.tar.gz
Add C++ nullptr support (Issue 383)
Diffstat (limited to 'hmqv.h')
-rw-r--r--hmqv.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/hmqv.h b/hmqv.h
index 2abe00c7..c25e5f1b 100644
--- a/hmqv.h
+++ b/hmqv.h
@@ -125,7 +125,7 @@ public:
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
bool validateStaticOtherPublicKey=true) const
{
- byte *XX = NULL, *YY = NULL, *AA = NULL, *BB = NULL;
+ 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
@@ -176,13 +176,13 @@ public:
// VerifyPoint to ensure the element is in G*. If the other's PublicKey is
// requested to be validated, we manually call ValidateElement at level 3.
Element VV1 = params.DecodeElement(staticOtherPublicKey, false);
- if(!params.ValidateElement(validateStaticOtherPublicKey ? 3 : 1, VV1, NULL))
+ if(!params.ValidateElement(validateStaticOtherPublicKey ? 3 : 1, VV1, NULLPTR))
return false;
// DecodeElement calls ValidateElement at level 1. Level 1 only calls
// VerifyPoint to ensure the element is in G*. Crank it up.
Element VV2 = params.DecodeElement(ephemeralOtherPublicKey, false);
- if(!params.ValidateElement(3, VV2, NULL))
+ if(!params.ValidateElement(3, VV2, NULLPTR))
return false;
// const Integer& p = params.GetGroupOrder(); // not used, remove later
@@ -193,11 +193,11 @@ public:
SecByteBlock dd(len), ee(len);
// Compute $d = \hat{H}(X, \hat{B})$
- Hash(NULL, XX, xxs, BB, bbs, dd.BytePtr(), dd.SizeInBytes());
+ Hash(NULLPTR, XX, xxs, BB, bbs, dd.BytePtr(), dd.SizeInBytes());
d.Decode(dd.BytePtr(), dd.SizeInBytes());
// Compute $e = \hat{H}(Y, \hat{A})$
- Hash(NULL, YY, yys, AA, aas, ee.BytePtr(), ee.SizeInBytes());
+ Hash(NULLPTR, YY, yys, AA, aas, ee.BytePtr(), ee.SizeInBytes());
e.Decode(ee.BytePtr(), ee.SizeInBytes());
Element sigma;
@@ -231,7 +231,7 @@ public:
// $\sigma_A}=(Y \cdot B^{e})^{s_A}
sigma = params.ExponentiateElement(t2, s_A);
}
- Hash(&sigma, NULL, 0, NULL, 0, agreedValue, AgreedValueLength());
+ Hash(&sigma, NULLPTR, 0, NULLPTR, 0, agreedValue, AgreedValueLength());
}
catch (DL_BadElement &)
{