summaryrefslogtreecommitdiff
path: root/aes192-set-decrypt-key.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-06-25 22:19:36 +0200
committerNiels Möller <nisse@lysator.liu.se>2013-06-25 22:19:36 +0200
commitdc2227ac29e5fe56c445dd4499dadd1af0441750 (patch)
treebfbdd403c46c0e7b458f0b2abad6f2fa267c8b5a /aes192-set-decrypt-key.c
parentbb2131cbf83b57550d3af9d7c66e52c61db8cf60 (diff)
downloadnettle-dc2227ac29e5fe56c445dd4499dadd1af0441750.tar.gz
New interface for AES-192.
Diffstat (limited to 'aes192-set-decrypt-key.c')
-rw-r--r--aes192-set-decrypt-key.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/aes192-set-decrypt-key.c b/aes192-set-decrypt-key.c
new file mode 100644
index 00000000..496bee69
--- /dev/null
+++ b/aes192-set-decrypt-key.c
@@ -0,0 +1,46 @@
+/* aes192-set-decrypt-key.c
+ *
+ * Key setup for the aes/rijndael block cipher.
+ */
+
+/* nettle, low-level cryptographics library
+ *
+ * Copyright (C) 2013, Niels Möller
+ *
+ * The nettle library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * The nettle library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the nettle library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02111-1301, USA.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <assert.h>
+
+#include "aes-internal.h"
+#include "macros.h"
+
+void
+aes192_invert_key (struct aes192_ctx *dst, const struct aes192_ctx *src)
+{
+ _aes_invert (_AES192_ROUNDS, dst->keys, src->keys);
+}
+
+void
+aes192_set_decrypt_key(struct aes192_ctx *ctx, const uint8_t *key)
+{
+ aes192_set_encrypt_key (ctx, key);
+ aes192_invert_key (ctx, ctx);
+}