summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2002-03-05 21:12:41 +0000
committerume <ume@FreeBSD.org>2002-03-05 21:12:41 +0000
commit981ea9e4ae7d27031274dbdfe05bc47acc768b7c (patch)
treea25b95273cb0348a0890ce83076f794a164a5a5d /sys/netinet6
parente0782fc24bbe02997257820eca633c777e33d28d (diff)
downloadFreeBSD-src-981ea9e4ae7d27031274dbdfe05bc47acc768b7c.zip
FreeBSD-src-981ea9e4ae7d27031274dbdfe05bc47acc768b7c.tar.gz
- use des_ecb3_encrypt().
- style: added spaces after /* and before */ Obtained from: KAME MFC after: 2 weeks
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/esp_core.c20
1 files changed, 9 insertions, 11 deletions
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;
}
OpenPOWER on IntegriCloud