summaryrefslogtreecommitdiff
path: root/ecdsa.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-05-03 23:07:48 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-05-03 23:07:48 +0800
commit5123549bfccccaa43871481c300ea4d627dcfbda (patch)
tree34f184b86c912633a30c5c2554a07cc1de7ffb54 /ecdsa.c
parent140e57260018dfb014f828e18dff429b2530ef37 (diff)
downloaddropbear-5123549bfccccaa43871481c300ea4d627dcfbda.tar.gz
ecdsa is working
Diffstat (limited to 'ecdsa.c')
-rw-r--r--ecdsa.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ecdsa.c b/ecdsa.c
index 360f988..03b51a2 100644
--- a/ecdsa.c
+++ b/ecdsa.c
@@ -4,9 +4,29 @@
#include "crypto_desc.h"
#include "ecc.h"
#include "ecdsa.h"
+#include "signkey.h"
#ifdef DROPBEAR_ECDSA
+enum signkey_type ecdsa_signkey_type(ecc_key * key) {
+#ifdef DROPBEAR_ECC_256
+ if (key->dp == ecc_curve_nistp256.dp) {
+ return DROPBEAR_SIGNKEY_ECDSA_NISTP256;
+ }
+#endif
+#ifdef DROPBEAR_ECC_384
+ if (key->dp == ecc_curve_nistp384.dp) {
+ return DROPBEAR_SIGNKEY_ECDSA_NISTP384;
+ }
+#endif
+#ifdef DROPBEAR_ECC_521
+ if (key->dp == ecc_curve_nistp521.dp) {
+ return DROPBEAR_SIGNKEY_ECDSA_NISTP521;
+ }
+#endif
+ return DROPBEAR_SIGNKEY_NONE;
+}
+
ecc_key *gen_ecdsa_priv_key(unsigned int bit_size) {
const ltc_ecc_set_type *dp = NULL; // curve domain parameters
switch (bit_size) {