Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant time curve arithmetic #826

Open
axelexic opened this issue May 6, 2024 · 1 comment
Open

Constant time curve arithmetic #826

axelexic opened this issue May 6, 2024 · 1 comment

Comments

@axelexic
Copy link

axelexic commented May 6, 2024

Does arkworks plan to have a software side-channel safe implementation for ec and ff arithmetic -- at least for prime-order groups in short-Weierstrass model? Arkworks is a well written library (kudos!), and we will like to use it in production for some 90's crypto (ECDSA, ECIES, ECDH, etc.). However, the current curve arithmetic seems to have no side-channel protection. For example:

pub fn sw_double_and_add_projective<P: SWCurveConfig>(
    base: &Projective<P>,
    scalar: impl AsRef<[u64]>,
) -> Projective<P> {
    let mut res = Projective::<P>::zero();
    for b in ark_ff::BitIteratorBE::without_leading_zeros(scalar) {
        res.double_in_place();
        if b {                          <== timing leaks scalar
            res += base  
        }
    }

    res
}
@burdges
Copy link
Contributor

burdges commented May 6, 2024

At minimum, we could've seperate constant time curve crates where external crates already supply them, so maybe wrappers over cruve25519-dalek and bls12_381.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants