Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

_verify

Proof that a pair of EC points is a well formed ElGamal encryption of the form (L, R) = (g1^b g2^r , g1^r). The sigma protocol consists of a coupled POE and POE2 and runs as follows:

    P:  kb,kr <-- R        sends    AL = g1^kb g2^kr, AR=g1^kr
    V:  c <-- R            sends    c
    P:  sb = kb + c*b
    P:  sr = kr + c*r      sends s1, s1

The verifier asserts:

  • g1^sr == AR * (R^c) [poe]

  • g1^sb g2^sr == AL * (L^c) [poe2]

notation: (P)rover (V)erifier (R)andom

EC_MUL: 5; EC_ADD: 3

Fully qualified path: she::protocols::ElGamal::_verify

pub fn _verify(
    L: NonZero<EcPoint>,
    R: NonZero<EcPoint>,
    g1: NonZero<EcPoint>,
    g2: NonZero<EcPoint>,
    AL: NonZero<EcPoint>,
    AR: NonZero<EcPoint>,
    c: felt252,
    sb: felt252,
    sr: felt252,
) -> Result<(), Errors>