assist/circuits

This module contains code to do arithmetic circuit logic on integers. All values are assumed to be positive and p is a prime.

Functions

and_(x: Int, y: Int, p: Int) -> Int

Performs a logical AND operation on two integer values within an arithmetic circuit.

circuits.and_(1, 1, p)

imply_(x: Int, y: Int, p: Int) -> Int

Performs a logical implication operation on two integer values within an arithmetic circuit.

circuits.imply_(1, 0, p)

nand_(x: Int, y: Int, p: Int) -> Int

Performs a logical NAND operation on two integer values within an arithmetic circuit.

circuits.nand_(1, 1, p)

nor_(x: Int, y: Int, p: Int) -> Int

Performs a logical NOR operation on two integer values within an arithmetic circuit.

circuits.nor_(0, 0, p)

not_(x: Int, p: Int) -> Int

Performs a logical NOT operation on an integer value within an arithmetic circuit.

circuits.not_(1, p)

or_(x: Int, y: Int, p: Int) -> Int

Performs a logical OR operation on two integer values within an arithmetic circuit..

circuits.or_(0, 1, p)

xnor_(x: Int, y: Int, p: Int) -> Int

Performs a logical XNOR operation on two integer values within an arithmetic circuit.

circuits.xnor_(1, 1, p)

xor_(x: Int, y: Int, p: Int) -> Int

Performs a logical XOR operation on two integer values within an arithmetic circuit.

circuits.xor_(0, 1, p)
Search Document