Skip to content

Commit

Permalink
fix: Fix secp256r1 curve
Browse files Browse the repository at this point in the history
  • Loading branch information
peacekeeper committed Dec 4, 2024
1 parent 051886d commit 1ed5db3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static ECPublicKey bytes_to_P_256PublicKey(byte[] publicKeyBytes) {
} else {
byte[] k = new byte[33];
System.arraycopy(publicKeyBytes, 0, k, 0, k.length);
ECNamedCurveParameterSpec ecNamedCurveParameterSpec = ECNamedCurveTable.getParameterSpec("secp256k1");
ECNamedCurveParameterSpec ecNamedCurveParameterSpec = ECNamedCurveTable.getParameterSpec("secp256r1");
org.bouncycastle.math.ec.ECPoint bcEcPoint = ecNamedCurveParameterSpec.getCurve().decodePoint(k);
x = bcEcPoint.getRawXCoord().getEncoded();
y = bcEcPoint.getRawYCoord().getEncoded();
Expand Down

0 comments on commit 1ed5db3

Please sign in to comment.