예제 #1
0
def test_add_mod_fast_general(x, y):
    """Exercise the fast modular addition interface's claimed precondition."""
    assume(x + y < 2**65 - 8)
    assert C.add_mod_fast(x, y) % MODULO == (x + y) % MODULO
예제 #2
0
def test_add_mod_fast(x, y):
    """Check fast modular addition, for the case we care in practice."""
    assert C.add_mod_fast(x, y) % MODULO == (x + y) % MODULO