diff --git a/sys/crypto/modes/ctr.c b/sys/crypto/modes/ctr.c index 22c6da37a4..bf60adc6ab 100644 --- a/sys/crypto/modes/ctr.c +++ b/sys/crypto/modes/ctr.c @@ -21,7 +21,7 @@ #include "crypto/helper.h" #include "crypto/modes/ctr.h" -int cipher_encrypt_ctr(cipher_t *cipher, uint8_t nonce_counter[16], +int cipher_encrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16], uint8_t nonce_len, const uint8_t *input, size_t length, uint8_t *output) { @@ -49,7 +49,7 @@ int cipher_encrypt_ctr(cipher_t *cipher, uint8_t nonce_counter[16], return offset; } -int cipher_decrypt_ctr(cipher_t *cipher, uint8_t nonce_counter[16], +int cipher_decrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16], uint8_t nonce_len, const uint8_t *input, size_t length, uint8_t *output) { diff --git a/sys/include/crypto/modes/ctr.h b/sys/include/crypto/modes/ctr.h index 85f6cce4af..336b36d9c0 100644 --- a/sys/include/crypto/modes/ctr.h +++ b/sys/include/crypto/modes/ctr.h @@ -44,7 +44,7 @@ extern "C" { * @return Length of encrypted data on a successful encryption * @return A negative error code if something went wrong */ -int cipher_encrypt_ctr(cipher_t *cipher, uint8_t nonce_counter[16], +int cipher_encrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16], uint8_t nonce_len, const uint8_t *input, size_t length, uint8_t *output); @@ -68,7 +68,7 @@ int cipher_encrypt_ctr(cipher_t *cipher, uint8_t nonce_counter[16], * @return Length of decrypted data on a successful decryption * @return A negative error code if something went wrong */ -int cipher_decrypt_ctr(cipher_t *cipher, uint8_t nonce_counter[16], +int cipher_decrypt_ctr(const cipher_t *cipher, uint8_t nonce_counter[16], uint8_t nonce_len, const uint8_t *input, size_t length, uint8_t *output);