Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codespell fixes #3710

Merged
merged 9 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style(c): codespell implementations/c/
  • Loading branch information
jtmoon79 authored and mrinalwadhwa committed Oct 22, 2022
commit 6706be80462de951c777a9723091b0f25d87c5a2
4 changes: 2 additions & 2 deletions implementations/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# Set the minimum required CMake version to 3.1...3.18
#
# * We require atleast CMake 3.1 (which added the target_sources command)
# * has been tested for versions upto 3.18
# * We require at least CMake 3.1 (which added the target_sources command)
# * has been tested for versions up to 3.18
#
# The FATAL_ERROR option is accepted, but ignored, by CMake 2.6 and higher.
# It's specified so CMake versions 2.4 and lower fail with an error instead of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# your cmake- (or more generically externally-) built artifacts.
#
# If you desire to use IAR EW as native IDE, you'll need to create EW project and then manually add
# every file using the IDE GUI. To maintain folder structure, use "add group" to mimick/replicate the folder
# every file using the IDE GUI. To maintain folder structure, use "add group" to mimic/replicate the folder
# hierarchy. The project config/structure is eventually saved into XML files. So presumably, you could
# also create by hand (or write a script to generate) the XML files.
#
Expand Down
2 changes: 1 addition & 1 deletion implementations/c/ockam/random/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct {
ockam_error_t (*deinit)(ockam_random_t* random);

/**
* @brief Retrive a specified number of random bytes from the random implementation.
* @brief Retrieve a specified number of random bytes from the random implementation.
* @param random[in] The ockam random object to use.
* @param buffer[out] Buffer to fill with random bytes.
* @param buffer_size[in] Buffer size (in bytes).
Expand Down
8 changes: 4 additions & 4 deletions implementations/c/ockam/vault/atecc508a/atecc508a.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ OckamError Atecc508aHkdfWriteKey(const OckamMemory *p_memory, uint8_t *p_key, si
p_buf += ATECC508A_SLOT_WRITE_SIZE_MAX;
}

if (status != ATCA_SUCCESS) { /* Ensure the 32 byte writes were sucessful before */
if (status != ATCA_SUCCESS) { /* Ensure the 32 byte writes were successful before */
ret_val = kOckamError; /* attempting the 4 byte writes */
goto exit_block;
}
Expand All @@ -606,15 +606,15 @@ OckamError Atecc508aHkdfWriteKey(const OckamMemory *p_memory, uint8_t *p_key, si
}

slot_offset++; /* Adjust the offset and buffer pointer AFTER data */
p_buf += ATECC508A_SLOT_WRITE_SIZE_MIN; /* has been sucessfully written to the ATECC508A */
p_buf += ATECC508A_SLOT_WRITE_SIZE_MIN; /* has been successfully written to the ATECC508A */

if (slot_offset >= ATECC508A_SLOT_OFFSET_MAX) { /* Always check the slot offset after its been */
slot_offset = 0; /* incremented */
block_offset++;
}
}

