From d504c223ef8248ea2e6fa16aaddf91003d979a07 Mon Sep 17 00:00:00 2001 From: Doug Engert Date: Tue, 26 Nov 2024 09:54:10 -0600 Subject: [PATCH] framework-pkcs15.c - use BYTES4BITS for readability On branch X25519-improvements-2 Changes to be committed: modified: src/pkcs11/framework-pkcs15.c --- src/pkcs11/framework-pkcs15.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pkcs11/framework-pkcs15.c b/src/pkcs11/framework-pkcs15.c index 2f05c6b26d..ba50b469fc 100644 --- a/src/pkcs11/framework-pkcs15.c +++ b/src/pkcs11/framework-pkcs15.c @@ -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;