mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/crypto: CBC and ECB add const
This commit is contained in:
parent
be93529c89
commit
83d391f6b1
@ -22,7 +22,7 @@
|
||||
#include <string.h>
|
||||
#include "crypto/modes/cbc.h"
|
||||
|
||||
int cipher_encrypt_cbc(cipher_t *cipher, uint8_t iv[16],
|
||||
int cipher_encrypt_cbc(const cipher_t *cipher, uint8_t iv[16],
|
||||
const uint8_t *input, size_t length, uint8_t *output)
|
||||
{
|
||||
size_t offset = 0;
|
||||
@ -54,7 +54,7 @@ int cipher_encrypt_cbc(cipher_t *cipher, uint8_t iv[16],
|
||||
}
|
||||
|
||||
|
||||
int cipher_decrypt_cbc(cipher_t *cipher, uint8_t iv[16],
|
||||
int cipher_decrypt_cbc(const cipher_t *cipher, uint8_t iv[16],
|
||||
const uint8_t *input, size_t length, uint8_t *output)
|
||||
{
|
||||
size_t offset = 0;
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "crypto/modes/ecb.h"
|
||||
|
||||
int cipher_encrypt_ecb(cipher_t *cipher, uint8_t *input,
|
||||
int cipher_encrypt_ecb(const cipher_t *cipher, const uint8_t *input,
|
||||
size_t length, uint8_t *output)
|
||||
{
|
||||
size_t offset;
|
||||
@ -46,7 +46,7 @@ int cipher_encrypt_ecb(cipher_t *cipher, uint8_t *input,
|
||||
return offset;
|
||||
}
|
||||
|
||||
int cipher_decrypt_ecb(cipher_t *cipher, uint8_t *input,
|
||||
int cipher_decrypt_ecb(const cipher_t *cipher, const uint8_t *input,
|
||||
size_t length, uint8_t *output)
|
||||
{
|
||||
size_t offset = 0;
|
||||
|
@ -43,7 +43,7 @@ extern "C" {
|
||||
* @return CIPHER_ERR_ENC_FAILED on internal encryption error
|
||||
* @return otherwise number of input bytes that aren't consumed
|
||||
*/
|
||||
int cipher_encrypt_cbc(cipher_t *cipher, uint8_t iv[16], const uint8_t *input,
|
||||
int cipher_encrypt_cbc(const cipher_t *cipher, uint8_t iv[16], const uint8_t *input,
|
||||
size_t input_len, uint8_t *output);
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ int cipher_encrypt_cbc(cipher_t *cipher, uint8_t iv[16], const uint8_t *input,
|
||||
* @return CIPHER_ERR_DEC_FAILED on internal decryption error
|
||||
* @return otherwise number of bytes decrypted
|
||||
*/
|
||||
int cipher_decrypt_cbc(cipher_t *cipher, uint8_t iv[16], const uint8_t *input,
|
||||
int cipher_decrypt_cbc(const cipher_t *cipher, uint8_t iv[16], const uint8_t *input,
|
||||
size_t input_len, uint8_t *output);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -42,8 +42,8 @@ extern "C" {
|
||||
* @return A negative error code if something went wrong
|
||||
*
|
||||
*/
|
||||
int cipher_encrypt_ecb(cipher_t *cipher, uint8_t *input, size_t length,
|
||||
uint8_t *output);
|
||||
int cipher_encrypt_ecb(const cipher_t *cipher, const uint8_t *input,
|
||||
size_t length, uint8_t *output);
|
||||
|
||||
|
||||
/**
|
||||
@ -59,8 +59,8 @@ int cipher_encrypt_ecb(cipher_t *cipher, uint8_t *input, size_t length,
|
||||
* @return Length of decrypted data on a successful decryption
|
||||
* @return A negative error code if something went wrong
|
||||
*/
|
||||
int cipher_decrypt_ecb(cipher_t *cipher, uint8_t *input, size_t length,
|
||||
uint8_t *output);
|
||||
int cipher_decrypt_ecb(const cipher_t *cipher, const uint8_t *input,
|
||||
size_t length, uint8_t *output);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user