Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- boolCheckC :: Arithmetic a => ArithmeticCircuit a -> ArithmeticCircuit a
- embed :: Arithmetic a => a -> ArithmeticCircuit a
- expansion :: MonadBlueprint i a m => Natural -> i -> m [i]
- splitExpansion :: MonadBlueprint i a m => Natural -> Natural -> i -> m (i, i)
- horner :: MonadBlueprint i a m => [i] -> m i
- isZeroC :: Arithmetic a => ArithmeticCircuit a -> ArithmeticCircuit a
- invertC :: Arithmetic a => ArithmeticCircuit a -> ArithmeticCircuit a
Documentation
boolCheckC :: Arithmetic a => ArithmeticCircuit a -> ArithmeticCircuit a Source #
boolCheckC r
computes r (r - 1)
in one PLONK constraint.
embed :: Arithmetic a => a -> ArithmeticCircuit a Source #
expansion :: MonadBlueprint i a m => Natural -> i -> m [i] Source #
expansion n k
computes a binary expansion of k
if it fits in n
bits.
splitExpansion :: MonadBlueprint i a m => Natural -> Natural -> i -> m (i, i) Source #
splitExpansion n1 n2 k
computes two values (l, h)
such that
k = 2^n1 h + l
, l
fits in n1
bits and h
fits in n2 bits (if such
values exist).
horner :: MonadBlueprint i a m => [i] -> m i Source #
horner [b0,...,bn]
computes the sum b0 + 2 b1 + ... + 2^n bn
using
Horner's scheme.
isZeroC :: Arithmetic a => ArithmeticCircuit a -> ArithmeticCircuit a Source #
invertC :: Arithmetic a => ArithmeticCircuit a -> ArithmeticCircuit a Source #