예제 #1
0
def test_dlne_non_interactive_2(group):
    g = group.generator()
    x = Secret(value=3)
    y = 3 * g
    y2 = 397474 * g
    g2 = 1397 * g

    p1 = DLNotEqual([y, g], [y2, g2], x, bind=True)
    tr = p1.prove()
    p2 = DLNotEqual([y, g], [y2, g2], Secret(), bind=True)
    assert p2.verify(tr)
예제 #2
0
def test_dlne_simulate(group):
    g = group.generator()
    x = Secret()
    y = 3 * g
    y2 = 397474 * g
    g2 = 1397 * g

    p = DLNotEqual([y, g], [y2, g2], x, bind=True)
    secret_dict = {x: 3}
    tr = p.simulate()
    assert p.verify_simulation_consistency(tr)
    assert not p.verify(tr)
예제 #3
0
def test_dlne_non_interactive_1(group):
    g = group.generator()
    x = Secret()
    y = 3 * g
    y2 = 397474 * g
    g2 = 1397 * g

    p1 = DLNotEqual([y, g], [y2, g2], x, bind=True)
    secret_dict = {x: 3}
    tr = p1.prove(secret_dict)
    p2 = DLNotEqual([y, g], [y2, g2], x, bind=True)
    assert p2.verify(tr)