Struct akd::ExperimentalConfiguration
source · pub struct ExperimentalConfiguration<L>(/* private fields */);
Expand description
An experimental configuration
Trait Implementations§
source§impl<L> Clone for ExperimentalConfiguration<L>where
L: Clone,
impl<L> Clone for ExperimentalConfiguration<L>where
L: Clone,
source§fn clone(&self) -> ExperimentalConfiguration<L>
fn clone(&self) -> ExperimentalConfiguration<L>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<L> Configuration for ExperimentalConfiguration<L>where
L: DomainLabel,
impl<L> Configuration for ExperimentalConfiguration<L>where
L: DomainLabel,
source§fn get_commitment_nonce(
commitment_key: &[u8],
label: &NodeLabel,
_version: u64,
_value: &AkdValue
) -> [u8; 32]
fn get_commitment_nonce( commitment_key: &[u8], label: &NodeLabel, _version: u64, _value: &AkdValue ) -> [u8; 32]
Used by the server to produce a commitment nonce for an AkdLabel, version, and AkdValue. Computes nonce = H(commitment key || label)
source§fn compute_fresh_azks_value(
commitment_key: &[u8],
label: &NodeLabel,
version: u64,
value: &AkdValue
) -> AzksValue
fn compute_fresh_azks_value( commitment_key: &[u8], label: &NodeLabel, version: u64, value: &AkdValue ) -> AzksValue
Used by the server to produce a commitment for an AkdLabel, version, and AkdValue
nonce = H(commitment key || label) commmitment = H(i2osp_array(value), i2osp_array(nonce))
The nonce value is used to create a hiding and binding commitment using a cryptographic hash function. Note that it is derived from the label, version, and value (even though the binding to value is somewhat optional).
Note that this commitment needs to be a hash function (random oracle) output
source§fn get_hash_from_label_input(
label: &AkdLabel,
freshness: VersionFreshness,
version: u64
) -> Vec<u8> ⓘ
fn get_hash_from_label_input( label: &AkdLabel, freshness: VersionFreshness, version: u64 ) -> Vec<u8> ⓘ
To convert a regular label (arbitrary string of bytes) into a NodeLabel, we compute the output as: H(label || freshness || version)
Specifically, we concatenate the following together:
- I2OSP(len(label) as u64, label)
- A single byte encoded as 0u8 if “stale”, 1u8 if “fresh”
- A u64 representing the version These are all interpreted as a single byte array and hashed together, with the output of the hash returned.
source§fn compute_parent_hash_from_children(
left_val: &AzksValue,
left_label: &[u8],
right_val: &AzksValue,
right_label: &[u8]
) -> AzksValue
fn compute_parent_hash_from_children( left_val: &AzksValue, left_label: &[u8], right_val: &AzksValue, right_label: &[u8] ) -> AzksValue
Computes the parent hash from the children hashes and labels
source§fn compute_root_hash_from_val(root_val: &AzksValue) -> [u8; 32]
fn compute_root_hash_from_val(root_val: &AzksValue) -> [u8; 32]
Given the top-level hash, compute the “actual” root hash that is published by the directory maintainer
source§fn stale_azks_value() -> AzksValue
fn stale_azks_value() -> AzksValue
Similar to commit_fresh_value, but used for stale values.