YM2LC6QP2D7TK3JUKOXWUWTQEGMCEGQDGPTOZPWC3BRDFNRKSZWQC
L3HKOF4WYZZLJJY2Q6YJ65WGAB74GQ2A7ICD23M5NQGBP4BXF6DQC
XJ2PEH74CLJUELZBR47QHGUSKXB4Z5T7EKEF6Y4CYY2VBHZXUTDAC
CYS4NENLQIYU26KG46ZOTGWDOK5HX4UT4UW4ZKHY3PRPDWNGGT5QC
2C2EF2GKTOAT7QI56KKDFGRGSFZRDPKUASNQFB6XQDROAEPPZW4AC
Q7TKZCJP2Z75EICZYKCEZDHKGERSOKZGMTSU3UXETBHTF663T66AC
RIWSVVASWLJQQTSVRHIIUPENOZWOMHQLZMTQVGJUS2ZUGDPSWWIQC
YG4DZB3AW3Z3LB5CFBZZ4ORJOLZFN3G4CA2YTAMSUOQX3USVNVEAC
WMFNGOYTKIZ7L25V3KMJPSWK23DTN6G3ESP6M55YIH6UTHFKL2XAC
OBKF6SIIFFHHY7YWKPPX75N23NAVUD5662DKIHXSSIDPKKXQ5ZDQC
VKLGQREYOZDV46F672RFE5XJO3OEOP4EHTCWZYOJY24HVPQX3L6QC
XTKRT6OQYN4LARQRDLI2KBSAJTOFZNT4AMBZ46CPUDZXD7IDYYWQC
PEUS54XQ5KJQYAVUYBG5MWLEHIOVPMZ3ANVC7HPQP6JUWWPRDW5AC
#ifndef ANI_BLAKE3_H
#define ANI_BLAKE3_H
/* Wrapper for the vendored blake3 hash algorithm (the C implementation) */
#define BLAKE3_LEN 32
/* Hash the given input of the indicated length and put the result in out */
void blake3_hash(uint8_t *out, uint8_t *in, size_t len);
/* Compare two hashes */
int blake3_cmp(uint8_t *h1, uint8_t *h2);
#endif
#include <stdint.h>
#include "vendor/blake3/blake3.h"
#include "blake3.h"
void
blake3_hash(uint8_t *out, uint8_t *in, size_t len)
{
blake3_hasher b3sum;
blake3_hasher_init(&b3sum);
blake3_hasher_update(&b3sum, in, len);
blake3_hasher_finalize(&b3sum, out, BLAKE3_OUT_LEN);
}
int
blake3_cmp(uint8_t *h1, uint8_t *h2)
{
size_t i;
for (i = 0; i < BLAKE3_OUT_LEN; i++)
if (h1[i] != h2[i])
return 1;
return 0;
}