diff --git a/ChangeLog b/ChangeLog
index 1306b308b13366f8f668239f90cd7a6e5ac182c5..31a3dd4f52ff98f5208693632f831afcac0f7805 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,8 @@
 	* testsuite/aes-test.c (test_cipher2): New function.
 	(test_main): Test both nettle_aes128 and nettle_unified_aes128.
 
+	Analogous changes för aes192.
+
 2013-05-22  Niels Möller  <nisse@lysator.liu.se>
 
 	* Makefile.in (nettle_SOURCES): Added aes-invert-internal.c and
diff --git a/Makefile.in b/Makefile.in
index 99eb564fc4eda622b933fe622f6a119a2fe3781b..e803c328118f24e06c59c6a1dc11f97a9e1a9705 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -67,6 +67,8 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
 		 aes-set-encrypt-key.c aes-set-decrypt-key.c aes-meta.c \
 		 aes128-set-encrypt-key.c aes128-set-decrypt-key.c \
 		 aes128-meta.c \
+		 aes192-set-encrypt-key.c aes192-set-decrypt-key.c \
+		 aes192-meta.c \
 		 arcfour.c arcfour-crypt.c arcfour-meta.c \
 		 arctwo.c arctwo-meta.c gosthash94-meta.c \
 		 base16-encode.c base16-decode.c base16-meta.c \
diff --git a/aes-decrypt.c b/aes-decrypt.c
index e8696bf536aca8e0166a58b68c767d76a1528144..9ea0e23897164d9fdb06c32307197da0e2c0c3a0 100644
--- a/aes-decrypt.c
+++ b/aes-decrypt.c
@@ -355,3 +355,13 @@ aes128_decrypt(const struct aes128_ctx *ctx,
   _aes_decrypt(_AES128_ROUNDS, ctx->keys, &_aes_decrypt_table,
 	       length, dst, src);
 }
+
+void
+aes192_decrypt(const struct aes192_ctx *ctx,
+	       size_t length, uint8_t *dst,
+	       const uint8_t *src)
+{
+  assert(!(length % AES_BLOCK_SIZE) );
+  _aes_decrypt(_AES192_ROUNDS, ctx->keys, &_aes_decrypt_table,
+	       length, dst, src);
+}
diff --git a/aes-encrypt.c b/aes-encrypt.c
index 643276afef3e36dadd9bb2b09a93baba911a8c9a..c4e3713e6add142b7ea9d7da6c43b28a7ddba636 100644
--- a/aes-encrypt.c
+++ b/aes-encrypt.c
@@ -53,3 +53,13 @@ aes128_encrypt(const struct aes128_ctx *ctx,
   _aes_encrypt(_AES128_ROUNDS, ctx->keys, &_aes_encrypt_table,
 	       length, dst, src);
 }
+
+void
+aes192_encrypt(const struct aes192_ctx *ctx,
+	       size_t length, uint8_t *dst,
+	       const uint8_t *src)
+{
+  assert(!(length % AES_BLOCK_SIZE) );
+  _aes_encrypt(_AES192_ROUNDS, ctx->keys, &_aes_encrypt_table,
+	       length, dst, src);
+}
diff --git a/aes-meta.c b/aes-meta.c
index 3db85f672575a012541b1d808ccbdab380ed6c39..6bce5a4226dbf869397596fe163cfeaec0e86da9 100644
--- a/aes-meta.c
+++ b/aes-meta.c
@@ -28,8 +28,5 @@
 
 #include "aes.h"
 
-const struct nettle_cipher nettle_aes192
-= _NETTLE_CIPHER_SEP(aes, AES, 192);
-
 const struct nettle_cipher nettle_aes256
 = _NETTLE_CIPHER_SEP(aes, AES, 256);
