Skip to content
Snippets Groups Projects
Unverified Commit 94273718 authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

crypto/modes/ctr: update api to const input buffers

Input buffers are not modified, so can be declared const arguments.
This will allow using `const` inputs for `modes/ccm`.
parent d15f2873
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@
#include "crypto/modes/ctr.h"
int cipher_encrypt_ctr(cipher_t* cipher, uint8_t nonce_counter[16],
uint8_t nonce_len, uint8_t* input, size_t length,
uint8_t nonce_len, const uint8_t* input, size_t length,
uint8_t* output)
{
size_t offset = 0;
......@@ -50,7 +50,7 @@ int cipher_encrypt_ctr(cipher_t* cipher, uint8_t nonce_counter[16],
}
int cipher_decrypt_ctr(cipher_t* cipher, uint8_t nonce_counter[16],
uint8_t nonce_len, uint8_t* input, size_t length,
uint8_t nonce_len, const uint8_t* input, size_t length,
uint8_t* output)
{
return cipher_encrypt_ctr(cipher, nonce_counter, nonce_len, input,
......
......@@ -45,7 +45,7 @@ extern "C" {
* @return A negative error code if something went wrong
*/
int cipher_encrypt_ctr(cipher_t* cipher, uint8_t nonce_counter[16],
uint8_t nonce_len, uint8_t* input, size_t length,
uint8_t nonce_len, const uint8_t* input, size_t length,
uint8_t* output);
......@@ -69,7 +69,7 @@ int cipher_encrypt_ctr(cipher_t* cipher, uint8_t nonce_counter[16],
* @return A negative error code if something went wrong
*/
int cipher_decrypt_ctr(cipher_t* cipher, uint8_t nonce_counter[16],
uint8_t nonce_len, uint8_t* input, size_t length,
uint8_t nonce_len, const uint8_t* input, size_t length,
uint8_t* output);
#ifdef __cplusplus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment