serai_processor_view_keys/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2#![doc = include_str!("../README.md")]
3#![deny(missing_docs)]
4
5use ciphersuite::Ciphersuite;
6
7/// Generate a view key for usage within Serai.
8///
9/// `k` is the index of the key to generate (enabling generating multiple view keys within a
10/// single context).
11pub fn view_key<C: Ciphersuite>(k: u64) -> C::F {
12  C::hash_to_F(b"Serai DEX View Key", &k.to_le_bytes())
13}