From 981ea9e4ae7d27031274dbdfe05bc47acc768b7c Mon Sep 17 00:00:00 2001 From: ume Date: Tue, 5 Mar 2002 21:12:41 +0000 Subject: - use des_ecb3_encrypt(). - style: added spaces after /* and before */ Obtained from: KAME MFC after: 2 weeks --- sys/netinet6/esp_core.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/esp_core.c b/sys/netinet6/esp_core.c index e006b60..54ca346 100644 --- a/sys/netinet6/esp_core.c +++ b/sys/netinet6/esp_core.c @@ -592,9 +592,8 @@ esp_3des_blockdecrypt(algo, sav, s, d) /* assumption: d has a good alignment */ p = (des_key_schedule *)sav->sched; bcopy(s, d, sizeof(DES_LONG) * 2); - des_ecb_encrypt((des_cblock *)d, (des_cblock *)d, p[2], DES_DECRYPT); - des_ecb_encrypt((des_cblock *)d, (des_cblock *)d, p[1], DES_ENCRYPT); - des_ecb_encrypt((des_cblock *)d, (des_cblock *)d, p[0], DES_DECRYPT); + des_ecb3_encrypt((des_cblock *)d, (des_cblock *)d, + p[0], p[1], p[2], DES_DECRYPT); return 0; } @@ -610,9 +609,8 @@ esp_3des_blockencrypt(algo, sav, s, d) /* assumption: d has a good alignment */ p = (des_key_schedule *)sav->sched; bcopy(s, d, sizeof(DES_LONG) * 2); - des_ecb_encrypt((des_cblock *)d, (des_cblock *)d, p[0], DES_ENCRYPT); - des_ecb_encrypt((des_cblock *)d, (des_cblock *)d, p[1], DES_DECRYPT); - des_ecb_encrypt((des_cblock *)d, (des_cblock *)d, p[2], DES_ENCRYPT); + des_ecb3_encrypt((des_cblock *)d, (des_cblock *)d, + p[0], p[1], p[2], DES_ENCRYPT); return 0; } @@ -637,8 +635,8 @@ esp_cbc_decrypt(m, off, sav, algo, ivlen) { struct mbuf *s; struct mbuf *d, *d0, *dp; - int soff, doff; /*offset from the head of chain, to head of this mbuf */ - int sn, dn; /*offset from the head of the mbuf, to meat */ + int soff, doff; /* offset from the head of chain, to head of this mbuf */ + int sn, dn; /* offset from the head of the mbuf, to meat */ size_t ivoff, bodyoff; u_int8_t iv[MAXIVLEN], *ivp; u_int8_t sbuf[MAXIVLEN], *sp; @@ -841,8 +839,8 @@ esp_cbc_encrypt(m, off, plen, sav, algo, ivlen) { struct mbuf *s; struct mbuf *d, *d0, *dp; - int soff, doff; /*offset from the head of chain, to head of this mbuf */ - int sn, dn; /*offset from the head of the mbuf, to meat */ + int soff, doff; /* offset from the head of chain, to head of this mbuf */ + int sn, dn; /* offset from the head of the mbuf, to meat */ size_t ivoff, bodyoff; u_int8_t iv[MAXIVLEN], *ivp; u_int8_t sbuf[MAXIVLEN], *sp; @@ -1132,7 +1130,7 @@ esp_auth(m0, skip, length, sav, sum) } } (*algo->result)(&s, sumbuf); - bcopy(sumbuf, sum, siz); /*XXX*/ + bcopy(sumbuf, sum, siz); /* XXX */ return 0; } -- cgit v1.1