if (status != ATCA_SUCCESS) { /* Ensure the 4 byte writes were sucessful before */
if (status != ATCA_SUCCESS) { /* Ensure the 4 byte writes were successful before */
ret_val = kOckamError; /* proceeding, otherwise unknown data in HKDF slot */
goto exit_block; /* may be used for HKDF */
}
Expand Down Expand Up @@ -769,7 +769,7 @@ OckamError Atecc508aHkdfExpand(const OckamMemory *p_memory, uint8_t key_slot, ui

exit_block:

if (p_atca_ctx) { /* If an error occured in the loop and we exited */
if (p_atca_ctx) { /* If an error occurred in the loop and we exited */
p_memory->Free(p_atca_ctx, /* early, ensure the buffer is freed. */
sizeof(atca_hmac_sha256_ctx_t));
}
Expand Down
6 changes: 3 additions & 3 deletions implementations/c/ockam/vault/atecc608a/atecc608a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ ockam_error_t atecc608a_aead_aes_gcm(ockam_vault_t* vault,
if (encrypt == VAULT_ATECC608A_AEAD_AES_GCM_ENCRYPT) {

uint8_t* tag_offset = 0;
status = atcab_aes_gcm_encrypt_update(atca_ctx, /* If mode is encrypt, resulting cipertext is placed */
status = atcab_aes_gcm_encrypt_update(atca_ctx, /* If mode is encrypt, resulting ciphertext is placed */
input, /* into output. */
input_length,
output);
Expand All @@ -1511,8 +1511,8 @@ ockam_error_t atecc608a_aead_aes_gcm(ockam_vault_t* vault,

tag_offset = output + input_length;

status = atcab_aes_gcm_encrypt_finish(atca_ctx, /* After the cipertext has been generated, output the */
tag_offset, /* resulting tag to p_tag and end AES GCM encryption */
status = atcab_aes_gcm_encrypt_finish(atca_ctx, /* After the ciphertext has been generated, output the */
tag_offset, /* resulting tag to p_tag and end AES GCM encryption */
OCKAM_VAULT_AEAD_AES_GCM_TAG_LENGTH);
if (status != ATCA_SUCCESS) {
error.code = OCKAM_VAULT_ATECC608A_ERROR_AEAD_AES_GCM_FAIL;
Expand Down
8 changes: 4 additions & 4 deletions implementations/c/ockam/vault/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct {
* @brief Generate an ockam secret.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with the generated secret.
* @param attributes[in] Desired attribtes for the secret to be generated.
* @param attributes[in] Desired attributes for the secret to be generated.
*/
ockam_error_t (*secret_generate)(ockam_vault_t* vault,
ockam_vault_secret_t* secret,
Expand All @@ -60,7 +60,7 @@ typedef struct {
* @brief Import the specified data into the supplied ockam vault secret.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with input data.
* @param attributes[in] Desired attribtes for the secret to be imported.
* @param attributes[in] Desired attributes for the secret to be imported.
* @param input[in] Data to load into the supplied secret.
* @param input_length[in] Length of data to load into the secret.
*/
Expand Down Expand Up @@ -101,7 +101,7 @@ typedef struct {
size_t* output_buffer_length);

/**
* @brief Retrive the attributes for a specified secret
* @brief Retrieve the attributes for a specified secret
* @param vault[in] Vault object to use for retrieving ockam vault secret attributes.
* @param secret[in] Ockam vault secret to get attributes for.
* @param attributes[out] Pointer to the attributes for the specified secret.
Expand Down Expand Up @@ -133,7 +133,7 @@ typedef struct {
* @param privatekey[in] The ockam vault secret to use for the private key of ECDH.
* @param peer_publickey[in] Public key data to use for ECDH.
* @param peer_publickey_length[in] Length of the public key.
* @param shared_secret[out] Resulting shared secret from a sucessful ECDH operation. Invalid if ECDH failed.
* @param shared_secret[out] Resulting shared secret from a successful ECDH operation. Invalid if ECDH failed.
* @return OCKAM_ERROR_NONE on success.
*/
ockam_error_t (*ecdh)(ockam_vault_t* vault,
Expand Down
4 changes: 2 additions & 2 deletions implementations/c/ockam/vault/rust/vault.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ uint32_t ockam_vault_sha256(ockam_vault_t vault,
* generate. For EC keys and AES keys, length is ignored.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with a handle to the secret
* @param attributes[in] Desired attribtes for the secret to be generated.
* @param attributes[in] Desired attributes for the secret to be generated.
*/
uint32_t ockam_vault_secret_generate(ockam_vault_t vault,
ockam_vault_secret_t* secret,
Expand Down Expand Up @@ -185,7 +185,7 @@ uint32_t ockam_vault_secret_destroy(ockam_vault_t vault, ockam_vault_secret_t se
* @param privatekey[in] The ockam vault secret to use for the private key of ECDH.
* @param peer_publickey[in] Public key data to use for ECDH.
* @param peer_publickey_length[in] Length of the public key.
* @param shared_secret[out] Resulting shared secret from a sucessful ECDH operation. Invalid if ECDH failed.
* @param shared_secret[out] Resulting shared secret from a successful ECDH operation. Invalid if ECDH failed.
* @return OCKAM_ERROR_NONE on success.
*/
uint32_t ockam_vault_ecdh(ockam_vault_t* vault,
Expand Down
6 changes: 3 additions & 3 deletions implementations/c/ockam/vault/tests/secret_ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ void test_vault_secret_ecdh(void** state)
assert_true(ockam_error_is_none(&error));
}

/* ------------ */
/* Key Retrival */
/* ------------ */
/* ------------- */
/* Key Retrieval */
/* ------------- */

error = ockam_vault_secret_publickey_get(
test_data->vault, &initiator_secret, generated_initiator_pub, test_data->key_size, &length);
Expand Down
8 changes: 4 additions & 4 deletions implementations/c/ockam/vault/vault.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ ockam_error_t ockam_vault_sha256(ockam_vault_t* vault,
* generate. For EC keys and AES keys, length is ignored.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with the generated secret.
* @param attributes[in] Desired attribtes for the secret to be generated.
* @param attributes[in] Desired attributes for the secret to be generated.
*/
ockam_error_t ockam_vault_secret_generate(ockam_vault_t* vault,
ockam_vault_secret_t* secret,
Expand All @@ -139,7 +139,7 @@ ockam_error_t ockam_vault_secret_generate(ockam_vault_t*
* @brief Import the specified data into the supplied ockam vault secret.
* @param vault[in] Vault object to use for generating a secret key.
* @param secret[out] Pointer to an ockam secret object to be populated with input data.
* @param attributes[in] Desired attribtes for the secret being imported.
* @param attributes[in] Desired attributes for the secret being imported.
* @param input[in] Data to load into the supplied secret.
* @param input_length[in] Length of data to load into the secret.
*/
Expand Down Expand Up @@ -181,7 +181,7 @@ ockam_error_t ockam_vault_secret_publickey_get(ockam_vault_t* vault,
size_t* output_buffer_length);

/**
* @brief Retrive the attributes for a specified secret
* @brief Retrieve the attributes for a specified secret
* @param vault[in] Vault object to use for retrieving ockam vault secret attributes.
* @param secret[in] Ockam vault secret to get attributes for.
* @param secret_attributes[out] Pointer to the attributes for the specified secret.
Expand Down Expand Up @@ -214,7 +214,7 @@ ockam_error_t ockam_vault_secret_destroy(ockam_vault_t* vault, ockam_vault_secre
* @param privatekey[in] The ockam vault secret to use for the private key of ECDH.
* @param peer_publickey[in] Public key data to use for ECDH.
* @param peer_publickey_length[in] Length of the public key.
* @param shared_secret[out] Resulting shared secret from a sucessful ECDH operation. Invalid if ECDH failed.
* @param shared_secret[out] Resulting shared secret from a successful ECDH operation. Invalid if ECDH failed.
* @return OCKAM_ERROR_NONE on success.
*/
ockam_error_t ockam_vault_ecdh(ockam_vault_t* vault,
Expand Down