[][src]Module r1cs::bits

This module contains wrappers for Wires, Expressions which designate them as boolean, i.e., equal to 0 or 1. Similarly, it contains wrappers for Wire arrays and Expression arrays which designate them as binary, i.e., with each bit equal to 0 or 1.

The intention here is to provide a degree of type safety. If you write a function which takes a BooleanExpression input, the user could not accidentally pass in an unbound wire; they would need to go through a method like assert_binary which would constrain the input to equal 0 or 1.

Structs

BinaryExpression

A "binary expression" which is comprised of several bits, each one being a boolean expression.

BinaryWire

A "binary wire" which is comprised of several bits, each one being a boolean wire.

BooleanExpression

An Expression whose value is known to be binary.

BooleanWire

A Wire whose value is constrained to be binary.