sapling/eden/fs/digest/Blake3.h
Xavier Deguillard 9cf177a939 teach autodeps about blake3.h
Summary: This removes one manual from EdenFS build

Reviewed By: luciang

Differential Revision: D45107863

fbshipit-source-id: fc850ab91d8390671b698186feb9a199a86d6594
2023-04-18 19:18:17 -07:00

38 lines
801 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <folly/Range.h>
#include <blake3.h>
namespace facebook::eden {
struct Blake3 final {
Blake3();
/*
* Initialize a blake3_hasher in the keyed hashing mode. The key must be
* exactly 32 bytes.
* It mostly used for security purposes to make it harder creating a rainbow
* table in the future
*/
explicit Blake3(folly::ByteRange key);
void update(const void* data, size_t size);
void update(folly::ByteRange data);
void update(folly::StringPiece data);
void finalize(folly::MutableByteRange out);
private:
blake3_hasher hasher_;
};
} // namespace facebook::eden