Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions library/core/src/num/imp/bignum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ macro_rules! define_bignum {
}
}

/// Any bit pattern, including ones no operation produces (e.g. `size > n`), so that
/// proofs using it do not depend on the invariants of the representation. The operations
/// are safe code and have to cope with (i.e., at worst panic on) every value.
#[cfg(kani)]
impl crate::kani::Arbitrary for $name {
fn any() -> Self {
$name { size: crate::kani::any(), base: crate::kani::any() }
}
}

impl crate::cmp::PartialEq for $name {
fn eq(&self, other: &$name) -> bool {
self.base[..] == other.base[..]
Expand Down
Loading
Loading