Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f209c86e authored by David Duarte's avatar David Duarte
Browse files

rootcanal/ec: Use Jacobian Coordinates in Point implementation

This allows to speed up multiplication as we don't need to do
an expensive mod_inv for each addition but only once when we
convert back to affine coordinates.

Before:

In debug:
running 2 tests
test lmp::ec::tests::p256 ... ok
test lmp::ec::tests::p192 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 37 filtered out; finished in 2.32s

In release:
running 2 tests
test lmp::ec::tests::p256 ... ok
test lmp::ec::tests::p192 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 37 filtered out; finished in 0.36s

After:

In debug:
running 2 tests
test lmp::ec::tests::p256 ... ok
test lmp::ec::tests::p192 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 37 filtered out; finished in 0.30s

In release:
running 2 tests
test lmp::ec::tests::p256 ... ok
test lmp::ec::tests::p192 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 37 filtered out; finished in 0.04s

Resulting in a 6x improvement in debug and 7.5x in release

Bug: 335192676
Test: cargo test lmp::ec
Flag: EXEMPT, rootcanal
Change-Id: I09f8cfd02515f308dcb7f81e75cfafbf7bc50a5a
parent 30bd4820
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment