I am using the jsonwebtoken crate, which uses ring internally, and I was trying to improve the latency on P384 verification which seems to be much slower than all the other crypto. After exploring this codebase for a bit and after some benchmarks I was pointed to this function which seems to be inefficient, as the function name says.
|
// XXX: Inefficient and unnecessarily depends on `PrivateKeyOps`. TODO: implement interleaved wNAF |
|
// multiplication. |
|
fn twin_mul_inefficient( |
Before taking on this I wanted to discuss it here. Is the plan to import crypto/fipsmodule/ec/wnaf.c (e.g https://docs.ros.org/en/noetic/api/grpc/html/wnaf_8c_source.html) and implement the FFI calls so that it can replace the function above?
I am using the
jsonwebtokencrate, which usesringinternally, and I was trying to improve the latency on P384 verification which seems to be much slower than all the other crypto. After exploring this codebase for a bit and after some benchmarks I was pointed to this function which seems to be inefficient, as the function name says.ring/src/ec/suite_b/ops/mod.rs
Lines 477 to 479 in 840167e
Before taking on this I wanted to discuss it here. Is the plan to import
crypto/fipsmodule/ec/wnaf.c(e.g https://docs.ros.org/en/noetic/api/grpc/html/wnaf_8c_source.html) and implement the FFI calls so that it can replace the function above?