Capitalize "Merkle" in LMS and LMOTS code

As it is a proper noun

Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
Raef Coles 2022-10-10 15:44:17 +01:00
parent faf59babe8
commit 285d44b180
No known key found for this signature in database
GPG key ID: 1AAF1B43DF2086F4
2 changed files with 17 additions and 17 deletions

View file

@ -181,7 +181,7 @@ typedef struct {
/** LMS public context structure. /** LMS public context structure.
* *
*A LMS public key is the hash output that is the root of the merkle tree, and *A LMS public key is the hash output that is the root of the Merkle tree, and
* the applicable parameter set * the applicable parameter set
* *
* The context must be initialized before it is used. A public key must either * The context must be initialized before it is used. A public key must either
@ -200,7 +200,7 @@ typedef struct {
typedef struct { typedef struct {
mbedtls_lms_parameters_t MBEDTLS_PRIVATE(params); mbedtls_lms_parameters_t MBEDTLS_PRIVATE(params);
unsigned char MBEDTLS_PRIVATE(T_1_pub_key)[MBEDTLS_LMS_M_NODE_BYTES_MAX]; /*!< The public key, in unsigned char MBEDTLS_PRIVATE(T_1_pub_key)[MBEDTLS_LMS_M_NODE_BYTES_MAX]; /*!< The public key, in
the form of the merkle tree root node. */ the form of the Merkle tree root node. */
unsigned char MBEDTLS_PRIVATE(have_public_key); /*!< Whether the context contains a public key. unsigned char MBEDTLS_PRIVATE(have_public_key); /*!< Whether the context contains a public key.
Boolean values only. */ Boolean values only. */
} mbedtls_lms_public_t; } mbedtls_lms_public_t;
@ -228,9 +228,9 @@ typedef struct {
uint32_t MBEDTLS_PRIVATE(q_next_usable_key); /*!< The index of the next OTS key that has not uint32_t MBEDTLS_PRIVATE(q_next_usable_key); /*!< The index of the next OTS key that has not
been used. */ been used. */
mbedtls_lmots_private_t *MBEDTLS_PRIVATE(ots_private_keys); /*!< The private key material. One OTS key mbedtls_lmots_private_t *MBEDTLS_PRIVATE(ots_private_keys); /*!< The private key material. One OTS key
for each leaf node in the merkle tree. */ for each leaf node in the Merkle tree. */
mbedtls_lmots_public_t *MBEDTLS_PRIVATE(ots_public_keys); /*!< The OTS key public keys, used to mbedtls_lmots_public_t *MBEDTLS_PRIVATE(ots_public_keys); /*!< The OTS key public keys, used to
build the merkle tree. */ build the Merkle tree. */
unsigned char MBEDTLS_PRIVATE(have_private_key); /*!< Whether the context contains a private key. unsigned char MBEDTLS_PRIVATE(have_private_key); /*!< Whether the context contains a private key.
Boolean values only. */ Boolean values only. */
} mbedtls_lms_private_t; } mbedtls_lms_private_t;

View file

