mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Use the Montgomery ladder multiplier to avoid side-channel attacks.
This commit is contained in:
@@ -5,6 +5,7 @@ import java.math.BigInteger;
|
||||
import org.spongycastle.crypto.params.ECDomainParameters;
|
||||
import org.spongycastle.math.ec.ECCurve;
|
||||
import org.spongycastle.math.ec.ECPoint;
|
||||
import org.spongycastle.math.ec.MontgomeryLadderMultiplier;
|
||||
|
||||
/** Parameters for curve brainpoolP384r1 - see RFC 5639. */
|
||||
interface EllipticCurveConstants {
|
||||
@@ -61,7 +62,8 @@ interface EllipticCurveConstants {
|
||||
BigInteger H = BigInteger.ONE;
|
||||
|
||||
// Static parameter objects derived from the above parameters
|
||||
ECCurve CURVE = new ECCurve.Fp(P, A, B);
|
||||
ECCurve CURVE = new ECCurve.Fp(P, A, B).configure().setMultiplier(
|
||||
new MontgomeryLadderMultiplier()).create();
|
||||
ECPoint G = CURVE.createPoint(X, Y);
|
||||
ECDomainParameters PARAMETERS = new ECDomainParameters(CURVE, G, Q, H);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user