mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
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`.
This commit is contained in:
parent
d15f287312
commit
9427371849
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user