mirror of
https://github.com/kokke/tiny-AES-c
synced 2024-11-22 13:31:22 +03:00
const'ify some parameters
This commit is contained in:
parent
7c959460a1
commit
15adafae4d
6
aes.c
6
aes.c
@ -434,7 +434,7 @@ static void InvCipher(void)
|
|||||||
AddRoundKey(0);
|
AddRoundKey(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BlockCopy(uint8_t* output, uint8_t* input)
|
static void BlockCopy(uint8_t* output, const uint8_t* input)
|
||||||
{
|
{
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
for (i=0;i<KEYLEN;++i)
|
for (i=0;i<KEYLEN;++i)
|
||||||
@ -451,7 +451,7 @@ static void BlockCopy(uint8_t* output, uint8_t* input)
|
|||||||
#if defined(ECB) && ECB
|
#if defined(ECB) && ECB
|
||||||
|
|
||||||
|
|
||||||
void AES128_ECB_encrypt(uint8_t* input, const uint8_t* key, uint8_t* output)
|
void AES128_ECB_encrypt(const uint8_t* input, const uint8_t* key, uint8_t* output)
|
||||||
{
|
{
|
||||||
// Copy input to output, and work in-memory on output
|
// Copy input to output, and work in-memory on output
|
||||||
BlockCopy(output, input);
|
BlockCopy(output, input);
|
||||||
@ -464,7 +464,7 @@ void AES128_ECB_encrypt(uint8_t* input, const uint8_t* key, uint8_t* output)
|
|||||||
Cipher();
|
Cipher();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AES128_ECB_decrypt(uint8_t* input, const uint8_t* key, uint8_t *output)
|
void AES128_ECB_decrypt(const uint8_t* input, const uint8_t* key, uint8_t *output)
|
||||||
{
|
{
|
||||||
// Copy input to output, and work in-memory on output
|
// Copy input to output, and work in-memory on output
|
||||||
BlockCopy(output, input);
|
BlockCopy(output, input);
|
||||||
|
4
aes.h
4
aes.h
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
#if defined(ECB) && ECB
|
#if defined(ECB) && ECB
|
||||||
|
|
||||||
void AES128_ECB_encrypt(uint8_t* input, const uint8_t* key, uint8_t *output);
|
void AES128_ECB_encrypt(const uint8_t* input, const uint8_t* key, uint8_t *output);
|
||||||
void AES128_ECB_decrypt(uint8_t* input, const uint8_t* key, uint8_t *output);
|
void AES128_ECB_decrypt(const uint8_t* input, const uint8_t* key, uint8_t *output);
|
||||||
|
|
||||||
#endif // #if defined(ECB) && ECB
|
#endif // #if defined(ECB) && ECB
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user