summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1997-06-20 19:43:07 +0000
committerNiels Provos <provos@cvs.openbsd.org>1997-06-20 19:43:07 +0000
commit8d7d36441495f89d504bb4069d7ba0b456900a8e (patch)
tree7001e455814c9650f7fa6f45f0e727f75463b36c /sys
parentbe697c38e2b00aa93e4d9e62e7a760b0ef41372d (diff)
comply with draft 3des mode is ede not eee + performance.
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_esp3des.c16
-rw-r--r--sys/netinet/ip_esp3desmd5.c22
2 files changed, 16 insertions, 22 deletions
diff --git a/sys/netinet/ip_esp3des.c b/sys/netinet/ip_esp3des.c
index a3cdbecdd2c..a1e3374fec8 100644
--- a/sys/netinet/ip_esp3des.c
+++ b/sys/netinet/ip_esp3des.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp3des.c,v 1.1 1997/06/20 05:41:50 provos Exp $ */
+/* $OpenBSD: ip_esp3des.c,v 1.2 1997/06/20 19:43:05 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -62,7 +62,7 @@
extern struct ifnet loif;
-extern void des_ecb_encrypt(caddr_t, caddr_t, caddr_t, int);
+extern void des_ecb3_encrypt(caddr_t, caddr_t, caddr_t, caddr_t, caddr_t, int);
extern void des_set_key(caddr_t, caddr_t);
@@ -247,9 +247,9 @@ esp3des_input(struct mbuf *m, struct tdb *tdb)
if (i == 8)
{
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[0]), 0);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[1]), 0);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[2]), 0);
+ des_ecb3_encrypt(blk, blk, (caddr_t)(xd->edx_eks[2]),
+ (caddr_t)(xd->edx_eks[1]),
+ (caddr_t)(xd->edx_eks[0]), 0);
for (i=0; i<8; i++)
{
while (olen == 0)
@@ -387,9 +387,9 @@ esp3des_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, struc
if (i == 8)
{
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[2]), 1);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[1]), 1);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[0]), 1);
+ des_ecb3_encrypt(blk, blk, (caddr_t)(xd->edx_eks[0]),
+ (caddr_t)(xd->edx_eks[1]),
+ (caddr_t)(xd->edx_eks[2]), 1);
for (i=0; i<8; i++)
{
while (olen == 0)
diff --git a/sys/netinet/ip_esp3desmd5.c b/sys/netinet/ip_esp3desmd5.c
index 7a52dd4f46e..ced12fb5a75 100644
--- a/sys/netinet/ip_esp3desmd5.c
+++ b/sys/netinet/ip_esp3desmd5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp3desmd5.c,v 1.5 1997/06/20 05:41:51 provos Exp $ */
+/* $OpenBSD: ip_esp3desmd5.c,v 1.6 1997/06/20 19:43:06 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -60,7 +60,7 @@
extern struct ifnet loif;
-extern void des_ecb_encrypt(caddr_t, caddr_t, caddr_t, int);
+extern void des_ecb3_encrypt(caddr_t, caddr_t, caddr_t, caddr_t, caddr_t, int);
extern void des_set_key(caddr_t, caddr_t);
int
@@ -358,12 +358,9 @@ esp3desmd5_input(struct mbuf *m, struct tdb *tdb)
if (i == 8)
{
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[2]),
- 0);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[1]),
- 0);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[0]),
- 0);
+ des_ecb3_encrypt(blk, blk, (caddr_t)(xd->edx_eks[2]),
+ (caddr_t)(xd->edx_eks[1]),
+ (caddr_t)(xd->edx_eks[0]), 0);
for (i=0; i<8; i++)
{
while (olen == 0)
@@ -711,12 +708,9 @@ esp3desmd5_output(struct mbuf *m, struct sockaddr_encap *gw, struct tdb *tdb, st
if (i == 8) /* We have full block */
{
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[0]),
- 1);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[1]),
- 1);
- des_ecb_encrypt(blk, blk, (caddr_t)(xd->edx_eks[2]),
- 1);
+ des_ecb3_encrypt(blk, blk, (caddr_t)(xd->edx_eks[0]),
+ (caddr_t)(xd->edx_eks[1]),
+ (caddr_t)(xd->edx_eks[2]), 1);
for (i=0; i<8; i++)
{
while (olen == 0)