From 175cd777d8cde78d9f1cb7b0a0c6e671c9a33339 Mon Sep 17 00:00:00 2001 From: rvcas Date: Sat, 4 Feb 2023 16:24:00 -0500 Subject: [PATCH] feat: enable elliptic curve verification builtins --- crates/aiken-lang/src/builtins.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/aiken-lang/src/builtins.rs b/crates/aiken-lang/src/builtins.rs index dfd4c093..2a1ee85d 100644 --- a/crates/aiken-lang/src/builtins.rs +++ b/crates/aiken-lang/src/builtins.rs @@ -391,6 +391,18 @@ pub fn from_default_function( Some((tipo, 3)) } + + DefaultFunction::VerifyEcdsaSecp256k1Signature => { + let tipo = function(vec![byte_array(), byte_array(), byte_array()], bool()); + + Some((tipo, 3)) + } + DefaultFunction::VerifySchnorrSecp256k1Signature => { + let tipo = function(vec![byte_array(), byte_array(), byte_array()], bool()); + + Some((tipo, 3)) + } + DefaultFunction::AppendString => { let tipo = function(vec![string(), string()], string()); @@ -499,9 +511,6 @@ pub fn from_default_function( Some((tipo, 1)) } - // Disabled until the next hard-fork - DefaultFunction::VerifyEcdsaSecp256k1Signature => None, - DefaultFunction::VerifySchnorrSecp256k1Signature => None, // Anything below has a direct syntax equivalent in Aiken, so // there's no need to support builtin for those. DefaultFunction::ChooseData => None,