mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 14:48:57 +00:00
- use des_ecb3_encrypt().
- style: added spaces after /* and before */ Obtained from: KAME MFC after: 2 weeks
This commit is contained in:
parent
b5d8e72dc3
commit
d692f3fc1a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91713
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user