From 55d0acb15f70ae42b65c03323a8d84d527d43194 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 27 Aug 2021 13:10:57 -0700 Subject: [PATCH] fix(rust): change `size_t` to `uint32_t` in C header file fix ockam-network/ockam#1791 FFI C code should use uint32_t not size_t for u32 Rust parameters --- .../rust/ockam/ockam_ffi/include/vault.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/implementations/rust/ockam/ockam_ffi/include/vault.h b/implementations/rust/ockam/ockam_ffi/include/vault.h index 4bdeadf0786..db53fd2e505 100644 --- a/implementations/rust/ockam/ockam_ffi/include/vault.h +++ b/implementations/rust/ockam/ockam_ffi/include/vault.h @@ -69,7 +69,7 @@ ockam_vault_extern_error_t ockam_vault_default_init(ockam_vault_t* vault); */ ockam_vault_extern_error_t ockam_vault_sha256(ockam_vault_t vault, const uint8_t* input, - size_t input_length, + uint32_t input_length, uint8_t* digest); /** @@ -98,7 +98,7 @@ ockam_vault_extern_error_t ockam_vault_secret_import(ockam_vault_t ockam_vault_secret_t* secret, ockam_vault_secret_attributes_t attributes, const uint8_t* input, - size_t input_length); + uint32_t input_length); /** * @brief Export data from an ockam vault secret into the supplied output buffer. @@ -112,7 +112,7 @@ ockam_vault_extern_error_t ockam_vault_secret_import(ockam_vault_t ockam_vault_extern_error_t ockam_vault_secret_export(ockam_vault_t vault, ockam_vault_secret_t secret, uint8_t* output_buffer, - size_t output_buffer_size, + uint32_t output_buffer_size, size_t* output_buffer_length); /** @@ -127,7 +127,7 @@ ockam_vault_extern_error_t ockam_vault_secret_export(ockam_vault_t vault, ockam_vault_extern_error_t ockam_vault_secret_publickey_get(ockam_vault_t vault, ockam_vault_secret_t secret, uint8_t* output_buffer, - size_t output_buffer_size, + uint32_t output_buffer_size, size_t* output_buffer_length); /** @@ -162,7 +162,7 @@ ockam_vault_extern_error_t ockam_vault_secret_destroy(ockam_vault_t vault, ockam ockam_vault_extern_error_t ockam_vault_ecdh(ockam_vault_t vault, ockam_vault_secret_t privatekey, const uint8_t* peer_publickey, - size_t peer_publickey_length, + uint32_t peer_publickey_length, ockam_vault_secret_t* shared_secret); /** @@ -200,11 +200,11 @@ ockam_vault_extern_error_t ockam_vault_aead_aes_gcm_encrypt(ockam_vault_t ockam_vault_secret_t key, uint16_t nonce, const uint8_t* additional_data, - size_t additional_data_length, + uint32_t additional_data_length, const uint8_t* plaintext, - size_t plaintext_length, + uint32_t plaintext_length, uint8_t* ciphertext_and_tag, - size_t ciphertext_and_tag_size, + uint32_t ciphertext_and_tag_size, size_t* ciphertext_and_tag_length); /** @@ -225,11 +225,11 @@ ockam_vault_extern_error_t ockam_vault_aead_aes_gcm_decrypt(ockam_vault_t ockam_vault_secret_t key, uint16_t nonce, const uint8_t* additional_data, - size_t additional_data_length, + uint32_t additional_data_length, const uint8_t* ciphertext_and_tag, - size_t ciphertext_and_tag_length, + uint32_t ciphertext_and_tag_length, uint8_t* plaintext, - size_t plaintext_size, + uint32_t plaintext_size, size_t* plaintext_length); /**