diff options
| author | J08nY | 2023-08-24 17:30:53 +0200 |
|---|---|---|
| committer | J08nY | 2023-08-24 17:30:53 +0200 |
| commit | 5f4659aa9cef3f918d09777f4355d0bbc9206174 (patch) | |
| tree | 2556ec73df11466b94786ac24948d06467d2d19c /test | |
| parent | 2bd18931be9a00bcee3e6e1e50de8188b7f15a07 (diff) | |
| download | pyecsca-5f4659aa9cef3f918d09777f4355d0bbc9206174.tar.gz pyecsca-5f4659aa9cef3f918d09777f4355d0bbc9206174.tar.zst pyecsca-5f4659aa9cef3f918d09777f4355d0bbc9206174.zip | |
Add more thorought fixedwindow test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ec/test_mult.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ec/test_mult.py b/test/ec/test_mult.py index f481148..6b4a64a 100644 --- a/test/ec/test_mult.py +++ b/test/ec/test_mult.py @@ -216,10 +216,15 @@ def test_window_naf(secp128r1, name, add, dbl, neg, width, scale): ]) def test_fixed_window(secp128r1, name, add, dbl, width, scale): formulas = get_formulas(secp128r1.curve.coordinate_model, add, dbl, scale) - mult = FixedWindowLTRMultiplier(*formulas[:2], width) + mult = FixedWindowLTRMultiplier(*formulas[:2], width, *formulas[2:]) mult.init(secp128r1, secp128r1.generator) res = mult.multiply(157 * 789) - print(res) + other = mult.multiply(157) + mult.init(secp128r1, other) + other = mult.multiply(789) + assert_pt_equality(res, other, scale) + mult.init(secp128r1, secp128r1.generator) + assert InfinityPoint(secp128r1.curve.coordinate_model) == mult.multiply(0) @pytest.mark.parametrize("name,num,add,dbl", |
