diff options
author | René Korthaus <[email protected]> | 2017-01-02 11:27:37 +0100 |
---|---|---|
committer | René Korthaus <[email protected]> | 2017-01-02 11:27:37 +0100 |
commit | 7cc746bbdf834ffb2128f501d1814de1c1293dfc (patch) | |
tree | dd6ef86adf950fe5287e3272502577a48e2c9043 | |
parent | cea400532dde96207a383912060cf0a2f4a247f5 (diff) |
Load q for DH public key in tests
-rw-r--r-- | src/tests/test_dh.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tests/test_dh.cpp b/src/tests/test_dh.cpp index 3b33a962d..632459ad5 100644 --- a/src/tests/test_dh.cpp +++ b/src/tests/test_dh.cpp @@ -56,7 +56,17 @@ class Diffie_Hellman_KAT_Tests : public PK_Key_Agreement_Test const Botan::BigInt p = get_req_bn(vars, "P"); const Botan::BigInt g = get_req_bn(vars, "G"); const Botan::BigInt y = get_req_bn(vars, "Y"); - const Botan::DL_Group grp(p, g); + const Botan::BigInt q = get_opt_bn(vars, "Q", 0); + + Botan::DL_Group grp; + if(q == 0) + { + grp = Botan::DL_Group(p, g); + } + else + { + grp = Botan::DL_Group(p, q, g); + } Botan::DH_PublicKey key(grp, y); return key.public_value(); |