feat(aiken-lang): expose integerToByteString and byteStringToInteger

This commit is contained in:
rvcas 2024-02-16 10:07:49 -05:00 committed by Lucas
parent fc3bc4d9ff
commit c7dd4d0e48
2 changed files with 12 additions and 0 deletions

View File

@ -771,6 +771,16 @@ pub fn from_default_function(builtin: DefaultFunction, id_gen: &IdGenerator) ->
DefaultFunction::Bls12_381_FinalVerify => { DefaultFunction::Bls12_381_FinalVerify => {
let tipo = function(vec![miller_loop_result(), miller_loop_result()], bool()); let tipo = function(vec![miller_loop_result(), miller_loop_result()], bool());
(tipo, 2)
}
DefaultFunction::IntegerToByteString => {
let tipo = function(vec![bool(), int(), int()], byte_array());
(tipo, 3)
}
DefaultFunction::ByteStringToInteger => {
let tipo = function(vec![bool(), byte_array()], int());
(tipo, 2) (tipo, 2)
} }
}; };

View File

@ -536,6 +536,8 @@ impl DefaultFunction {
Bls12_381_MillerLoop => "bls12_381_miller_loop", Bls12_381_MillerLoop => "bls12_381_miller_loop",
Bls12_381_MulMlResult => "bls12_381_mul_miller_loop_result", Bls12_381_MulMlResult => "bls12_381_mul_miller_loop_result",
Bls12_381_FinalVerify => "bls12_381_final_verify", Bls12_381_FinalVerify => "bls12_381_final_verify",
IntegerToByteString => "integer_to_bytearray",
ByteStringToInteger => "bytearray_to_integer",
} }
.to_string() .to_string()
} }