Update BLAKE3 for using the new impl handling

This commit changes the BLAKE3 implementation handling and
also the calls to it from the ztest command.

Tested-by: Rich Ercolani <rincebrain@gmail.com>
Tested-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #13741
This commit is contained in:
Tino Reichardt
2023-02-27 16:14:37 +01:00
committed by Brian Behlendorf
parent 4c5fec01a4
commit f9f9bef22f
8 changed files with 274 additions and 511 deletions
+4 -22
View File
@@ -22,11 +22,11 @@
/*
* Based on BLAKE3 v1.3.1, https://github.com/BLAKE3-team/BLAKE3
* Copyright (c) 2019-2020 Samuel Neves and Jack O'Connor
* Copyright (c) 2021 Tino Reichardt <milky-zfs@mcmilk.de>
* Copyright (c) 2021-2022 Tino Reichardt <milky-zfs@mcmilk.de>
*/
#ifndef BLAKE3_H
#define BLAKE3_H
#ifndef _SYS_BLAKE3_H
#define _SYS_BLAKE3_H
#ifdef _KERNEL
#include <sys/types.h>
@@ -97,26 +97,8 @@ extern void **blake3_per_cpu_ctx;
extern void blake3_per_cpu_ctx_init(void);
extern void blake3_per_cpu_ctx_fini(void);
/* get count of supported implementations */
extern uint32_t blake3_impl_getcnt(void);
/* get id of selected implementation */
extern uint32_t blake3_impl_getid(void);
/* get name of selected implementation */
extern const char *blake3_impl_getname(void);
/* setup id as fastest implementation */
extern void blake3_impl_set_fastest(uint32_t id);
/* set implementation by id */
extern void blake3_impl_setid(uint32_t id);
/* set implementation by name */
extern int blake3_impl_setname(const char *name);
#ifdef __cplusplus
}
#endif
#endif /* BLAKE3_H */
#endif /* _SYS_BLAKE3_H */