akd_client/lib.rs
1// Copyright (c) Meta Platforms, Inc. and affiliates.
2//
3// This source code is licensed under both the MIT license found in the
4// LICENSE-MIT file in the root directory of this source tree and the Apache
5// License, Version 2.0 found in the LICENSE-APACHE file in the root directory
6// of this source tree.
7
8//! # Overview
9//!
10//! This crate contains a "lean" client to verify AKD proofs which doesn't depend on any
11//! crates other than the native hashing implementations and VRF functionality through
12//! the [akd_core] crate. This makes it suitable for embedded applications, e.g. inside
13//! limited clients (Android, iPhone, WebAssembly, etc) which may not have a large
14//! dependency library they can pull upon.
15//!
16//! ## Features
17//!
18//! The features of this library are
19//!
20//! 1. **default** blake3: Blake3 256-bit hashing
21//! 2. sha256: SHA2 256-bit hashing
22//! 3. sha512: SHA3 512-bit hashing
23//! 4. sha3_256: SHA3 256-bit hashing
24//! 5. sha3_512: SHA3 512-bit hashing
25//!
26//! which dictate which hashing function is used by the verification components. Blake3 256-bit hashing is the default
27//! implementation and utilizes the `blake3` crate. Features sha256 and sha512 both utilize SHA2 cryptographic functions
28//! from the [`sha2`](https://crates.io/crates/sha2) crate. Lastly sha3_256 and sha3_512 features utilize the
29//! [`sha3`](https://crates.io/crates/sha3) crate for their hashing implementations.
30//! To utilize a hash implementation other than blake3, you should compile with
31//!
32//! ```bash
33//! // [disable blake3] [enable other hash]
34//! cargo build --no-default-features --features sha3_256
35//! ```
36//!
37
38#![warn(missing_docs)]
39#![cfg_attr(docsrs, feature(doc_cfg))]
40#![cfg_attr(feature = "nostd", no_std)]
41extern crate alloc;
42
43// Re-expose the core functionality from akd_core (verifications, types, etc)
44pub use akd_core::verify;
45pub use akd_core::*;
46
47#[cfg(feature = "protobuf")]
48pub use akd_core::proto::*;
49
50#[cfg(feature = "wasm")]
51pub mod wasm;
52#[cfg(feature = "wasm")]
53pub use wasm::lookup_verify;