-/* $OpenBSD: aestest.c,v 1.3 2015/10/23 18:44:15 mmcc Exp $ */
+/* $OpenBSD: aestest.c,v 1.4 2017/04/30 21:34:45 mikeb Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*/
#include <sys/param.h>
-#include <crypto/rijndael.h>
+#include <crypto/aes.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
docrypt(const unsigned char *key, size_t klen, const unsigned char *in,
unsigned char *out, size_t len, int do_encrypt)
{
- rijndael_ctx ctx;
+ AES_CTX ctx;
int error = 0;
memset(&ctx, 0, sizeof(ctx));
- error = rijndael_set_key(&ctx, key, klen * 8);
+ error = AES_Setkey(&ctx, key, klen);
if (error)
return -1;
if (do_encrypt)
- rijndael_encrypt(&ctx, in, out);
+ AES_Encrypt(&ctx, in, out);
else
- rijndael_decrypt(&ctx, in, out);
+ AES_Decrypt(&ctx, in, out);
return 0;
}