diff --git a/aes.h b/aes.h
index 74b3fd67b9cf59bd1063b51b21b9fea99d31755e..ca9976e55a5be6da2853d74414ebad2cfeab91f7 100644
--- a/aes.h
+++ b/aes.h
@@ -5,7 +5,7 @@
 
 /* nettle, low-level cryptographics library
  *
- * Copyright (C) 2001 Niels Möller
+ * Copyright (C) 2001, 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
@@ -43,6 +43,11 @@ extern "C" {
 #define aes128_invert_key nettle_aes128invert_key
 #define aes128_encrypt nettle_aes128encrypt
 #define aes128_decrypt nettle_aes128decrypt
+#define aes192_set_encrypt_key nettle_aes192set_encrypt_key
+#define aes192_set_decrypt_key nettle_aes192set_decrypt_key
+#define aes192_invert_key nettle_aes192invert_key
+#define aes192_encrypt nettle_aes192encrypt
+#define aes192_decrypt nettle_aes192decrypt
 
 #define AES_BLOCK_SIZE 16
 
@@ -110,6 +115,27 @@ aes128_decrypt(const struct aes128_ctx *ctx,
 	       size_t length, uint8_t *dst,
 	       const uint8_t *src);
 
+struct aes192_ctx
+{
+  uint32_t keys[4 * (_AES192_ROUNDS + 1)];
+};
+
+void
+aes192_set_encrypt_key(struct aes192_ctx *ctx, const uint8_t *key);
+void
+aes192_set_decrypt_key(struct aes192_ctx *ctx, const uint8_t *key);
+void
+aes192_invert_key(struct aes192_ctx *dst,
+		  const struct aes192_ctx *src);
+void
+aes192_encrypt(const struct aes192_ctx *ctx,
+	       size_t length, uint8_t *dst,
+	       const uint8_t *src);
+void
+aes192_decrypt(const struct aes192_ctx *ctx,
+	       size_t length, uint8_t *dst,
+	       const uint8_t *src);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/aes192-meta.c b/aes192-meta.c
new file mode 100644
index 0000000000000000000000000000000000000000..0ee0c1aa2974ffff4fcf6e4a67a4fd1b964dc3e7
--- /dev/null
+++ b/aes192-meta.c
@@ -0,0 +1,57 @@
+/* aes192-meta.c */
+
+/* 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 "nettle-meta.h"
+
+#include "aes.h"
+
+static nettle_set_key_func aes192_set_encrypt_key_wrapper;
+static nettle_set_key_func aes192_set_decrypt_key_wrapper;
+
+static void
+aes192_set_encrypt_key_wrapper (void *ctx, size_t length, const uint8_t *key)
+{
+  assert (length == AES192_KEY_SIZE);
+  aes192_set_encrypt_key (ctx, key);
+}
+
+static void
+aes192_set_decrypt_key_wrapper (void *ctx, size_t length, const uint8_t *key)
+{
+  assert (length == AES192_KEY_SIZE);
+  aes192_set_decrypt_key (ctx, key);
+}
+
+const struct nettle_cipher nettle_aes192 =
+  { "aes192", sizeof(struct aes192_ctx),
+    AES_BLOCK_SIZE, AES192_KEY_SIZE,
+    aes192_set_encrypt_key_wrapper,
+    aes192_set_decrypt_key_wrapper,
+    (nettle_crypt_func *) aes192_encrypt,
+    (nettle_crypt_func *) aes192_decrypt
+  };
diff --git a/aes192-set-decrypt-key.c b/aes192-set-decrypt-key.c
new file mode 100644
index 0000000000000000000000000000000000000000..496bee69429af02d6eca1fd5d643908f31e3471d
--- /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);
+}
diff --git a/aes192-set-encrypt-key.c b/aes192-set-encrypt-key.c
new file mode 100644
index 0000000000000000000000000000000000000000..53bf36787b1ba4f9d57e147c5ee256c97a7b9ca8
--- /dev/null
+++ b/aes192-set-encrypt-key.c
@@ -0,0 +1,38 @@
+/* aes192-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
+aes192_set_encrypt_key(struct aes192_ctx *ctx, const uint8_t *key)
+{
+  _aes_set_key (_AES192_ROUNDS, AES192_KEY_SIZE / 4, ctx->keys, key);
+}
diff --git a/nettle-internal.c b/nettle-internal.c
index e5a7271df54c7bfc60719e0ae93efc0ae099fd62..e258eb44c5cdc101383676e0ffcd568eb79a9c92 100644
--- a/nettle-internal.c
+++ b/nettle-internal.c
@@ -117,3 +117,5 @@ nettle_gcm_aes256 = _NETTLE_AEAD(gcm, GCM, aes, 256);
 const struct nettle_cipher nettle_unified_aes128
 = _NETTLE_CIPHER_SEP(aes, AES, 128);
 
+const struct nettle_cipher nettle_unified_aes192
+= _NETTLE_CIPHER_SEP(aes, AES, 192);
diff --git a/nettle-internal.h b/nettle-internal.h
index ec26fe3cba00039bb58792849ba81356d06b7afe..651ff4c01416c2d77785b0407d8f4e43f545eabc 100644
--- a/nettle-internal.h
+++ b/nettle-internal.h
@@ -65,6 +65,7 @@ extern const struct nettle_cipher nettle_salsa20;
 extern const struct nettle_cipher nettle_salsa20r12;
 
 extern const struct nettle_cipher nettle_unified_aes128;
+extern const struct nettle_cipher nettle_unified_aes192;
 
 /* Glue to openssl, for comparative benchmarking. Code in
  * examples/nettle-openssl.c. */
