Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Tiny AES C
Commits
bfd5cc90
Unverified
Commit
bfd5cc90
authored
Dec 01, 2017
by
kokke
Committed by
GitHub
Dec 01, 2017
Browse files
Update aes.c
parent
1e9105ae
Changes
1
Show whitespace changes
Inline
Side-by-side
aes.c
View file @
bfd5cc90
...
@@ -600,11 +600,12 @@ void AES_CBC_decrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
...
@@ -600,11 +600,12 @@ void AES_CBC_decrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
#if defined(CTR) && (CTR == 1)
#if defined(CTR) && (CTR == 1)
void
AES_CTR_xcrypt_buffer
(
uint8_t
*
output
,
uint8_t
*
input
,
uint32_t
length
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
)
/* Symmetrical operation: same function for encrypting as for decrypting. Note any IV/nonce should never be reused with the same key */
void
AES_CTR_xcrypt_buffer
(
uint8_t
*
output
,
uint8_t
*
input
,
uint32_t
length
,
const
uint8_t
*
key
,
const
uint8_t
*
nonce
)
{
{
uint8_t
buffer
[
BLOCKLEN
],
counter
[
BLOCKLEN
];
uint8_t
buffer
[
BLOCKLEN
],
counter
[
BLOCKLEN
];
memcpy
(
counter
,
iv
,
BLOCKLEN
);
memcpy
(
counter
,
nonce
,
BLOCKLEN
);
Key
=
key
;
Key
=
key
;
KeyExpansion
();
KeyExpansion
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment