blob: 2264374e33a09438e5189efabf3e160afbe4e668 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +00002/*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +00005 */
6/*
7 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
8 * Use is subject to license terms.
9 */
10
11#ifndef _SYS_ZIO_CHECKSUM_H
12#define _SYS_ZIO_CHECKSUM_H
13
14/*
15 * Signature for checksum functions.
16 */
17typedef void zio_checksum_t(const void *data, uint64_t size,
18 zfs_endian_t endian, zio_cksum_t *zcp);
19
20/*
21 * Information about each checksum function.
22 */
23typedef struct zio_checksum_info {
24 zio_checksum_t *ci_func; /* checksum function for each byteorder */
25 int ci_correctable; /* number of correctable bits */
26 int ci_eck; /* uses zio embedded checksum? */
27 char *ci_name; /* descriptive name */
28} zio_checksum_info_t;
29
30extern void zio_checksum_SHA256(const void *, uint64_t,
31 zfs_endian_t endian, zio_cksum_t *);
32extern void fletcher_2_endian(const void *, uint64_t, zfs_endian_t endian,
33 zio_cksum_t *);
34extern void fletcher_4_endian(const void *, uint64_t, zfs_endian_t endian,
35 zio_cksum_t *);
36
37#endif /* _SYS_ZIO_CHECKSUM_H */