Print this page
4185 New hash algorithm support
*** 20,29 ****
--- 20,32 ----
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+ /*
+ * Copyright 2013 Saso Kiselkov. All rights reserved.
+ */
/*
* Fletcher Checksums
* ------------------
*
*** 129,140 ****
#include <sys/sysmacros.h>
#include <sys/byteorder.h>
#include <sys/zio.h>
#include <sys/spa.h>
void
! fletcher_2_native(const void *buf, uint64_t size, zio_cksum_t *zcp)
{
const uint64_t *ip = buf;
const uint64_t *ipend = ip + (size / sizeof (uint64_t));
uint64_t a0, b0, a1, b1;
--- 132,145 ----
#include <sys/sysmacros.h>
#include <sys/byteorder.h>
#include <sys/zio.h>
#include <sys/spa.h>
+ /*ARGSUSED*/
void
! fletcher_2_native(const void *buf, uint64_t size, const zio_cksum_salt_t *salt,
! const void *ctx_template, zio_cksum_t *zcp)
{
const uint64_t *ip = buf;
const uint64_t *ipend = ip + (size / sizeof (uint64_t));
uint64_t a0, b0, a1, b1;
*** 146,157 ****
}
ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1);
}
void
! fletcher_2_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp)
{
const uint64_t *ip = buf;
const uint64_t *ipend = ip + (size / sizeof (uint64_t));
uint64_t a0, b0, a1, b1;
--- 151,164 ----
}
ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1);
}
+ /*ARGSUSED*/
void
! fletcher_2_byteswap(const void *buf, uint64_t size,
! const zio_cksum_salt_t *salt, const void *ctx_template, zio_cksum_t *zcp)
{
const uint64_t *ip = buf;
const uint64_t *ipend = ip + (size / sizeof (uint64_t));
uint64_t a0, b0, a1, b1;
*** 163,174 ****
}
ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1);
}
void
! fletcher_4_native(const void *buf, uint64_t size, zio_cksum_t *zcp)
{
const uint32_t *ip = buf;
const uint32_t *ipend = ip + (size / sizeof (uint32_t));
uint64_t a, b, c, d;
--- 170,183 ----
}
ZIO_SET_CHECKSUM(zcp, a0, a1, b0, b1);
}
+ /*ARGSUSED*/
void
! fletcher_4_native(const void *buf, uint64_t size, const zio_cksum_salt_t *salt,
! const void *ctx_template, zio_cksum_t *zcp)
{
const uint32_t *ip = buf;
const uint32_t *ipend = ip + (size / sizeof (uint32_t));
uint64_t a, b, c, d;
*** 180,191 ****
}
ZIO_SET_CHECKSUM(zcp, a, b, c, d);
}
void
! fletcher_4_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp)
{
const uint32_t *ip = buf;
const uint32_t *ipend = ip + (size / sizeof (uint32_t));
uint64_t a, b, c, d;
--- 189,202 ----
}
ZIO_SET_CHECKSUM(zcp, a, b, c, d);
}
+ /*ARGSUSED*/
void
! fletcher_4_byteswap(const void *buf, uint64_t size,
! const zio_cksum_salt_t *salt, const void *ctx_template, zio_cksum_t *zcp)
{
const uint32_t *ip = buf;
const uint32_t *ipend = ip + (size / sizeof (uint32_t));
uint64_t a, b, c, d;