diff options
author | weidai <weidai11@users.noreply.github.com> | 2006-12-14 11:41:39 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2006-12-14 11:41:39 +0000 |
commit | 4afd858ae4974f82f9997b9184bc3d8d71d29b6e (patch) | |
tree | be3960f1424e79719ea9c5f6152df003bc1c44f3 /eccrypto.cpp | |
parent | 0f5ff1a06380139d0e93ba7cda3923d2c41cd866 (diff) | |
download | cryptopp-git-4afd858ae4974f82f9997b9184bc3d8d71d29b6e.tar.gz |
port to Borland C++Builder 2006
Diffstat (limited to 'eccrypto.cpp')
-rw-r--r-- | eccrypto.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/eccrypto.cpp b/eccrypto.cpp index 74cb95e1..876ee798 100644 --- a/eccrypto.cpp +++ b/eccrypto.cpp @@ -535,10 +535,11 @@ bool DL_GroupParameters_EC<EC>::ValidateElement(unsigned int level, const Elemen if (gpc) pass = pass && gpc->Exponentiate(this->GetGroupPrecomputation(), Integer::One()) == g; } - if (level >= 2) + if (level >= 2 && pass) { const Integer &q = GetSubgroupOrder(); - pass = pass && IsIdentity(gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : ExponentiateElement(g, q)); + Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : ExponentiateElement(g, q); + pass = pass && IsIdentity(gq); } return pass; } |