diff ecdsa.c @ 857:c19acba28590

use oldstyle comments
author Matt Johnston <matt@ucc.asn.au>
date Thu, 14 Nov 2013 22:03:30 +0800
parents 04ede40a529a
children c0b1b7eb5c84
line wrap: on
line diff
--- a/ecdsa.c	Thu Nov 14 21:45:50 2013 +0800
+++ b/ecdsa.c	Thu Nov 14 22:03:30 2013 +0800
@@ -35,7 +35,7 @@
 }
 
 ecc_key *gen_ecdsa_priv_key(unsigned int bit_size) {
-	const ltc_ecc_set_type *dp = NULL; // curve domain parameters
+	const ltc_ecc_set_type *dp = NULL; /* curve domain parameters */
 	ecc_key *new_key = NULL;
 	switch (bit_size) {
 #ifdef DROPBEAR_ECC_256
@@ -82,9 +82,9 @@
 	struct dropbear_ecc_curve **curve;
 	ecc_key *new_key = NULL;
 
-	// string   "ecdsa-sha2-[identifier]"
+	/* string   "ecdsa-sha2-[identifier]" */
 	key_ident = buf_getstring(buf, &key_ident_len);
-	// string   "[identifier]"
+	/* string   "[identifier]" */
 	identifier = buf_getstring(buf, &identifier_len);
 
 	if (key_ident_len != identifier_len + strlen("ecdsa-sha2-")) {
@@ -106,7 +106,7 @@
 		goto out;
 	}
 
-	// string Q
+	/* string Q */
 	q_buf = buf_getstringbuf(buf);
 	new_key = buf_get_ecc_raw_pubkey(q_buf, *curve);
 
@@ -183,7 +183,7 @@
 	}
 
 	for (;;) {
-		ecc_key R_key; // ephemeral key
+		ecc_key R_key; /* ephemeral key */
 		if (ecc_make_key_ex(NULL, dropbear_ltc_prng, &R_key, key->dp) != CRYPT_OK) {
 			goto out;
 		}
@@ -191,7 +191,7 @@
 			goto out;
 		}
 		if (ltc_mp.compare_d(r, 0) == LTC_MP_EQ) {
-			// try again
+			/* try again */
 			ecc_free(&R_key);
 			continue;
 		}
@@ -223,7 +223,7 @@
 
 	snprintf((char*)key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name);
 	buf_putstring(buf, key_ident, strlen(key_ident));
-	// enough for nistp521
+	/* enough for nistp521 */
 	sigbuf = buf_new(200);
 	buf_putmpint(sigbuf, (mp_int*)r);
 	buf_putmpint(sigbuf, (mp_int*)s);
@@ -245,8 +245,8 @@
 	}
 }
 
-// returns values in s and r
-// returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE
+/* returns values in s and r
+   returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
 static int buf_get_ecdsa_verify_params(buffer *buf,
 			void *r, void* s) {
 	int ret = DROPBEAR_FAILURE;
@@ -417,4 +417,4 @@
 
 
 
-#endif // DROPBEAR_ECDSA
+#endif /* DROPBEAR_ECDSA */