g_eli_integrity.c (213067) | g_eli_integrity.c (213070) |
---|---|
1/*- 2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/geom/eli/g_eli_integrity.c 213067 2010-09-23 11:49:47Z pjd $"); | 28__FBSDID("$FreeBSD: head/sys/geom/eli/g_eli_integrity.c 213070 2010-09-23 11:58:36Z pjd $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/linker.h> 34#include <sys/module.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> --- 467 unchanged lines hidden (view full) --- 504 crde->crd_skip = sc->sc_alen; 505 crde->crd_len = data_secsize; 506 crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; 507 if (bp->bio_cmd == BIO_WRITE) 508 crde->crd_flags |= CRD_F_ENCRYPT; 509 crde->crd_alg = sc->sc_ealgo; 510 crde->crd_key = g_eli_crypto_key(sc, dstoff, encr_secsize); 511 crde->crd_klen = sc->sc_ekeylen; | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/linker.h> 34#include <sys/module.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> --- 467 unchanged lines hidden (view full) --- 504 crde->crd_skip = sc->sc_alen; 505 crde->crd_len = data_secsize; 506 crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; 507 if (bp->bio_cmd == BIO_WRITE) 508 crde->crd_flags |= CRD_F_ENCRYPT; 509 crde->crd_alg = sc->sc_ealgo; 510 crde->crd_key = g_eli_crypto_key(sc, dstoff, encr_secsize); 511 crde->crd_klen = sc->sc_ekeylen; |
512 if (sc->sc_ealgo == CRYPTO_AES_XTS) 513 crde->crd_klen <<= 1; |
|
512 g_eli_crypto_ivgen(sc, dstoff, crde->crd_iv, 513 sizeof(crde->crd_iv)); 514 515 crda->crd_skip = sc->sc_alen; 516 crda->crd_len = data_secsize; 517 crda->crd_inject = 0; 518 crda->crd_flags = CRD_F_KEY_EXPLICIT; 519 crda->crd_alg = sc->sc_aalgo; --- 12 unchanged lines hidden --- | 514 g_eli_crypto_ivgen(sc, dstoff, crde->crd_iv, 515 sizeof(crde->crd_iv)); 516 517 crda->crd_skip = sc->sc_alen; 518 crda->crd_len = data_secsize; 519 crda->crd_inject = 0; 520 crda->crd_flags = CRD_F_KEY_EXPLICIT; 521 crda->crd_alg = sc->sc_aalgo; --- 12 unchanged lines hidden --- |