Secret keys in Podlang (#365)

This commit is contained in:
Rob Knight 2025-07-29 23:50:10 +01:00 committed by GitHub
parent ce8cabc337
commit 59c6151dbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 64 additions and 9 deletions

View file

@ -192,6 +192,7 @@ fn fmt_predicate_signature(
mod tests {
use super::*;
use crate::{
backends::plonky2::primitives::ec::schnorr::SecretKey,
lang::parse,
middleware::{
CustomPredicate, Key, NativePredicate, Params, Predicate, StatementTmpl,
@ -492,6 +493,20 @@ mod tests {
assert_round_trip(input);
}
#[test]
fn test_round_trip_secret_key() {
let sk = SecretKey::new_rand();
let input = format!(
r#"
secret_key_test(Pod) = AND(
Equal(?Pod["sk"], {})
)
"#,
Value::from(sk.clone()).to_podlang_string()
);
assert_round_trip(&input);
}
#[test]
fn test_pretty_print_demonstration() {
let input = r#"