Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

_verify

Verifies that two encryptions for two different keys are valid and that they are encrypting the same amount b. Note: We assume here that the two randoms r1 and r2 are known by the prover. This proof is just two proof of ElGamal encryption which both use the same value sb. (L1, R1) = (g^b y1^r1, g^r1), (L2, R2) = (g^b y2^r2, g^r2). The protocol runs as follows

    P:  kb, kr1, kr2 <-- R      sends    AL1=g^kb y1^kr1, AR1=g^kb, AL2=g^kb y2^kr2, AR2=g^kr2
    V:          c  <-- R        sends    c
    P:  sb  = kb  + c*b         sends    sb
    P:  sr1 = kr1 + c*r1        sends    sr1
    P:  sr2 = kr2 + c*r2        sends    sr2

The verifier asserts:

  • The correct encryption of (L1,R1)

  • The correct encryption of (L2,R2)

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

EC_MUL: 10; EC_ADD: 6

Fully qualified path: she::protocols::SameEncryption::_verify

pub fn _verify(
    L1: NonZero<EcPoint>,
    R1: NonZero<EcPoint>,
    L2: NonZero<EcPoint>,
    R2: NonZero<EcPoint>,
    g: NonZero<EcPoint>,
    y1: NonZero<EcPoint>,
    y2: NonZero<EcPoint>,
    AL1: NonZero<EcPoint>,
    AR1: NonZero<EcPoint>,
    AL2: NonZero<EcPoint>,
    AR2: NonZero<EcPoint>,
    c: felt252,
    sb: felt252,
    sr1: felt252,
    sr2: felt252,
) -> Result<(), Errors>