diff --git a/sys/netinet6/esp_core.c b/sys/netinet6/esp_core.c index 9b2132debaed..102ff45357c1 100644 --- a/sys/netinet6/esp_core.c +++ b/sys/netinet6/esp_core.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp_core.c,v 1.32 2003/08/26 16:37:37 thorpej Exp $ */ +/* $NetBSD: esp_core.c,v 1.33 2003/08/27 00:08:31 thorpej Exp $ */ /* $KAME: esp_core.c,v 1.53 2001/11/27 09:47:30 sakane Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esp_core.c,v 1.32 2003/08/26 16:37:37 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esp_core.c,v 1.33 2003/08/27 00:08:31 thorpej Exp $"); #include "opt_inet.h" @@ -481,16 +481,8 @@ esp_blowfish_blockdecrypt(algo, sav, s, d) u_int8_t *s; u_int8_t *d; { - /* HOLY COW! BF_decrypt() takes values in host byteorder */ - BF_LONG t[2]; - bcopy(s, t, sizeof(t)); - t[0] = ntohl(t[0]); - t[1] = ntohl(t[1]); - BF_decrypt(t, (BF_KEY *)sav->sched); - t[0] = htonl(t[0]); - t[1] = htonl(t[1]); - bcopy(t, d, sizeof(t)); + BF_ecb_encrypt(s, d, (BF_KEY *)sav->sched, 0); return 0; } @@ -501,16 +493,8 @@ esp_blowfish_blockencrypt(algo, sav, s, d) u_int8_t *s; u_int8_t *d; { - /* HOLY COW! BF_encrypt() takes values in host byteorder */ - BF_LONG t[2]; - bcopy(s, t, sizeof(t)); - t[0] = ntohl(t[0]); - t[1] = ntohl(t[1]); - BF_encrypt(t, (BF_KEY *)sav->sched); - t[0] = htonl(t[0]); - t[1] = htonl(t[1]); - bcopy(t, d, sizeof(t)); + BF_ecb_encrypt(s, d, (BF_KEY *)sav->sched, 1); return 0; }