From 1ed5db33033def0b671774c8cae5c2ff33da2a42 Mon Sep 17 00:00:00 2001 From: Markus Sabadello Date: Wed, 4 Dec 2024 15:47:08 +0100 Subject: [PATCH] fix: Fix secp256r1 curve --- src/main/java/com/danubetech/keyformats/PublicKeyBytes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/danubetech/keyformats/PublicKeyBytes.java b/src/main/java/com/danubetech/keyformats/PublicKeyBytes.java index 701887d..0cb9a73 100644 --- a/src/main/java/com/danubetech/keyformats/PublicKeyBytes.java +++ b/src/main/java/com/danubetech/keyformats/PublicKeyBytes.java @@ -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();