aboutsummaryrefslogtreecommitdiffstats
path: root/src/nr.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-06 19:48:09 +0000
committerlloyd <[email protected]>2006-09-06 19:48:09 +0000
commite00227828d80f9c9a17ef236586211faa01e4193 (patch)
tree2573533839150184038b18d7789eaef1ee5dd904 /src/nr.cpp
parent7f176fd2259fcb395ca03751f19790eac15bd9ce (diff)
Split PK_Key into Public_Key and Private_Key; these new classes merge in
the interfaces previously included in X509_PublicKey and PKCS8_PrivateKey.
Diffstat (limited to 'src/nr.cpp')
-rw-r--r--src/nr.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nr.cpp b/src/nr.cpp
index d6e436015..f8fe065df 100644
--- a/src/nr.cpp
+++ b/src/nr.cpp
@@ -25,7 +25,7 @@ NR_PublicKey::NR_PublicKey(const DL_Group& grp, const BigInt& y1)
void NR_PublicKey::X509_load_hook()
{
core = NR_Core(group, y);
- check_loaded_public();
+ load_check();
}
/*************************************************
@@ -60,8 +60,7 @@ NR_PrivateKey::NR_PrivateKey(const DL_Group& grp)
group = grp;
x = random_integer(2, group_q() - 1);
- PKCS8_load_hook();
- check_generated_private();
+ PKCS8_load_hook(true);
}
/*************************************************
@@ -75,17 +74,21 @@ NR_PrivateKey::NR_PrivateKey(const DL_Group& grp, const BigInt& x1,
x = x1;
PKCS8_load_hook();
- check_loaded_private();
}
/*************************************************
* Algorithm Specific PKCS #8 Initialization Code *
*************************************************/
-void NR_PrivateKey::PKCS8_load_hook()
+void NR_PrivateKey::PKCS8_load_hook(bool generated)
{
if(y == 0)
y = power_mod(group_g(), x, group_p());
core = NR_Core(group, y, x);
+
+ if(generated)
+ gen_check();
+ else
+ load_check();
}
/*************************************************