cryptosoft.c (123564) | cryptosoft.c (125330) |
---|---|
1/* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */ 2 3/* 4 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) 5 * 6 * This code was written by Angelos D. Keromytis in Athens, Greece, in 7 * February 2000. Network Security Technologies Inc. (NSTI) kindly 8 * supported the development of this code. --- 8 unchanged lines hidden (view full) --- 17 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 18 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY 19 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 20 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 21 * PURPOSE. 22 */ 23 24#include <sys/cdefs.h> | 1/* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */ 2 3/* 4 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) 5 * 6 * This code was written by Angelos D. Keromytis in Athens, Greece, in 7 * February 2000. Network Security Technologies Inc. (NSTI) kindly 8 * supported the development of this code. --- 8 unchanged lines hidden (view full) --- 17 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 18 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY 19 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 20 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 21 * PURPOSE. 22 */ 23 24#include <sys/cdefs.h> |
25__FBSDID("$FreeBSD: head/sys/opencrypto/cryptosoft.c 123564 2003-12-16 14:13:47Z bms $"); | 25__FBSDID("$FreeBSD: head/sys/opencrypto/cryptosoft.c 125330 2004-02-02 17:06:34Z phk $"); |
26 27#include <sys/param.h> 28#include <sys/systm.h> 29#include <sys/malloc.h> 30#include <sys/mbuf.h> 31#include <sys/sysctl.h> 32#include <sys/errno.h> 33#include <sys/random.h> --- 109 unchanged lines hidden (view full) --- 143 if (crd->crd_flags & CRD_F_IV_EXPLICIT) 144 bcopy(crd->crd_iv, iv, blks); 145 else { 146 /* Get IV off buf */ 147 COPYDATA(outtype, buf, crd->crd_inject, blks, iv); 148 } 149 } 150 | 26 27#include <sys/param.h> 28#include <sys/systm.h> 29#include <sys/malloc.h> 30#include <sys/mbuf.h> 31#include <sys/sysctl.h> 32#include <sys/errno.h> 33#include <sys/random.h> --- 109 unchanged lines hidden (view full) --- 143 if (crd->crd_flags & CRD_F_IV_EXPLICIT) 144 bcopy(crd->crd_iv, iv, blks); 145 else { 146 /* Get IV off buf */ 147 COPYDATA(outtype, buf, crd->crd_inject, blks, iv); 148 } 149 } 150 |
151 if (crd->crd_flags & CRD_F_KEY_EXPLICIT) { 152 int error; 153 154 if (sw->sw_kschedule) 155 exf->zerokey(&(sw->sw_kschedule)); 156 error = exf->setkey(&sw->sw_kschedule, 157 crd->crd_key, crd->crd_klen / 8); 158 if (error) 159 return (error); 160 } |
|
151 ivp = iv; 152 153 if (outtype == CRYPTO_BUF_CONTIG) { 154 if (crd->crd_flags & CRD_F_ENCRYPT) { 155 for (i = crd->crd_skip; 156 i < crd->crd_skip + crd->crd_len; i += blks) { 157 /* XOR with the IV/previous block, as appropriate. */ 158 if (i == crd->crd_skip) --- 862 unchanged lines hidden --- | 161 ivp = iv; 162 163 if (outtype == CRYPTO_BUF_CONTIG) { 164 if (crd->crd_flags & CRD_F_ENCRYPT) { 165 for (i = crd->crd_skip; 166 i < crd->crd_skip + crd->crd_len; i += blks) { 167 /* XOR with the IV/previous block, as appropriate. */ 168 if (i == crd->crd_skip) --- 862 unchanged lines hidden --- |