Deleted Added
full compact
g_bde_crypt.c (108558) g_bde_crypt.c (111964)
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/geom/bde/g_bde_crypt.c 108558 2003-01-02 19:29:49Z phk $
32 * $FreeBSD: head/sys/geom/bde/g_bde_crypt.c 111964 2003-03-07 19:09:46Z phk $
33 *
34 * This source file contains the functions responsible for the crypto, keying
35 * and mapping operations on the I/O requests.
36 *
37 */
38
39#include <sys/param.h>
40#include <sys/stdint.h>

--- 236 unchanged lines hidden (view full) ---

277 zone = wp->offset / kp->zone_cont;
278 zoff = wp->offset % kp->zone_cont;
279
280 /* Calculate the offset of the key in the key sector */
281 wp->ko = (zoff / kp->sectorsize) * G_BDE_SKEYLEN;
282
283 /* restrict length to that zone */
284 len = kp->zone_cont - zoff;
33 *
34 * This source file contains the functions responsible for the crypto, keying
35 * and mapping operations on the I/O requests.
36 *
37 */
38
39#include <sys/param.h>
40#include <sys/stdint.h>

--- 236 unchanged lines hidden (view full) ---

277 zone = wp->offset / kp->zone_cont;
278 zoff = wp->offset % kp->zone_cont;
279
280 /* Calculate the offset of the key in the key sector */
281 wp->ko = (zoff / kp->sectorsize) * G_BDE_SKEYLEN;
282
283 /* restrict length to that zone */
284 len = kp->zone_cont - zoff;
285
286 /* ... and in general */
287 if (len > DFLTPHYS)
288 len = DFLTPHYS;
289
285 if (len < wp->length)
286 wp->length = len;
287
288 /* Find physical sector address */
289 wp->so = zone * kp->zone_width + zoff;
290 wp->so += kp->keyoffset;
291 wp->so %= kp->media_width;
292 wp->so += kp->sector0;

--- 33 unchanged lines hidden ---
290 if (len < wp->length)
291 wp->length = len;
292
293 /* Find physical sector address */
294 wp->so = zone * kp->zone_width + zoff;
295 wp->so += kp->keyoffset;
296 wp->so %= kp->media_width;
297 wp->so += kp->sector0;

--- 33 unchanged lines hidden ---