Skip to content

Commit 01e5f6e

Browse files
committed
feat: read secp256r1 keys in datalog parameters
only ed25519 keys were supported
1 parent 5f077ef commit 01e5f6e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/input.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,7 @@ pub fn parse_param(kv: &str) -> Result<Param, std::io::Error> {
594594

595595
match annotation {
596596
Some("pubkey") => {
597-
let hex_key = value.strip_prefix("ed25519/").ok_or_else(|| Error::new(
598-
ErrorKind::Other,
599-
"Unsupported public key type. Only hex-encoded ed25519 public keys are supported. They must start with `ed25519/`.",
600-
))?;
601-
let bytes =
602-
hex::decode(hex_key).map_err(|e| Error::new(ErrorKind::Other, format!("{}", &e)));
603-
let pubkey = PublicKey::from_bytes(&bytes?, Algorithm::Ed25519)
604-
.map_err(|e| Error::new(ErrorKind::Other, format!("{}", &e)))?;
597+
let pubkey = value.parse().map_err(Error::other)?;
605598
Ok(Param::PublicKey(name.to_string(), pubkey))
606599
},
607600
Some("integer") => {

0 commit comments

Comments
 (0)