Use bits instead of bytes for a private/public key

This commit is contained in:
Martin Willi
2010-08-10 18:46:30 +02:00
parent 33ddaaabec
commit a944d2092b
24 changed files with 71 additions and 53 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
if (private)
{
printf("parsed %d bits %N private key.\n",
private->get_keysize(private)*8,
private->get_keysize(private),
key_type_names, private->get_type(private));
if (private->get_fingerprint(private, KEYID_PUBKEY_INFO_SHA1, &chunk))
{
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
if (public)
{
printf("parsed %d bits %N public key.\n",
public->get_keysize(public)*8,
public->get_keysize(public),
key_type_names, public->get_type(public));
if (public->get_fingerprint(public, KEYID_PUBKEY_INFO_SHA1, &chunk))
{
+5 -5
View File
@@ -79,23 +79,23 @@ int main(int argc, char *argv[])
{
switch (private->get_keysize(private))
{
case 32:
case 256:
scheme = SIGN_ECDSA_256;
break;
case 48:
case 384:
scheme = SIGN_ECDSA_384;
break;
case 66:
case 521:
scheme = SIGN_ECDSA_521;
break;
default:
printf("%d bit ECDSA private key size not supported",
private->get_keysize(private) * 8);
private->get_keysize(private));
exit(1);
}
}
printf("%4d bit %N: ", private->get_keysize(private)*8,
printf("%4d bit %N: ", private->get_keysize(private),
key_type_names, type);
sigs = malloc(sizeof(chunk_t) * rounds);