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
38b0f113
Commit
38b0f113
authored
Dec 15, 2014
by
kokke
Browse files
Update aes.h
parent
d9c9ad2f
Changes
1
Show whitespace changes
Inline
Side-by-side
aes.h
View file @
38b0f113
...
...
@@ -3,7 +3,38 @@
#include <stdint.h>
// #define the macros below to 1/0 to enable/disable the mode of operation.
//
// CBC enables AES128 encryption in CBC-mode of operation and handles 0-padding.
// ECB enables the basic ECB 16-byte block algorithm. Both can be enabled simultaneously.
// The #ifndef-guard allows it to be configured before #include'ing or at compile time.
#ifndef CBC
#define CBC 1
#endif
#ifndef ECB
#define ECB 1
#endif
#if defined(ECB) && ECB
void
AES128_ECB_encrypt
(
uint8_t
*
input
,
const
uint8_t
*
key
,
uint8_t
*
output
);
void
AES128_ECB_decrypt
(
uint8_t
*
input
,
const
uint8_t
*
key
,
uint8_t
*
output
);
#endif // #if defined(ECB) && ECB
#if defined(CBC) && CBC
void
AES128_CBC_encrypt_buffer
(
uint8_t
*
output
,
uint8_t
*
input
,
uint32_t
length
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
);
void
AES128_CBC_decrypt_buffer
(
uint8_t
*
output
,
uint8_t
*
input
,
uint32_t
length
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
);
#endif // #if defined(CBC) && CBC
#endif //_AES_H_
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