@ -83,7 +83,7 @@ static const unsigned char D_LEAF_CONSTANT_BYTES[D_CONST_LEN] = {0x82, 0x82};
static const unsigned char D_INTR_CONSTANT_BYTES[D_CONST_LEN] = {0x83, 0x83}; static const unsigned char D_INTR_CONSTANT_BYTES[D_CONST_LEN] = {0x83, 0x83};
/* Calculate the value of a leaf node of the merkle tree (which is a hash of a /* Calculate the value of a leaf node of the Merkle tree (which is a hash of a
* public key and some other parameters like the leaf index). This function * public key and some other parameters like the leaf index). This function
* implements RFC8554 section 5.3, in the case where r >= 2^h. * implements RFC8554 section 5.3, in the case where r >= 2^h.
* *
@ -95,8 +95,8 @@ static const unsigned char D_INTR_CONSTANT_BYTES[D_CONST_LEN] = {0x83, 0x83};
* corresponds to the index of this leaf node. This * corresponds to the index of this leaf node. This
* is a hash output. * is a hash output.
* *
* r_node_idx The index of this node in the merkle tree. Note * r_node_idx The index of this node in the Merkle tree. Note
* that the root node of the merkle tree is * that the root node of the Merkle tree is
* 1-indexed. * 1-indexed.
* *
* out The output node value, which is a hash output. * out The output node value, which is a hash output.
@ -146,7 +146,7 @@ exit:
return ( mbedtls_lms_error_from_psa( status ) ); return ( mbedtls_lms_error_from_psa( status ) );
} }
/* Calculate the value of an internal node of the merkle tree (which is a hash /* Calculate the value of an internal node of the Merkle tree (which is a hash
* of a public key and some other parameters like the node index). This function * of a public key and some other parameters like the node index). This function
* implements RFC8554 section 5.3, in the case where r < 2^h. * implements RFC8554 section 5.3, in the case where r < 2^h.
* *
@ -156,14 +156,14 @@ exit:
* *
* left_node The value of the child of this node which is on * left_node The value of the child of this node which is on
* the left-hand side. As with all nodes on the * the left-hand side. As with all nodes on the
* merkle tree, this is a hash output. * Merkle tree, this is a hash output.
* *
* right_node The value of the child of this node which is on * right_node The value of the child of this node which is on
* the right-hand side. As with all nodes on the * the right-hand side. As with all nodes on the
* merkle tree, this is a hash output. * Merkle tree, this is a hash output.
* *
* r_node_idx The index of this node in the merkle tree. Note * r_node_idx The index of this node in the Merkle tree. Note
* that the root node of the merkle tree is * that the root node of the Merkle tree is
* 1-indexed. * 1-indexed.
* *
* out The output node value, which is a hash output. * out The output node value, which is a hash output.
@ -434,9 +434,9 @@ int mbedtls_lms_verify( const mbedtls_lms_public_t *ctx,
#if defined(MBEDTLS_LMS_PRIVATE) #if defined(MBEDTLS_LMS_PRIVATE)
/* Calculate a full merkle tree based on a private key. This function /* Calculate a full Merkle tree based on a private key. This function
* implements RFC8554 section 5.3, and is used to generate a public key (as the * implements RFC8554 section 5.3, and is used to generate a public key (as the
* public key is the root node of the merkle tree). * public key is the root node of the Merkle tree).
* *
* ctx The LMS private context, containing a parameter * ctx The LMS private context, containing a parameter
* set and private key material consisting of both * set and private key material consisting of both
@ -445,7 +445,7 @@ int mbedtls_lms_verify( const mbedtls_lms_public_t *ctx,
* tree The output tree, which is 2^(H + 1) hash outputs. * tree The output tree, which is 2^(H + 1) hash outputs.
* In the case of H=10 we have 2048 tree nodes (of * In the case of H=10 we have 2048 tree nodes (of
* which 1024 of them are leaf nodes). Note that * which 1024 of them are leaf nodes). Note that
* because the merkle tree root is 1-indexed, the 0 * because the Merkle tree root is 1-indexed, the 0
* index tree node is never used. * index tree node is never used.
*/ */
static int calculate_merkle_tree( const mbedtls_lms_private_t *ctx, static int calculate_merkle_tree( const mbedtls_lms_private_t *ctx,
@ -491,9 +491,9 @@ static int calculate_merkle_tree( const mbedtls_lms_private_t *ctx,
return( 0 ); return( 0 );
} }
/* Calculate a path from a leaf node of the merkle tree to the root of the tree, /* Calculate a path from a leaf node of the Merkle tree to the root of the tree,
* and return the full path. This function implements RFC8554 section 5.4.1, as * and return the full path. This function implements RFC8554 section 5.4.1, as
* the merkle path is the main component of an LMS signature. * the Merkle path is the main component of an LMS signature.
* *
* ctx The LMS private context, containing a parameter * ctx The LMS private context, containing a parameter
* set and private key material consisting of both * set and private key material consisting of both