diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-05-02 11:47:50 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-05-02 11:47:50 +0000 |
commit | 7cb03c93b85dea174cebb59cfeb51b87d0721c75 (patch) | |
tree | bac822b28f66a437419e3ac054a4d321da606c8b /sys | |
parent | 810ec2d6b6437fb122a10269267d4fe60503cb4b (diff) |
Switch glxsb(4), VIA padlock and AES-NI drivers over to the new AES
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/aesni.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/via.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/via.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/pci/glxsb.c | 6 | ||||
-rw-r--r-- | sys/crypto/aes.h | 2 |
5 files changed, 15 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/aesni.c b/sys/arch/amd64/amd64/aesni.c index dd8dbfd3ed9..b744aaf343d 100644 --- a/sys/arch/amd64/amd64/aesni.c +++ b/sys/arch/amd64/amd64/aesni.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aesni.c,v 1.40 2017/02/07 17:25:45 patrick Exp $ */ +/* $OpenBSD: aesni.c,v 1.41 2017/05/02 11:47:49 mikeb Exp $ */ /*- * Copyright (c) 2003 Jason Wright * Copyright (c) 2003, 2004 Theo de Raadt @@ -28,7 +28,7 @@ #include <sys/mbuf.h> #include <crypto/cryptodev.h> -#include <crypto/rijndael.h> +#include <crypto/aes.h> #include <crypto/gmac.h> #include <crypto/xform.h> #include <crypto/cryptosoft.h> diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c index 53cfe1813f5..35d467eed4c 100644 --- a/sys/arch/amd64/amd64/via.c +++ b/sys/arch/amd64/amd64/via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: via.c,v 1.22 2017/02/07 17:25:45 patrick Exp $ */ +/* $OpenBSD: via.c,v 1.23 2017/05/02 11:47:49 mikeb Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -36,7 +36,7 @@ #ifdef CRYPTO #include <crypto/cryptodev.h> -#include <crypto/rijndael.h> +#include <crypto/aes.h> #include <crypto/xform.h> #include <crypto/cryptosoft.h> #endif @@ -194,9 +194,9 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri) ses->ses_cw0 = cw0; /* Build expanded keys for both directions */ - rijndaelKeySetupEnc(ses->ses_ekey, c->cri_key, + AES_KeySetup_Encrypt(ses->ses_ekey, c->cri_key, c->cri_klen); - rijndaelKeySetupDec(ses->ses_dkey, c->cri_key, + AES_KeySetup_Decrypt(ses->ses_dkey, c->cri_key, c->cri_klen); for (i = 0; i < 4 * (AES_MAXROUNDS + 1); i++) { ses->ses_ekey[i] = ntohl(ses->ses_ekey[i]); diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c index 2765dc596ec..3fac9abf5cb 100644 --- a/sys/arch/i386/i386/via.c +++ b/sys/arch/i386/i386/via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: via.c,v 1.36 2017/02/07 17:25:45 patrick Exp $ */ +/* $OpenBSD: via.c,v 1.37 2017/05/02 11:47:49 mikeb Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -36,7 +36,7 @@ #ifdef CRYPTO #include <crypto/cryptodev.h> -#include <crypto/rijndael.h> +#include <crypto/aes.h> #include <crypto/xform.h> #include <crypto/cryptosoft.h> #endif @@ -197,9 +197,9 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri) ses->ses_cw0 = cw0; /* Build expanded keys for both directions */ - rijndaelKeySetupEnc(ses->ses_ekey, c->cri_key, + AES_KeySetup_Encrypt(ses->ses_ekey, c->cri_key, c->cri_klen); - rijndaelKeySetupDec(ses->ses_dkey, c->cri_key, + AES_KeySetup_Decrypt(ses->ses_dkey, c->cri_key, c->cri_klen); for (i = 0; i < 4 * (AES_MAXROUNDS + 1); i++) { ses->ses_ekey[i] = ntohl(ses->ses_ekey[i]); diff --git a/sys/arch/i386/pci/glxsb.c b/sys/arch/i386/pci/glxsb.c index 21786ab4ece..6792e9c99d0 100644 --- a/sys/arch/i386/pci/glxsb.c +++ b/sys/arch/i386/pci/glxsb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxsb.c,v 1.31 2017/02/07 17:25:45 patrick Exp $ */ +/* $OpenBSD: glxsb.c,v 1.32 2017/05/02 11:47:49 mikeb Exp $ */ /* * Copyright (c) 2006 Tom Cosgrove <tom@openbsd.org> @@ -40,7 +40,7 @@ #ifdef CRYPTO #include <crypto/cryptodev.h> -#include <crypto/rijndael.h> +#include <crypto/aes.h> #include <crypto/xform.h> #include <crypto/cryptosoft.h> #endif @@ -406,7 +406,7 @@ glxsb_crypto_newsession(uint32_t *sidp, struct cryptoini *cri) return (ENOMEM); } ses->ses_swd_enc = swd; - txf = &enc_xform_rijndael128; + txf = &enc_xform_aes; if (txf->ctxsize > 0) { swd->sw_kschedule = malloc(txf->ctxsize, diff --git a/sys/crypto/aes.h b/sys/crypto/aes.h index f3885c773ef..a670a2b522c 100644 --- a/sys/crypto/aes.h +++ b/sys/crypto/aes.h @@ -26,6 +26,8 @@ #ifndef _AES_H_ #define _AES_H_ +#define AES_MAXROUNDS (14) + typedef struct aes_ctx { uint32_t sk[60]; uint32_t sk_exp[120]; |