summaryrefslogtreecommitdiff
path: root/aes128-set-encrypt-key.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-06-25 21:40:49 +0200
committerNiels Möller <nisse@lysator.liu.se>2013-06-25 21:40:49 +0200
commitbb2131cbf83b57550d3af9d7c66e52c61db8cf60 (patch)
tree0a68cbb78048ef6b504c77e63b8a38ac6d1eb40b /aes128-set-encrypt-key.c
parentb27be3a688b814832b965b15680f9ccd053a0753 (diff)
downloadnettle-bb2131cbf83b57550d3af9d7c66e52c61db8cf60.tar.gz
New interface for AES-128.
Diffstat (limited to 'aes128-set-encrypt-key.c')
-rw-r--r--aes128-set-encrypt-key.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/aes128-set-encrypt-key.c b/aes128-set-encrypt-key.c
new file mode 100644
index 00000000..e9413cb7
--- /dev/null
+++ b/aes128-set-encrypt-key.c
@@ -0,0 +1,38 @@
+/* aes128-set-encrypt-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"
+
+void
+aes128_set_encrypt_key(struct aes128_ctx *ctx, const uint8_t *key)
+{
+ _aes_set_key (_AES128_ROUNDS, AES128_KEY_SIZE / 4, ctx->keys, key);
+}