snarkvm_circuit_environment::traits

Trait ToUpperBits

Source
pub trait ToUpperBits {
    type Boolean: BooleanTrait;

    // Required methods
    fn to_upper_bits_le(&self, k: usize) -> Vec<Self::Boolean>;
    fn to_upper_bits_be(&self, k: usize) -> Vec<Self::Boolean>;
}
Expand description

Unary operator for converting to k number of bits.

Required Associated Types§

Required Methods§

Source

fn to_upper_bits_le(&self, k: usize) -> Vec<Self::Boolean>

Outputs the upper k bits of an n-bit element in little-endian representation. Enforces that the lower n - k bits are zero.

Source

fn to_upper_bits_be(&self, k: usize) -> Vec<Self::Boolean>

Outputs the upper k bits of an n-bit element in big-endian representation. Enforces that the lower n - k bits are zero.

Implementors§