miden-processor 0.9.2

Miden VM processor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::{ExecutionError, Felt};
use crate::{ONE, ZERO};

/// TODO: add docs
#[inline(always)]
pub fn assert_binary(value: Felt) -> Result<Felt, ExecutionError> {
    if value != ZERO && value != ONE {
        Err(ExecutionError::NotBinaryValue(value))
    } else {
        Ok(value)
    }
}