diff --git a/testsuite/aes-test.c b/testsuite/aes-test.c
index 1304e8b05a93161409ab46b188a8110dcffe950f..14e20e4ef1fc4246b5ef122034036582fe22340b 100644
--- a/testsuite/aes-test.c
+++ b/testsuite/aes-test.c
@@ -84,15 +84,13 @@ test_main(void)
 	       SHEX("CE52AF650D088CA5 59425223F4D32694"));
 
   /* 192 bit keys */
-  
-  test_cipher(&nettle_aes192, 
-	      SHEX("0001020305060708 0A0B0C0D0F101112"
-		   "14151617191A1B1C"),
-	      SHEX("2D33EEF2C0430A8A 9EBF45E809C40BB6"),
-	      SHEX("DFF4945E0336DF4C 1C56BC700EFF837F"));
+  test_cipher2(&nettle_aes192, &nettle_unified_aes192, 
+	       SHEX("0001020305060708 0A0B0C0D0F101112"
+		    "14151617191A1B1C"),
+	       SHEX("2D33EEF2C0430A8A 9EBF45E809C40BB6"),
+	       SHEX("DFF4945E0336DF4C 1C56BC700EFF837F"));
 
-  /* 256 bit keys */
-  
+  /* 256 bit keys */  
   test_cipher(&nettle_aes256,
 	      SHEX("0001020305060708 0A0B0C0D0F101112"
 		   "14151617191A1B1C 1E1F202123242526"),
@@ -131,16 +129,16 @@ test_main(void)
 
   /* F.1.3 ECB-AES192-Encrypt */
 
-  test_cipher(&nettle_aes192,
-	      SHEX("8e73b0f7da0e6452c810f32b809079e5 62f8ead2522c6b7b"),
-	      SHEX("6bc1bee22e409f96e93d7e117393172a"
-		   "ae2d8a571e03ac9c9eb76fac45af8e51"
-		   "30c81c46a35ce411e5fbc1191a0a52ef"
-		   "f69f2445df4f9b17ad2b417be66c3710"),
-	      SHEX("bd334f1d6e45f25ff712a214571fa5cc"
-		   "974104846d0ad3ad7734ecb3ecee4eef"
-		   "ef7afd2270e2e60adce0ba2face6444e"
-		   "9a4b41ba738d6c72fb16691603c18e0e"));
+  test_cipher2(&nettle_aes192, &nettle_unified_aes192, 
+	       SHEX("8e73b0f7da0e6452c810f32b809079e5 62f8ead2522c6b7b"),
+	       SHEX("6bc1bee22e409f96e93d7e117393172a"
+		    "ae2d8a571e03ac9c9eb76fac45af8e51"
+		    "30c81c46a35ce411e5fbc1191a0a52ef"
+		    "f69f2445df4f9b17ad2b417be66c3710"),
+	       SHEX("bd334f1d6e45f25ff712a214571fa5cc"
+		    "974104846d0ad3ad7734ecb3ecee4eef"
+		    "ef7afd2270e2e60adce0ba2face6444e"
+		    "9a4b41ba738d6c72fb16691603c18e0e"));
 
   /* F.1.5 ECB-AES256-Encrypt */
   test_cipher(&nettle_aes256,