Skip to content

Commit

Permalink
framework-pkcs15.c - use BYTES4BITS for readability
Browse files Browse the repository at this point in the history
 On branch X25519-improvements-2
 Changes to be committed:
	modified:   src/pkcs11/framework-pkcs15.c
  • Loading branch information
dengert committed Nov 26, 2024
1 parent 79fa64c commit 875c44a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pkcs11/framework-pkcs15.c
Original file line number Diff line number Diff line change
Expand Up @@ -2866,17 +2866,17 @@ pkcs15_create_public_key(struct sc_pkcs11_slot *slot, struct sc_profile *profile
}

if (key_type == CKK_EC_EDWARDS) {
if (ec->ecpointQ.len == 32)
if (ec->ecpointQ.len == BYTES4BITS(255))
ec->params.id = oid_ED25519;
else if (ec->ecpointQ.len == 56)
else if (ec->ecpointQ.len == BYTES4BITS(448))
ec->params.id = oid_ED448;
else
return CKR_ATTRIBUTE_VALUE_INVALID;

} else if (key_type == CKK_EC_MONTGOMERY) {
if (ec->ecpointQ.len == 32)
if (ec->ecpointQ.len == BYTES4BITS(255))
ec->params.id = oid_X25519;
else if (ec->ecpointQ.len == 56)
else if (ec->ecpointQ.len == BYTES4BITS(448))
ec->params.id = oid_X448;
else
return CKR_ATTRIBUTE_VALUE_INVALID;
Expand Down

0 comments on commit 875c44a

Please sign in to comment.