Skip to content

Commit

Permalink
feat: provide Fiat-Shamir heuristic related info ProofItemVariants
Browse files Browse the repository at this point in the history
Also fix intra-doc links.
  • Loading branch information
jan-ferdinand committed Feb 2, 2024
1 parent 74e42d3 commit 02de19f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion triton-tui/src/element_type_hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) struct ElementTypeHint {
/// Does not apply to types that are not composed of multiple [`BFieldElement`][bfe]s, like `u32` or
/// [`BFieldElement`][bfe] itself.
///
/// [bfe]: triton_vm::BFieldElement
/// [bfe]: triton_vm::prelude::BFieldElement
pub index: Option<usize>,
}

Expand Down
3 changes: 1 addition & 2 deletions triton-vm/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Result<T> = std::result::Result<T, VMError>;
/// [`profiled`](Program::profile),
/// and its execution can be [`traced`](Program::trace_execution).
///
/// [`Hashing`](Program::hash) a program under [`Tip5`][tip5] yields a [`Digest`] that can be used
/// [`Hashing`](Program::hash) a program under [`Tip5`] yields a [`Digest`] that can be used
/// in a [`Claim`](crate::Claim), _i.e._, is consistent with Triton VM's [program attestation].
///
/// A program may contain debug information, such as label names and breakpoints.
Expand All @@ -43,7 +43,6 @@ type Result<T> = std::result::Result<T, VMError>;
/// [BField-encoding](BFieldCodec::encode), discard this debug information.
///
/// [program attestation]: https://triton-vm.org/spec/program-attestation.html
/// [tip5]: twenty_first::shared_math::tip5::Tip5
/// [label_for_address]: Program::label_for_address
/// [is_breakpoint]: Program::is_breakpoint
#[derive(Debug, Clone, Eq, GetSize, Serialize, Deserialize)]
Expand Down
9 changes: 8 additions & 1 deletion triton-vm/src/proof_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ macro_rules! proof_items {
Arbitrary
)]
#[strum_discriminants(name(ProofItemVariant))]
#[strum_discriminants(derive(Display, BFieldCodec))]
#[strum_discriminants(derive(Display, Arbitrary, BFieldCodec))]
pub enum ProofItem {
$( $variant($payload), )+
}
Expand Down Expand Up @@ -74,6 +74,13 @@ macro_rules! proof_items {
$( Self::$variant => <$payload>::static_length(), )+
}
}

/// See [`ProofItem::include_in_fiat_shamir_heuristic`].
pub const fn include_in_fiat_shamir_heuristic(&self) -> bool {
match self {
$( Self::$variant => $in_fiat_shamir_heuristic, )+
}
}
}
};
}
Expand Down

0 comments on commit 02de19f

Please sign in to comment.