summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
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