45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * CDDL HEADER START
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * The contents of this file are subject to the terms of the
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Common Development and Distribution License (the "License").
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * You may not use this file except in compliance with the License.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * or http://opensource.org/licenses/CDDL-1.0.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * See the License for the specific language governing permissions
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * and limitations under the License.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * When distributing Covered Code, include this CDDL HEADER in each
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * If applicable, add the following below this CDDL HEADER, with the
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * fields enclosed by brackets "[]" replaced with your own identifying
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * information: Portions Copyright [yyyy] [name of copyright owner]
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * CDDL HEADER END
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Copyright 2013 Saso Kiselkov. All rights reserved.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Computes a native 256-bit skein MAC checksum. Please note that this
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * function requires the presence of a ctx_template that should be allocated
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * using zio_checksum_skein_tmpl_init.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrenszio_checksum_skein_native(const void *buf, uint64_t size,
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens (void) Skein_512_Final(&ctx, (uint8_t *)zcp);
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Byteswapped version of zio_checksum_skein_native. This just invokes
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * the native checksum function and byteswaps the resulting checksum (since
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * skein is internally endian-insensitive).
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrenszio_checksum_skein_byteswap(const void *buf, uint64_t size,
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens zio_checksum_skein_native(buf, size, ctx_template, &tmp);
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Allocates a skein MAC template suitable for using in skein MAC checksum
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * computations and returns a pointer to it.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrenszio_checksum_skein_tmpl_init(const zio_cksum_salt_t *salt)
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens (void) Skein_512_InitExt(ctx, sizeof (zio_cksum_t) * 8, 0,
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Frees a skein context template previously allocated using
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * zio_checksum_skein_tmpl_init.