--- /dev/null Tue Feb 3 13:17:26 2009 +++ new/usr/src/common/zfs/zcrypt_common.c Tue Feb 3 13:17:25 2009 @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Common routines/data used by zfs and zpool and zio crypto functions. + */ + +#include + +/* + * Cryptographic Algorithm table. + * + * NOTE that some crypto mechanisms require the key length in the + * crypto_key_t to be specified in bits not bytes. Bytes are used + * here since we kmem_alloc based on these values. + * + * on == aes-256-ccm + * + * Algorithm/Mode Keylen iv MACLEN ZIL Option_name + * Bytes MACLEN + */ +zio_crypt_info_t zio_crypt_table[ZIO_CRYPT_FUNCTIONS] = { + "", 0, 0, 0, 0, "inherit", + SUN_CKM_AES_CCM, 32, 12, 16, 8, "on", + "", 0, 0, 0, 0, "off", + SUN_CKM_AES_CCM, 16, 12, 16, 8, "aes-128-ccm", + SUN_CKM_AES_CCM, 32, 12, 16, 8, "aes-256-ccm", +};