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
61fa5c1d
Unverified
Commit
61fa5c1d
authored
Feb 01, 2018
by
kokke
Committed by
GitHub
Feb 01, 2018
Browse files
Merge pull request #89 from nickaknudson/master
CTR-only mode still needs functions to update counter (iv)
parents
ddd84d37
08497428
Changes
2
Hide whitespace changes
Inline
Side-by-side
aes.c
View file @
61fa5c1d
...
@@ -226,7 +226,7 @@ void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key)
...
@@ -226,7 +226,7 @@ void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key)
{
{
KeyExpansion
(
ctx
->
RoundKey
,
key
);
KeyExpansion
(
ctx
->
RoundKey
,
key
);
}
}
#if defined(CBC) && (CBC == 1)
#if
(
defined(CBC) && (CBC == 1)
) || (defined(CTR) && (CTR == 1))
void
AES_init_ctx_iv
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
)
void
AES_init_ctx_iv
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
)
{
{
KeyExpansion
(
ctx
->
RoundKey
,
key
);
KeyExpansion
(
ctx
->
RoundKey
,
key
);
...
...
aes.h
View file @
61fa5c1d
...
@@ -49,7 +49,7 @@ struct AES_ctx
...
@@ -49,7 +49,7 @@ struct AES_ctx
};
};
void
AES_init_ctx
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
key
);
void
AES_init_ctx
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
key
);
#if defined(CBC) && (CBC == 1)
#if
(
defined(CBC) && (CBC == 1)
) || (defined(CTR) && (CTR == 1))
void
AES_init_ctx_iv
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
);
void
AES_init_ctx_iv
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
);
void
AES_ctx_set_iv
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
iv
);
void
AES_ctx_set_iv
(
struct
AES_ctx
*
ctx
,
const
uint8_t
*
iv
);
#endif
#endif
...
...
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