mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-22 04:21:08 +00:00
Misc cleanup after API change.
This commit is contained in:
parent
c2f4fa524f
commit
d383e7ab62
4 changed files with 6 additions and 14 deletions
|
@ -585,18 +585,6 @@ aes_init(aes_ctx *ctx, cipher_mode mode, const uint8_t *key, size_t keylen)
|
||||||
aes_setkey_enc(ctx, key, keylen);
|
aes_setkey_enc(ctx, key, keylen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
aes_update(aes_ctx *ctx, const void *in, size_t len, void *out)
|
|
||||||
{
|
|
||||||
|
|
||||||
(void)len;
|
|
||||||
if (ctx->mode == CIPHER_MODE_DECRYPT)
|
|
||||||
aes_dec(ctx, in, out);
|
|
||||||
else
|
|
||||||
aes_enc(ctx, in, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
aes_encrypt(aes_ctx *ctx, const void *vpt, uint8_t *ct, size_t len)
|
aes_encrypt(aes_ctx *ctx, const void *vpt, uint8_t *ct, size_t len)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,10 +95,10 @@ rc4_encrypt(rc4_ctx *ctx, const void *vpt, uint8_t *ct, size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
rc4_decrypt(rc4_ctx *ctx, const uint8_t *in, void *out, size_t len)
|
rc4_decrypt(rc4_ctx *ctx, const uint8_t *ct, void *vpt, size_t len)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (rc4_encrypt(ctx, in, out, len));
|
return (rc4_encrypt(ctx, ct, vpt, len));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -49,6 +49,7 @@ struct t_case {
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Test cases
|
* Test cases
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct t_case t_cases[] = {
|
static struct t_case t_cases[] = {
|
||||||
/* FIPS-197 test vectors */
|
/* FIPS-197 test vectors */
|
||||||
{
|
{
|
||||||
|
@ -107,6 +108,7 @@ static struct t_case t_cases[] = {
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Test functions
|
* Test functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
t_aes_enc(char **desc, void *arg)
|
t_aes_enc(char **desc, void *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct t_case {
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Test cases
|
* Test cases
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct t_case t_cases[] = {
|
static struct t_case t_cases[] = {
|
||||||
/* test vectors from RFC 6229 */
|
/* test vectors from RFC 6229 */
|
||||||
{
|
{
|
||||||
|
@ -1962,6 +1963,7 @@ static struct t_case t_cases[] = {
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Test functions
|
* Test functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
t_rc4(char **desc CRYB_UNUSED, void *arg)
|
t_rc4(char **desc CRYB_UNUSED, void *arg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue