mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-23 10:12:21 +03:00
Implement additional features to the "group" element type (#2394)
* add new hash and commit symbols * pedersen commitment methods return fields * use snarkvm rev a451d91, impl commit_to_group.bhp256 * implement bhp commit to group variants * implement bhp hash_to_group variants * implement pedersen commit_to_group and hash_to_scalar variants * implement poseidon hash_to_group and hash_to_scalar variants * remove hash_many symbol * fix tests * regen test expectations
This commit is contained in:
parent
190024f939
commit
4e71f60cb4
492
Cargo.lock
generated
492
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -31,10 +31,14 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.dependencies.snarkvm]
|
||||
version = "=0.11.6"
|
||||
rev = "f69dc53"
|
||||
git = "https://github.com/AleoHQ/snarkvm.git"
|
||||
#version = "=0.11.7"
|
||||
|
||||
[workspace.dependencies.snarkvm-console]
|
||||
version = "=0.11.6"
|
||||
rev = "f69dc53"
|
||||
git = "https://github.com/AleoHQ/snarkvm.git"
|
||||
#version = "=0.11.7"
|
||||
|
||||
[lib]
|
||||
path = "leo/lib.rs"
|
||||
|
@ -20,22 +20,46 @@ use leo_span::{sym, Symbol};
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub enum CoreFunction {
|
||||
BHP256Commit,
|
||||
BHP256CommitToGroup,
|
||||
BHP256Hash,
|
||||
BHP256HashToGroup,
|
||||
|
||||
BHP512Commit,
|
||||
BHP512CommitToGroup,
|
||||
BHP512Hash,
|
||||
BHP512HashToGroup,
|
||||
|
||||
BHP768Commit,
|
||||
BHP768CommitToGroup,
|
||||
BHP768Hash,
|
||||
BHP768HashToGroup,
|
||||
|
||||
BHP1024Commit,
|
||||
BHP1024CommitToGroup,
|
||||
BHP1024Hash,
|
||||
BHP1024HashToGroup,
|
||||
|
||||
Pedersen64Commit,
|
||||
Pedersen64CommitToGroup,
|
||||
Pedersen64Hash,
|
||||
Pedersen64HashToGroup,
|
||||
|
||||
Pedersen128Commit,
|
||||
Pedersen128CommitToGroup,
|
||||
Pedersen128Hash,
|
||||
Pedersen128HashToGroup,
|
||||
|
||||
Poseidon2Hash,
|
||||
Poseidon2HashToGroup,
|
||||
Poseidon2HashToScalar,
|
||||
|
||||
Poseidon4Hash,
|
||||
Poseidon4HashToGroup,
|
||||
Poseidon4HashToScalar,
|
||||
|
||||
Poseidon8Hash,
|
||||
Poseidon8HashToGroup,
|
||||
Poseidon8HashToScalar,
|
||||
|
||||
MappingGet,
|
||||
MappingGetOrInit,
|
||||
@ -47,22 +71,46 @@ impl CoreFunction {
|
||||
pub fn from_symbols(module: Symbol, function: Symbol) -> Option<Self> {
|
||||
Some(match (module, function) {
|
||||
(sym::BHP256, sym::commit) => Self::BHP256Commit,
|
||||
(sym::BHP256, sym::commit_to_group) => Self::BHP256CommitToGroup,
|
||||
(sym::BHP256, sym::hash) => Self::BHP256Hash,
|
||||
(sym::BHP256, sym::hash_to_group) => Self::BHP256HashToGroup,
|
||||
|
||||
(sym::BHP512, sym::commit) => Self::BHP512Commit,
|
||||
(sym::BHP512, sym::commit_to_group) => Self::BHP512CommitToGroup,
|
||||
(sym::BHP512, sym::hash) => Self::BHP512Hash,
|
||||
(sym::BHP512, sym::hash_to_group) => Self::BHP512HashToGroup,
|
||||
|
||||
(sym::BHP768, sym::commit) => Self::BHP768Commit,
|
||||
(sym::BHP768, sym::commit_to_group) => Self::BHP768CommitToGroup,
|
||||
(sym::BHP768, sym::hash) => Self::BHP768Hash,
|
||||
(sym::BHP768, sym::hash_to_group) => Self::BHP768HashToGroup,
|
||||
|
||||
(sym::BHP1024, sym::commit) => Self::BHP1024Commit,
|
||||
(sym::BHP1024, sym::commit_to_group) => Self::BHP1024CommitToGroup,
|
||||
(sym::BHP1024, sym::hash) => Self::BHP1024Hash,
|
||||
(sym::BHP1024, sym::hash_to_group) => Self::BHP1024HashToGroup,
|
||||
|
||||
(sym::Pedersen64, sym::commit) => Self::Pedersen64Commit,
|
||||
(sym::Pedersen64, sym::commit_to_group) => Self::Pedersen64CommitToGroup,
|
||||
(sym::Pedersen64, sym::hash) => Self::Pedersen64Hash,
|
||||
(sym::Pedersen64, sym::hash_to_group) => Self::Pedersen64HashToGroup,
|
||||
|
||||
(sym::Pedersen128, sym::commit) => Self::Pedersen128Commit,
|
||||
(sym::Pedersen128, sym::commit_to_group) => Self::Pedersen128CommitToGroup,
|
||||
(sym::Pedersen128, sym::hash) => Self::Pedersen128Hash,
|
||||
(sym::Pedersen128, sym::hash_to_group) => Self::Pedersen128HashToGroup,
|
||||
|
||||
(sym::Poseidon2, sym::hash) => Self::Poseidon2Hash,
|
||||
(sym::Poseidon2, sym::hash_to_group) => Self::Poseidon2HashToGroup,
|
||||
(sym::Poseidon2, sym::hash_to_scalar) => Self::Poseidon2HashToScalar,
|
||||
|
||||
(sym::Poseidon4, sym::hash) => Self::Poseidon4Hash,
|
||||
(sym::Poseidon4, sym::hash_to_group) => Self::Poseidon4HashToGroup,
|
||||
(sym::Poseidon4, sym::hash_to_scalar) => Self::Poseidon4HashToScalar,
|
||||
|
||||
(sym::Poseidon8, sym::hash) => Self::Poseidon8Hash,
|
||||
(sym::Poseidon8, sym::hash_to_group) => Self::Poseidon8HashToGroup,
|
||||
(sym::Poseidon8, sym::hash_to_scalar) => Self::Poseidon8HashToScalar,
|
||||
|
||||
(sym::Mapping, sym::get) => Self::MappingGet,
|
||||
(sym::Mapping, sym::get_or_init) => Self::MappingGetOrInit,
|
||||
@ -75,22 +123,46 @@ impl CoreFunction {
|
||||
pub fn num_args(&self) -> usize {
|
||||
match self {
|
||||
Self::BHP256Commit => 2,
|
||||
Self::BHP256CommitToGroup => 2,
|
||||
Self::BHP256Hash => 1,
|
||||
Self::BHP256HashToGroup => 1,
|
||||
|
||||
Self::BHP512Commit => 2,
|
||||
Self::BHP512CommitToGroup => 2,
|
||||
Self::BHP512Hash => 1,
|
||||
Self::BHP512HashToGroup => 1,
|
||||
|
||||
Self::BHP768Commit => 2,
|
||||
Self::BHP768CommitToGroup => 2,
|
||||
Self::BHP768Hash => 1,
|
||||
Self::BHP768HashToGroup => 1,
|
||||
|
||||
Self::BHP1024Commit => 2,
|
||||
Self::BHP1024CommitToGroup => 2,
|
||||
Self::BHP1024Hash => 1,
|
||||
Self::BHP1024HashToGroup => 1,
|
||||
|
||||
Self::Pedersen64Commit => 2,
|
||||
Self::Pedersen64CommitToGroup => 2,
|
||||
Self::Pedersen64Hash => 1,
|
||||
Self::Pedersen64HashToGroup => 1,
|
||||
|
||||
Self::Pedersen128Commit => 2,
|
||||
Self::Pedersen128CommitToGroup => 2,
|
||||
Self::Pedersen128Hash => 1,
|
||||
Self::Pedersen128HashToGroup => 1,
|
||||
|
||||
Self::Poseidon2Hash => 1,
|
||||
Self::Poseidon2HashToGroup => 1,
|
||||
Self::Poseidon2HashToScalar => 1,
|
||||
|
||||
Self::Poseidon4Hash => 1,
|
||||
Self::Poseidon4HashToGroup => 1,
|
||||
Self::Poseidon4HashToScalar => 1,
|
||||
|
||||
Self::Poseidon8Hash => 1,
|
||||
Self::Poseidon8HashToGroup => 1,
|
||||
Self::Poseidon8HashToScalar => 1,
|
||||
|
||||
Self::MappingGet => 2,
|
||||
Self::MappingGetOrInit => 3,
|
||||
|
@ -158,7 +158,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result<Va
|
||||
&inputs,
|
||||
rng,
|
||||
) {
|
||||
Ok((response, _, _, _)) => format!(
|
||||
Ok((response, _)) => format!(
|
||||
"[{}]",
|
||||
response
|
||||
.outputs()
|
||||
|
@ -408,6 +408,16 @@ impl<'a> TypeChecker<'a> {
|
||||
self.assert_scalar_type(&arguments[1].0, arguments[1].1);
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::BHP256CommitToGroup
|
||||
| CoreFunction::BHP512CommitToGroup
|
||||
| CoreFunction::BHP768CommitToGroup
|
||||
| CoreFunction::BHP1024CommitToGroup => {
|
||||
// Check that the first argument is not a mapping, tuple, err, or unit type.
|
||||
check_not_mapping_tuple_err_unit(&arguments[0].0, &arguments[0].1);
|
||||
// Check that the second argument is a scalar.
|
||||
self.assert_scalar_type(&arguments[1].0, arguments[1].1);
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::BHP256Hash
|
||||
| CoreFunction::BHP512Hash
|
||||
| CoreFunction::BHP768Hash
|
||||
@ -416,12 +426,28 @@ impl<'a> TypeChecker<'a> {
|
||||
check_not_mapping_tuple_err_unit(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::BHP256HashToGroup
|
||||
| CoreFunction::BHP512HashToGroup
|
||||
| CoreFunction::BHP768HashToGroup
|
||||
| CoreFunction::BHP1024HashToGroup => {
|
||||
// Check that the first argument is not a mapping, tuple, err, or unit type.
|
||||
check_not_mapping_tuple_err_unit(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::Pedersen64Commit => {
|
||||
// Check that the first argument is either a boolean, integer up to 64 bits, or field element.
|
||||
check_pedersen_64_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
// Check that the second argument is a scalar.
|
||||
self.assert_scalar_type(&arguments[1].0, arguments[1].1);
|
||||
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::Pedersen64CommitToGroup => {
|
||||
// Check that the first argument is either a boolean, integer up to 64 bits, or field element.
|
||||
check_pedersen_64_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
// Check that the second argument is a scalar.
|
||||
self.assert_scalar_type(&arguments[1].0, arguments[1].1);
|
||||
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::Pedersen64Hash => {
|
||||
@ -429,12 +455,25 @@ impl<'a> TypeChecker<'a> {
|
||||
check_pedersen_64_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::Pedersen64HashToGroup => {
|
||||
// Check that the first argument is either a boolean, integer up to 64 bits, or field element.
|
||||
check_pedersen_64_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::Pedersen128Commit => {
|
||||
// Check that the first argument is either a boolean, integer, or field element.
|
||||
check_pedersen_128_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
// Check that the second argument is a scalar.
|
||||
self.assert_scalar_type(&arguments[1].0, arguments[1].1);
|
||||
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::Pedersen128CommitToGroup => {
|
||||
// Check that the first argument is either a boolean, integer, or field element.
|
||||
check_pedersen_128_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
// Check that the second argument is a scalar.
|
||||
self.assert_scalar_type(&arguments[1].0, arguments[1].1);
|
||||
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::Pedersen128Hash => {
|
||||
@ -442,11 +481,30 @@ impl<'a> TypeChecker<'a> {
|
||||
check_pedersen_128_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::Pedersen128HashToGroup => {
|
||||
// Check that the first argument is either a boolean, integer, or field element.
|
||||
check_pedersen_128_bit_input(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::Poseidon2Hash | CoreFunction::Poseidon4Hash | CoreFunction::Poseidon8Hash => {
|
||||
// Check that the first argument is not a mapping, tuple, err, or unit type.
|
||||
check_not_mapping_tuple_err_unit(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Field)
|
||||
}
|
||||
CoreFunction::Poseidon2HashToGroup
|
||||
| CoreFunction::Poseidon4HashToGroup
|
||||
| CoreFunction::Poseidon8HashToGroup => {
|
||||
// Check that the first argument is not a mapping, tuple, err, or unit type.
|
||||
check_not_mapping_tuple_err_unit(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Group)
|
||||
}
|
||||
CoreFunction::Poseidon2HashToScalar
|
||||
| CoreFunction::Poseidon4HashToScalar
|
||||
| CoreFunction::Poseidon8HashToScalar => {
|
||||
// Check that the first argument is not a mapping, tuple, err, or unit type.
|
||||
check_not_mapping_tuple_err_unit(&arguments[0].0, &arguments[0].1);
|
||||
Some(Type::Scalar)
|
||||
}
|
||||
CoreFunction::MappingGet => {
|
||||
// Check that the operation is invoked in a `finalize` block.
|
||||
if !self.is_finalize {
|
||||
|
@ -150,9 +150,12 @@ symbols! {
|
||||
BHP768,
|
||||
BHP1024,
|
||||
commit,
|
||||
commit_to_group,
|
||||
get,
|
||||
get_or_init,
|
||||
hash,
|
||||
hash_to_group,
|
||||
hash_to_scalar,
|
||||
Mapping,
|
||||
Pedersen64,
|
||||
Pedersen128,
|
||||
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 2662c97bfa730010f7b4ce995a567349601aab7ed63975cc694b47a697aa2722
|
||||
unrolled_ast: 2662c97bfa730010f7b4ce995a567349601aab7ed63975cc694b47a697aa2722
|
||||
ssa_ast: 94d7b83fa0a924d6a7ed58f0505808abe1f2df80c7e8818ec6969c8e9b075854
|
||||
flattened_ast: ba0c8eb9f5b1bdf6165c0da3501f4f41e92ab08051751c22be7f62fcf4b64d2b
|
||||
inlined_ast: ba0c8eb9f5b1bdf6165c0da3501f4f41e92ab08051751c22be7f62fcf4b64d2b
|
||||
dce_ast: 31b15a99bfb924ba669f9748335dbbea33b995e9e7ec23ac6bbcba092a419c5e
|
||||
bytecode: 894b825c3222090c63e93a7df77b9af65fbacff4b6ce0f1a9e9f3f9663218d45
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: cc395069aef489311976800dcc187e25023d1bd88a58eefcd3e1d28a827712f1
|
||||
unrolled_ast: cc395069aef489311976800dcc187e25023d1bd88a58eefcd3e1d28a827712f1
|
||||
ssa_ast: b00508e2c217f4071ff3b4eab87853544f5664a102b1cc0453cafb7d644ec646
|
||||
flattened_ast: 05e8f4c1407ba6146d4c1576e66d93fdf4dda7195f79274e62d1edc2b1ed099f
|
||||
inlined_ast: 05e8f4c1407ba6146d4c1576e66d93fdf4dda7195f79274e62d1edc2b1ed099f
|
||||
dce_ast: 8c59a550b60bd82ef2791cc90928a1d1dfad93869adf03d4d4b19bff241e83b9
|
||||
bytecode: 2a72dbdc11a82c70c81d5badc9823afaf8fc17be5f1011ccfc405823eb17288d
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: e681dbe32f7db13b07ed2097fc6ae01a165c4e9979b68139c1c04498a67bc051
|
||||
unrolled_ast: e681dbe32f7db13b07ed2097fc6ae01a165c4e9979b68139c1c04498a67bc051
|
||||
ssa_ast: cbdd5092fa34acfa824a7844568fc4b2a3805b8a8e1176fccb95d255557f8b4b
|
||||
flattened_ast: 0d489666676a8a4a1d035e16f3c54cbd80dbb6275fccf7fab8ad7519ad4798a2
|
||||
inlined_ast: 0d489666676a8a4a1d035e16f3c54cbd80dbb6275fccf7fab8ad7519ad4798a2
|
||||
dce_ast: f8a5fc99d822738457538389d4309a6783738c96b7668a8c5f92230e753e4201
|
||||
bytecode: 12173d7eec287a32e15d3b8097b6cde457eb0ac888b0f811000f37c523fdcc5a
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 6544310db754c6167e82a0b696a304d4bcc254905745ad35e756dcea86b0174f
|
||||
unrolled_ast: 6544310db754c6167e82a0b696a304d4bcc254905745ad35e756dcea86b0174f
|
||||
ssa_ast: 35ce8a507b88ec78c140de3ae32526f85d556506cdeffae12158bf2911c35315
|
||||
flattened_ast: 2ebe1f0eda2a22e4fa4e55b941d282ba3bee93c648daa17956c816c507b6819f
|
||||
inlined_ast: 2ebe1f0eda2a22e4fa4e55b941d282ba3bee93c648daa17956c816c507b6819f
|
||||
dce_ast: 407200c8d6adc3bf05b8d9527c8bf2296bfc29eae029acfde2bb4e34e609d6ef
|
||||
bytecode: 8a35316b4d52095d0bc7b17a29dd902d1335578e5e02bf9bd272091004415138
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: bd49769df0bb001515927e9ed4cd0091ddf2fe02f82e7c84a8e199041a31e7e5
|
||||
unrolled_ast: bd49769df0bb001515927e9ed4cd0091ddf2fe02f82e7c84a8e199041a31e7e5
|
||||
ssa_ast: 114767a310734f9a6a2b60c8102896ab17c82083e476c1099e6b0145fa01c640
|
||||
flattened_ast: 5580671ef587347e0057dd9ac37d8064cd37630ba59ca5f89fd01b3016d504f6
|
||||
inlined_ast: 5580671ef587347e0057dd9ac37d8064cd37630ba59ca5f89fd01b3016d504f6
|
||||
dce_ast: afc7d81e498d14347a3f703ba20efbed875a02cbdde709fcbecf64b4f761e2ba
|
||||
bytecode: 623905a2cc827561e01da42e7388cf0bb91cf862f83598954805d71f86671d3c
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: f01c0f3d14db54c5ca39441bbec0b5013dac283e3ce38d25150d42b8695da7eb
|
||||
unrolled_ast: f01c0f3d14db54c5ca39441bbec0b5013dac283e3ce38d25150d42b8695da7eb
|
||||
ssa_ast: 6948be436cd48a0f56e306afb86d9478f563e86e1e085c415973557ac0d2f07a
|
||||
flattened_ast: dae03f16ff0c7ae6b23ba92ade6c3ec6307ba51c0f62148f25a8cc06eebce809
|
||||
inlined_ast: dae03f16ff0c7ae6b23ba92ade6c3ec6307ba51c0f62148f25a8cc06eebce809
|
||||
dce_ast: 822d21f855ec65c56fc539d9d1ac7543f2caf52c5a4fa9d43754b0a2ac5e07a9
|
||||
bytecode: 1fd8edc2204d7c47792409a7701b412208426f44660ff724b1f18918724fe131
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 35a566318ea9f70935320a6d53ebd94e8422875886d7cd8c3ef69f76a181d391
|
||||
unrolled_ast: 35a566318ea9f70935320a6d53ebd94e8422875886d7cd8c3ef69f76a181d391
|
||||
ssa_ast: 4439ad4fab6c6610c091ee3a9651e1acb2d0e4011cbb1288a82c367602d9b238
|
||||
flattened_ast: 05d6a0c70b8b1651d661ac97a9b5c2041755a4ca53c7692da810511418347642
|
||||
inlined_ast: 05d6a0c70b8b1651d661ac97a9b5c2041755a4ca53c7692da810511418347642
|
||||
dce_ast: 81306d92353884f98738b8b91b47ff00c9d587c1f9255c53291a248c0913e26e
|
||||
bytecode: 25eaac0773a85c0302d29e22e1b3e1232bc9c773d36d67c153597126a058fe47
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: f4a5185aaf22a81ce21e1f6801b5719314d0bd9ad0eae656a5b91c2811a47188
|
||||
unrolled_ast: f4a5185aaf22a81ce21e1f6801b5719314d0bd9ad0eae656a5b91c2811a47188
|
||||
ssa_ast: eb0a59747157c25f84b4136f0179ee6ebac70022d289bbe5cac63d26204a3dba
|
||||
flattened_ast: 415ecabf28f627b3456ce6cbe038a8df0a20f69a344adda58ce6184342d404ad
|
||||
inlined_ast: 415ecabf28f627b3456ce6cbe038a8df0a20f69a344adda58ce6184342d404ad
|
||||
dce_ast: 03b6e755c1c4cd36b455e4cfb9b31b1d2788c6eaf56a7b9111ceb037a57f7d9b
|
||||
bytecode: 1d01099dce5b3fbbd2b9f68dd2ff1c94faff841d42d3a536557ac9ab628abfed
|
||||
warnings: ""
|
@ -2,8 +2,8 @@
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 1c13802720b3a14ccb2b0df3a1a22dbe8ebea504b78d222bc16d7022d9cef670
|
||||
unrolled_ast: 1c13802720b3a14ccb2b0df3a1a22dbe8ebea504b78d222bc16d7022d9cef670
|
||||
- - initial_ast: 3af51d98a67b4bf5ff8bcc29fa3134001353902f91536e6d6db3e1456fda30ba
|
||||
unrolled_ast: 3af51d98a67b4bf5ff8bcc29fa3134001353902f91536e6d6db3e1456fda30ba
|
||||
ssa_ast: a2ac60bce9a712bf60e0f88214354eb87ac8bae605e72e151960e4461ca895ba
|
||||
flattened_ast: ae4389c5f39e2b7f0dba71a8da6b1de1679e8f49c9c74b5b9cc12c9863e0750e
|
||||
inlined_ast: ae4389c5f39e2b7f0dba71a8da6b1de1679e8f49c9c74b5b9cc12c9863e0750e
|
||||
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 914b9d1ac13014740009aed933d2dc21e2c26b117c5018fedfda2c68ad96db5c
|
||||
unrolled_ast: 914b9d1ac13014740009aed933d2dc21e2c26b117c5018fedfda2c68ad96db5c
|
||||
ssa_ast: 20e2208c9001b62f82c98ef1a7a52ed24a8ccbdd500ae43d0b5d3ea12fbf5cf9
|
||||
flattened_ast: 035ecf0629bccda904425fa94c1c10f08f8ca5cf02eace0caaa809a5f4a03311
|
||||
inlined_ast: 035ecf0629bccda904425fa94c1c10f08f8ca5cf02eace0caaa809a5f4a03311
|
||||
dce_ast: e05e3319eaa4d5b06577df7552e10b68278fce38f1fa7b1bbd9ae68ee265e2ec
|
||||
bytecode: b0f6b5fc439a7454c2167fbeea3c1b70670b786dfe13e8d0ae722a4f3a34dcf6
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: a3557a8c2a35e00f71c3aa7d55b4bfcdad0c3cddc50b27b9323b8ff6832703cc
|
||||
unrolled_ast: a3557a8c2a35e00f71c3aa7d55b4bfcdad0c3cddc50b27b9323b8ff6832703cc
|
||||
ssa_ast: 2d1d9be674a6a3a22298d29975bb5d3d57d54cf635530dd88275ed782f85c914
|
||||
flattened_ast: 850169b39882ceaf3da1a21d8e54b3b47b5f3dd2ad2ce4a8f0bb6c29117304e7
|
||||
inlined_ast: 850169b39882ceaf3da1a21d8e54b3b47b5f3dd2ad2ce4a8f0bb6c29117304e7
|
||||
dce_ast: a4fc65b056b79409cdee55a33aaf2128ecef1ac23951ef72e2989d7539994a6b
|
||||
bytecode: 8dea651218677e866518a32a71af47308cdffa8b9ecf3101b458b001b20136f4
|
||||
warnings: ""
|
@ -2,8 +2,8 @@
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: dc173a1cfc3721e31cf6ab23f3ec05b049b8b36c1f20bbbf384d0ef08a8eeced
|
||||
unrolled_ast: dc173a1cfc3721e31cf6ab23f3ec05b049b8b36c1f20bbbf384d0ef08a8eeced
|
||||
- - initial_ast: a8213677af994e6d58ccb31f015f55448f2a9d46c8ca4e8a01055008258fa1b9
|
||||
unrolled_ast: a8213677af994e6d58ccb31f015f55448f2a9d46c8ca4e8a01055008258fa1b9
|
||||
ssa_ast: c596ff010c5cf146f5709e73bc7a37ae9f25b572b5e08efa27bf1983c63b7b16
|
||||
flattened_ast: 1902e033f0557a18eeebdcf6af2f925b3481d78c802b08cdbc382c918e5f1289
|
||||
inlined_ast: 1902e033f0557a18eeebdcf6af2f925b3481d78c802b08cdbc382c918e5f1289
|
||||
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 5f24510ae4990d52d71a11468476510ac2e3be659c65dc3517a4dc723d0cfc65
|
||||
unrolled_ast: 5f24510ae4990d52d71a11468476510ac2e3be659c65dc3517a4dc723d0cfc65
|
||||
ssa_ast: 33d55b081962845887660fcc0bee519ab85376c567ca67fe25cee5ffe55bc6ec
|
||||
flattened_ast: 074713342dcbe13f54cb8dc1fe0ff08ce19ce8b1c397c2878277e683bd23fe84
|
||||
inlined_ast: 074713342dcbe13f54cb8dc1fe0ff08ce19ce8b1c397c2878277e683bd23fe84
|
||||
dce_ast: b0ea05fbafdecb713f294b82cc1f4589bd56f4595c5b68bc55e8f3d95dae252c
|
||||
bytecode: 3ae5962ccedf485338289236c10f4958d2345efe88e53217ea64c6f2ca47b170
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: cfbd20089894590798872f84ae1e238163af65f71bb7036d3362af41815531b0
|
||||
unrolled_ast: cfbd20089894590798872f84ae1e238163af65f71bb7036d3362af41815531b0
|
||||
ssa_ast: afc657c2fe7c488dfca1657457960e798cd0b3968bef64a9487fe35e5031a78d
|
||||
flattened_ast: ba9ff506a188936bf360c36228d0f0d9302aad77646a4b84b6d677f6fee8e142
|
||||
inlined_ast: ba9ff506a188936bf360c36228d0f0d9302aad77646a4b84b6d677f6fee8e142
|
||||
dce_ast: 634012ee713b84e24b97851c3b5115da92838ef20aa3cc085a70c049db5dc793
|
||||
bytecode: 97d6df17c14fee1244abf89cfa5049a84c0d51a393b096d0094a9f58af78e999
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: 14654af45c6a85df418fa37210b54cd18dc110b8d2b6e7fc16ccffd94ce372a3
|
||||
unrolled_ast: 14654af45c6a85df418fa37210b54cd18dc110b8d2b6e7fc16ccffd94ce372a3
|
||||
ssa_ast: ef8f992c1452faa47bebf7a6054da7dd99b3847fd9246cf1460df779a77705f6
|
||||
flattened_ast: d68c356dfe216cc0c9757cb8870ef1cab3c5609f8ea3aaefe644849093b718b6
|
||||
inlined_ast: d68c356dfe216cc0c9757cb8870ef1cab3c5609f8ea3aaefe644849093b718b6
|
||||
dce_ast: efeaf9cc187bb73b8e6a0f80c0933c997a0116d381666ef2177751f0c4de2ffc
|
||||
bytecode: febde3fd1983a399670ab88b51936068c61c4758bbd0b74671db07d1831f3095
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: e0de8509e1ca0ee4a60580981011d7af89b1cdf7b93371e39025897e279ebe26
|
||||
unrolled_ast: e0de8509e1ca0ee4a60580981011d7af89b1cdf7b93371e39025897e279ebe26
|
||||
ssa_ast: 11969cc51f515db56fea6aff53271989d0dc76f1808ec4651ecedea18c4278e8
|
||||
flattened_ast: ad745f9dc720e9a29eab77c9337800ed5ff81347098683a5176666e0eaea3674
|
||||
inlined_ast: ad745f9dc720e9a29eab77c9337800ed5ff81347098683a5176666e0eaea3674
|
||||
dce_ast: a4dac9564e4b42c7d3d3de66f674b7965c9a375d4eb1da1e79e8f75a82833568
|
||||
bytecode: cd8ee5e6be24637c10a028edcc1a7a8fb211515cdcfa4e7d7cd6713c8080f181
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: a2919ec6a81b73b2d5f93ea85a6c681b9d0a3a00d84a59da53d9650f6dbeadf1
|
||||
unrolled_ast: a2919ec6a81b73b2d5f93ea85a6c681b9d0a3a00d84a59da53d9650f6dbeadf1
|
||||
ssa_ast: b94525b6a38270a0fd8bcde28999b0ed42805c72caa584c1d226988151a58504
|
||||
flattened_ast: 65f60d61fba5276746dff9860ff2a312682eeeec176d7a2fca40bbc7968a28cf
|
||||
inlined_ast: 65f60d61fba5276746dff9860ff2a312682eeeec176d7a2fca40bbc7968a28cf
|
||||
dce_ast: c87f0b4f182ad4c6d756efe0b16921646cf9abcfcc6ec0bfca4cb439e8c3037d
|
||||
bytecode: 376af6bf907f95404ff863b40e06066ad4344b9fb866ea39c148e046f6441f1e
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: e0bd09401222c15ae2846b6021607ac802397b225d71280606c7f8d57c0edfbf
|
||||
unrolled_ast: e0bd09401222c15ae2846b6021607ac802397b225d71280606c7f8d57c0edfbf
|
||||
ssa_ast: 06ff53da49ad901c14af8b5af472f6cd2e978e771c922caf1fee68c78b4ea92e
|
||||
flattened_ast: 42cc580ec062c289c412941686b948619e69dc33ecc2b649788f7a6a8632dff1
|
||||
inlined_ast: 42cc580ec062c289c412941686b948619e69dc33ecc2b649788f7a6a8632dff1
|
||||
dce_ast: 60b2130b193c9a2306427bf4b773751d8b112dfdedd2b1662b7e1aebc7c26840
|
||||
bytecode: 3cefdff4166b71e4cbac788a63b671e8caeadde1dd335a818d67f065936beb34
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: e3b519a1aaac224eac302c7e89d73f4ee09c7e2b11138869dda79cee59ab565d
|
||||
unrolled_ast: e3b519a1aaac224eac302c7e89d73f4ee09c7e2b11138869dda79cee59ab565d
|
||||
ssa_ast: 47988e813beab824e6071d913c37935915169484ee6ff81852c94bf294d554c7
|
||||
flattened_ast: 59d27af9a62895cd80b099bfe3b64810f06a18f48476bd49d814661cc1723f94
|
||||
inlined_ast: 59d27af9a62895cd80b099bfe3b64810f06a18f48476bd49d814661cc1723f94
|
||||
dce_ast: a1d0940f0e90223b20f9aa817e9ef5722ca3086288903522dede96d0375e761c
|
||||
bytecode: 7f67b00183b88ea4b2319e2931193bc55ccce041f6bf33318f5cf269089a94a9
|
||||
warnings: ""
|
@ -0,0 +1,12 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- - initial_ast: a25e01f525a2f42c442126101b2710d3cd04d5c6cc089a74cefe0690bc0f5b38
|
||||
unrolled_ast: a25e01f525a2f42c442126101b2710d3cd04d5c6cc089a74cefe0690bc0f5b38
|
||||
ssa_ast: bb12e19f00fa9eb81521fc674ad2e105213496648b8ccdae851b6f4a55b8bf2f
|
||||
flattened_ast: 4560beebd8d544528b315d1b96ad95dc2c86a60ab598eb77ea7bc579835e7eb5
|
||||
inlined_ast: 4560beebd8d544528b315d1b96ad95dc2c86a60ab598eb77ea7bc579835e7eb5
|
||||
dce_ast: fe0b6c837bdb9f3a8c7fc92a8bd8cc9032098c6c622b9390172ed02cacb3e56e
|
||||
bytecode: c659c60a540f04f2a64884c92c2d932022be18c066970c7fe4ab2ecbd1aebb13
|
||||
warnings: ""
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP1024 commit tests
|
||||
let a: group = BHP1024::commit_to_group(addr_value, 1scalar);
|
||||
let b: group = BHP1024::commit_to_group(bool_value, 1scalar);
|
||||
let c: group = BHP1024::commit_to_group(field_value, 1scalar);
|
||||
// let d: group = BHP1024::commit(group_value, 1scalar);
|
||||
let e: group = BHP1024::commit_to_group(i8_value, 1scalar);
|
||||
let f: group = BHP1024::commit_to_group(i16_value, 1scalar);
|
||||
let g: group = BHP1024::commit_to_group(i32_value, 1scalar);
|
||||
let h: group = BHP1024::commit_to_group(i64_value, 1scalar);
|
||||
let i: group = BHP1024::commit_to_group(i128_value, 1scalar);
|
||||
let j: group = BHP1024::commit_to_group(u8_value, 1scalar);
|
||||
let k: group = BHP1024::commit_to_group(u16_value, 1scalar);
|
||||
let l: group = BHP1024::commit_to_group(u32_value, 1scalar);
|
||||
let m: group = BHP1024::commit_to_group(u64_value, 1scalar);
|
||||
let n: group = BHP1024::commit_to_group(u128_value, 1scalar);
|
||||
let o: group = BHP1024::commit_to_group(scalar_value, 1scalar);
|
||||
// let p: group = BHP1024::commit_to_group(string_value, 1scalar);
|
||||
let q: group = BHP1024::commit_to_group(Foo { a: 1u128, b: 2u128 }, 1scalar);
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP1024 hash_to_group tests
|
||||
let a: group = BHP1024::hash_to_group(addr_value);
|
||||
let b: group = BHP1024::hash_to_group(bool_value);
|
||||
let c: group = BHP1024::hash_to_group(field_value);
|
||||
// let d: group = BHP1024::hash_to_group(group_value);
|
||||
let e: group = BHP1024::hash_to_group(i8_value);
|
||||
let f: group = BHP1024::hash_to_group(i16_value);
|
||||
let g: group = BHP1024::hash_to_group(i32_value);
|
||||
let h: group = BHP1024::hash_to_group(i64_value);
|
||||
let i: group = BHP1024::hash_to_group(i128_value);
|
||||
let j: group = BHP1024::hash_to_group(u8_value);
|
||||
let k: group = BHP1024::hash_to_group(u16_value);
|
||||
let l: group = BHP1024::hash_to_group(u32_value);
|
||||
let m: group = BHP1024::hash_to_group(u64_value);
|
||||
let n: group = BHP1024::hash_to_group(u128_value);
|
||||
let o: group = BHP1024::hash_to_group(scalar_value);
|
||||
// let p: group = BHP1024::hash_to_group(string_value);
|
||||
let q: group = BHP1024::hash_to_group(Foo { a: 1u128, b: 1u128 });
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP256 commit tests
|
||||
let a: group = BHP256::commit_to_group(addr_value, 1scalar);
|
||||
let b: group = BHP256::commit_to_group(bool_value, 1scalar);
|
||||
let c: group = BHP256::commit_to_group(field_value, 1scalar);
|
||||
// let d: group = BHP256::commit(group_value, 1scalar);
|
||||
let e: group = BHP256::commit_to_group(i8_value, 1scalar);
|
||||
let f: group = BHP256::commit_to_group(i16_value, 1scalar);
|
||||
let g: group = BHP256::commit_to_group(i32_value, 1scalar);
|
||||
let h: group = BHP256::commit_to_group(i64_value, 1scalar);
|
||||
let i: group = BHP256::commit_to_group(i128_value, 1scalar);
|
||||
let j: group = BHP256::commit_to_group(u8_value, 1scalar);
|
||||
let k: group = BHP256::commit_to_group(u16_value, 1scalar);
|
||||
let l: group = BHP256::commit_to_group(u32_value, 1scalar);
|
||||
let m: group = BHP256::commit_to_group(u64_value, 1scalar);
|
||||
let n: group = BHP256::commit_to_group(u128_value, 1scalar);
|
||||
let o: group = BHP256::commit_to_group(scalar_value, 1scalar);
|
||||
// let p: group = BHP256::commit_to_group(string_value, 1scalar);
|
||||
let q: group = BHP256::commit_to_group(Foo { a: 1u128, b: 2u128 }, 1scalar);
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP256 hash_to_group tests
|
||||
let a: group = BHP256::hash_to_group(addr_value);
|
||||
let b: group = BHP256::hash_to_group(bool_value);
|
||||
let c: group = BHP256::hash_to_group(field_value);
|
||||
// let d: group = BHP256::hash_to_group(group_value);
|
||||
let e: group = BHP256::hash_to_group(i8_value);
|
||||
let f: group = BHP256::hash_to_group(i16_value);
|
||||
let g: group = BHP256::hash_to_group(i32_value);
|
||||
let h: group = BHP256::hash_to_group(i64_value);
|
||||
let i: group = BHP256::hash_to_group(i128_value);
|
||||
let j: group = BHP256::hash_to_group(u8_value);
|
||||
let k: group = BHP256::hash_to_group(u16_value);
|
||||
let l: group = BHP256::hash_to_group(u32_value);
|
||||
let m: group = BHP256::hash_to_group(u64_value);
|
||||
let n: group = BHP256::hash_to_group(u128_value);
|
||||
let o: group = BHP256::hash_to_group(scalar_value);
|
||||
// let p: group = BHP256::hash_to_group(string_value);
|
||||
let q: group = BHP256::hash_to_group(Foo { a: 1u128, b: 1u128 });
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP512 commit tests
|
||||
let a: group = BHP512::commit_to_group(addr_value, 1scalar);
|
||||
let b: group = BHP512::commit_to_group(bool_value, 1scalar);
|
||||
let c: group = BHP512::commit_to_group(field_value, 1scalar);
|
||||
// let d: group = BHP512::commit(group_value, 1scalar);
|
||||
let e: group = BHP512::commit_to_group(i8_value, 1scalar);
|
||||
let f: group = BHP512::commit_to_group(i16_value, 1scalar);
|
||||
let g: group = BHP512::commit_to_group(i32_value, 1scalar);
|
||||
let h: group = BHP512::commit_to_group(i64_value, 1scalar);
|
||||
let i: group = BHP512::commit_to_group(i128_value, 1scalar);
|
||||
let j: group = BHP512::commit_to_group(u8_value, 1scalar);
|
||||
let k: group = BHP512::commit_to_group(u16_value, 1scalar);
|
||||
let l: group = BHP512::commit_to_group(u32_value, 1scalar);
|
||||
let m: group = BHP512::commit_to_group(u64_value, 1scalar);
|
||||
let n: group = BHP512::commit_to_group(u128_value, 1scalar);
|
||||
let o: group = BHP512::commit_to_group(scalar_value, 1scalar);
|
||||
// let p: group = BHP512::commit_to_group(string_value, 1scalar);
|
||||
let q: group = BHP512::commit_to_group(Foo { a: 1u128, b: 2u128 }, 1scalar);
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP512 hash_to_group tests
|
||||
let a: group = BHP512::hash_to_group(addr_value);
|
||||
let b: group = BHP512::hash_to_group(bool_value);
|
||||
let c: group = BHP512::hash_to_group(field_value);
|
||||
// let d: group = BHP512::hash_to_group(group_value);
|
||||
let e: group = BHP512::hash_to_group(i8_value);
|
||||
let f: group = BHP512::hash_to_group(i16_value);
|
||||
let g: group = BHP512::hash_to_group(i32_value);
|
||||
let h: group = BHP512::hash_to_group(i64_value);
|
||||
let i: group = BHP512::hash_to_group(i128_value);
|
||||
let j: group = BHP512::hash_to_group(u8_value);
|
||||
let k: group = BHP512::hash_to_group(u16_value);
|
||||
let l: group = BHP512::hash_to_group(u32_value);
|
||||
let m: group = BHP512::hash_to_group(u64_value);
|
||||
let n: group = BHP512::hash_to_group(u128_value);
|
||||
let o: group = BHP512::hash_to_group(scalar_value);
|
||||
// let p: group = BHP512::hash_to_group(string_value);
|
||||
let q: group = BHP512::hash_to_group(Foo { a: 1u128, b: 1u128 });
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP768 commit tests
|
||||
let a: group = BHP768::commit_to_group(addr_value, 1scalar);
|
||||
let b: group = BHP768::commit_to_group(bool_value, 1scalar);
|
||||
let c: group = BHP768::commit_to_group(field_value, 1scalar);
|
||||
// let d: group = BHP768::commit(group_value, 1scalar);
|
||||
let e: group = BHP768::commit_to_group(i8_value, 1scalar);
|
||||
let f: group = BHP768::commit_to_group(i16_value, 1scalar);
|
||||
let g: group = BHP768::commit_to_group(i32_value, 1scalar);
|
||||
let h: group = BHP768::commit_to_group(i64_value, 1scalar);
|
||||
let i: group = BHP768::commit_to_group(i128_value, 1scalar);
|
||||
let j: group = BHP768::commit_to_group(u8_value, 1scalar);
|
||||
let k: group = BHP768::commit_to_group(u16_value, 1scalar);
|
||||
let l: group = BHP768::commit_to_group(u32_value, 1scalar);
|
||||
let m: group = BHP768::commit_to_group(u64_value, 1scalar);
|
||||
let n: group = BHP768::commit_to_group(u128_value, 1scalar);
|
||||
let o: group = BHP768::commit_to_group(scalar_value, 1scalar);
|
||||
// let p: group = BHP768::commit_to_group(string_value, 1scalar);
|
||||
let q: group = BHP768::commit_to_group(Foo { a: 1u128, b: 2u128 }, 1scalar);
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta;
|
||||
let bool_value: bool = true;
|
||||
let field_value: field = 1field;
|
||||
// let group_value: group = (0, 1)group;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// BHP768 hash_to_group tests
|
||||
let a: group = BHP768::hash_to_group(addr_value);
|
||||
let b: group = BHP768::hash_to_group(bool_value);
|
||||
let c: group = BHP768::hash_to_group(field_value);
|
||||
// let d: group = BHP768::hash_to_group(group_value);
|
||||
let e: group = BHP768::hash_to_group(i8_value);
|
||||
let f: group = BHP768::hash_to_group(i16_value);
|
||||
let g: group = BHP768::hash_to_group(i32_value);
|
||||
let h: group = BHP768::hash_to_group(i64_value);
|
||||
let i: group = BHP768::hash_to_group(i128_value);
|
||||
let j: group = BHP768::hash_to_group(u8_value);
|
||||
let k: group = BHP768::hash_to_group(u16_value);
|
||||
let l: group = BHP768::hash_to_group(u32_value);
|
||||
let m: group = BHP768::hash_to_group(u64_value);
|
||||
let n: group = BHP768::hash_to_group(u128_value);
|
||||
let o: group = BHP768::hash_to_group(scalar_value);
|
||||
// let p: group = BHP768::hash_to_group(string_value);
|
||||
let q: group = BHP768::hash_to_group(Foo { a: 1u128, b: 1u128 });
|
||||
|
||||
return a + o;
|
||||
}}
|
@ -18,16 +18,16 @@ program test.aleo {
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Pedersen64 hash tests
|
||||
let a: group = Pedersen128::commit(bool_value, 1scalar);
|
||||
let b: group = Pedersen128::commit(i8_value, 1scalar);
|
||||
let c: group = Pedersen128::commit(i16_value, 1scalar);
|
||||
let d: group = Pedersen128::commit(i32_value, 1scalar);
|
||||
let e: group = Pedersen128::commit(i64_value, 1scalar);
|
||||
let f: group = Pedersen128::commit(u8_value, 1scalar);
|
||||
let g: group = Pedersen128::commit(u16_value, 1scalar);
|
||||
let h: group = Pedersen128::commit(u32_value, 1scalar);
|
||||
let i: group = Pedersen128::commit(u64_value, 1scalar);
|
||||
// let j11: group = Pedersen128::commit(string_value, 1scalar);
|
||||
let a: field = Pedersen128::commit(bool_value, 1scalar);
|
||||
let b: field = Pedersen128::commit(i8_value, 1scalar);
|
||||
let c: field = Pedersen128::commit(i16_value, 1scalar);
|
||||
let d: field = Pedersen128::commit(i32_value, 1scalar);
|
||||
let e: field = Pedersen128::commit(i64_value, 1scalar);
|
||||
let f: field = Pedersen128::commit(u8_value, 1scalar);
|
||||
let g: field = Pedersen128::commit(u16_value, 1scalar);
|
||||
let h: field = Pedersen128::commit(u32_value, 1scalar);
|
||||
let i: field = Pedersen128::commit(u64_value, 1scalar);
|
||||
// let j11: field = Pedersen128::commit(string_value, 1scalar);
|
||||
|
||||
return a == i;
|
||||
}}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> bool {
|
||||
let bool_value: bool = true;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Pedersen128 commit to group tests
|
||||
let a: group = Pedersen128::commit_to_group(bool_value, 1scalar);
|
||||
let b: group = Pedersen128::commit_to_group(i8_value, 1scalar);
|
||||
let c: group = Pedersen128::commit_to_group(i16_value, 1scalar);
|
||||
let d: group = Pedersen128::commit_to_group(i32_value, 1scalar);
|
||||
let e: group = Pedersen128::commit_to_group(i64_value, 1scalar);
|
||||
let f: group = Pedersen128::commit_to_group(u8_value, 1scalar);
|
||||
let g: group = Pedersen128::commit_to_group(u16_value, 1scalar);
|
||||
let h: group = Pedersen128::commit_to_group(u32_value, 1scalar);
|
||||
let i: group = Pedersen128::commit_to_group(u64_value, 1scalar);
|
||||
// let j11: group = Pedersen128::commit_to_group(string_value, 1scalar);
|
||||
|
||||
return a == i;
|
||||
}}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let bool_value: bool = true;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Pedersen128 hash_to_group tests
|
||||
let a: group = Pedersen128::hash_to_group(bool_value);
|
||||
let b: group = Pedersen128::hash_to_group(i8_value);
|
||||
let c: group = Pedersen128::hash_to_group(i16_value);
|
||||
let d: group = Pedersen128::hash_to_group(i32_value);
|
||||
let e: group = Pedersen128::hash_to_group(i64_value);
|
||||
let f: group = Pedersen128::hash_to_group(u8_value);
|
||||
let g: group = Pedersen128::hash_to_group(u16_value);
|
||||
let h: group = Pedersen128::hash_to_group(u32_value);
|
||||
let i: group = Pedersen128::hash_to_group(u64_value);
|
||||
// let j11: group = Pedersen128::hash(string_value);
|
||||
|
||||
return a + i;
|
||||
}}
|
@ -18,16 +18,16 @@ program test.aleo {
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Pedersen64 hash tests
|
||||
let a: group = Pedersen64::commit(bool_value, 1scalar);
|
||||
let b: group = Pedersen64::commit(i8_value, 1scalar);
|
||||
let c: group = Pedersen64::commit(i16_value, 1scalar);
|
||||
let d: group = Pedersen64::commit(i32_value, 1scalar);
|
||||
let e: group = Pedersen64::commit(i64_value, 1scalar);
|
||||
let f: group = Pedersen64::commit(u8_value, 1scalar);
|
||||
let g: group = Pedersen64::commit(u16_value, 1scalar);
|
||||
let h: group = Pedersen64::commit(u32_value, 1scalar);
|
||||
let i: group = Pedersen64::commit(u64_value, 1scalar);
|
||||
// let j11: group = Pedersen64::commit(string_value, 1scalar);
|
||||
let a: field = Pedersen64::commit(bool_value, 1scalar);
|
||||
let b: field = Pedersen64::commit(i8_value, 1scalar);
|
||||
let c: field = Pedersen64::commit(i16_value, 1scalar);
|
||||
let d: field = Pedersen64::commit(i32_value, 1scalar);
|
||||
let e: field = Pedersen64::commit(i64_value, 1scalar);
|
||||
let f: field = Pedersen64::commit(u8_value, 1scalar);
|
||||
let g: field = Pedersen64::commit(u16_value, 1scalar);
|
||||
let h: field = Pedersen64::commit(u32_value, 1scalar);
|
||||
let i: field = Pedersen64::commit(u64_value, 1scalar);
|
||||
// let j11: field = Pedersen64::commit(string_value, 1scalar);
|
||||
|
||||
return a == i;
|
||||
}}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> bool {
|
||||
let bool_value: bool = true;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Pedersen64 commit to group tests
|
||||
let a: group = Pedersen64::commit_to_group(bool_value, 1scalar);
|
||||
let b: group = Pedersen64::commit_to_group(i8_value, 1scalar);
|
||||
let c: group = Pedersen64::commit_to_group(i16_value, 1scalar);
|
||||
let d: group = Pedersen64::commit_to_group(i32_value, 1scalar);
|
||||
let e: group = Pedersen64::commit_to_group(i64_value, 1scalar);
|
||||
let f: group = Pedersen64::commit_to_group(u8_value, 1scalar);
|
||||
let g: group = Pedersen64::commit_to_group(u16_value, 1scalar);
|
||||
let h: group = Pedersen64::commit_to_group(u32_value, 1scalar);
|
||||
let i: group = Pedersen64::commit_to_group(u64_value, 1scalar);
|
||||
// let j11: group = Pedersen64::commit_to_group(string_value, 1scalar);
|
||||
|
||||
return a == i;
|
||||
}}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let bool_value: bool = true;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Pedersen64 hash_to_group tests
|
||||
let a: group = Pedersen64::hash_to_group(bool_value);
|
||||
let b: group = Pedersen64::hash_to_group(i8_value);
|
||||
let c: group = Pedersen64::hash_to_group(i16_value);
|
||||
let d: group = Pedersen64::hash_to_group(i32_value);
|
||||
let e: group = Pedersen64::hash_to_group(i64_value);
|
||||
let f: group = Pedersen64::hash_to_group(u8_value);
|
||||
let g: group = Pedersen64::hash_to_group(u16_value);
|
||||
let h: group = Pedersen64::hash_to_group(u32_value);
|
||||
let i: group = Pedersen64::hash_to_group(u64_value);
|
||||
// let j11: group = Pedersen64::hash_to_group(string_value);
|
||||
|
||||
return a + i;
|
||||
}}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let field_value: field = 1field;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Poseidon2 hash_to_group tests
|
||||
let a: group = Poseidon2::hash_to_group(field_value);
|
||||
let b: group = Poseidon2::hash_to_group(i8_value);
|
||||
let c: group = Poseidon2::hash_to_group(i16_value);
|
||||
let d: group = Poseidon2::hash_to_group(i32_value);
|
||||
let e: group = Poseidon2::hash_to_group(i64_value);
|
||||
let f: group = Poseidon2::hash_to_group(i128_value);
|
||||
let g: group = Poseidon2::hash_to_group(u8_value);
|
||||
let h: group = Poseidon2::hash_to_group(u16_value);
|
||||
let i: group = Poseidon2::hash_to_group(u32_value);
|
||||
let j: group = Poseidon2::hash_to_group(u64_value);
|
||||
let k: group = Poseidon2::hash_to_group(u128_value);
|
||||
let l: group = Poseidon2::hash_to_group(scalar_value);
|
||||
// let m: group = Poseidon2::hash_to_group(string_value);
|
||||
let n: group = Poseidon2::hash_to_group(Foo { a: 1u128, b: 2u128 });
|
||||
|
||||
return a + l;
|
||||
}}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> scalar {
|
||||
let field_value: field = 1field;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Poseidon2 hash_to_scalar tests
|
||||
let a: scalar = Poseidon2::hash_to_scalar(field_value);
|
||||
let b: scalar = Poseidon2::hash_to_scalar(i8_value);
|
||||
let c: scalar = Poseidon2::hash_to_scalar(i16_value);
|
||||
let d: scalar = Poseidon2::hash_to_scalar(i32_value);
|
||||
let e: scalar = Poseidon2::hash_to_scalar(i64_value);
|
||||
let f: scalar = Poseidon2::hash_to_scalar(i128_value);
|
||||
let g: scalar = Poseidon2::hash_to_scalar(u8_value);
|
||||
let h: scalar = Poseidon2::hash_to_scalar(u16_value);
|
||||
let i: scalar = Poseidon2::hash_to_scalar(u32_value);
|
||||
let j: scalar = Poseidon2::hash_to_scalar(u64_value);
|
||||
let k: scalar = Poseidon2::hash_to_scalar(u128_value);
|
||||
let l: scalar = Poseidon2::hash_to_scalar(scalar_value);
|
||||
// let m: scalar = Poseidon2::hash_to_scalar(string_value);
|
||||
let n: scalar = Poseidon2::hash_to_scalar(Foo { a: 1u128, b: 2u128 });
|
||||
|
||||
return a + l;
|
||||
}}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let field_value: field = 1field;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Poseidon4 hash_to_group tests
|
||||
let a: group = Poseidon4::hash_to_group(field_value);
|
||||
let b: group = Poseidon4::hash_to_group(i8_value);
|
||||
let c: group = Poseidon4::hash_to_group(i16_value);
|
||||
let d: group = Poseidon4::hash_to_group(i32_value);
|
||||
let e: group = Poseidon4::hash_to_group(i64_value);
|
||||
let f: group = Poseidon4::hash_to_group(i128_value);
|
||||
let g: group = Poseidon4::hash_to_group(u8_value);
|
||||
let h: group = Poseidon4::hash_to_group(u16_value);
|
||||
let i: group = Poseidon4::hash_to_group(u32_value);
|
||||
let j: group = Poseidon4::hash_to_group(u64_value);
|
||||
let k: group = Poseidon4::hash_to_group(u128_value);
|
||||
let l: group = Poseidon4::hash_to_group(scalar_value);
|
||||
// let m: group = Poseidon4::hash_to_group(string_value);
|
||||
let n: group = Poseidon4::hash_to_group(Foo { a: 1u128, b: 2u128 });
|
||||
|
||||
return a + l;
|
||||
}}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> scalar {
|
||||
let field_value: field = 1field;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Poseidon4 hash_to_scalar tests
|
||||
let a: scalar = Poseidon4::hash_to_scalar(field_value);
|
||||
let b: scalar = Poseidon4::hash_to_scalar(i8_value);
|
||||
let c: scalar = Poseidon4::hash_to_scalar(i16_value);
|
||||
let d: scalar = Poseidon4::hash_to_scalar(i32_value);
|
||||
let e: scalar = Poseidon4::hash_to_scalar(i64_value);
|
||||
let f: scalar = Poseidon4::hash_to_scalar(i128_value);
|
||||
let g: scalar = Poseidon4::hash_to_scalar(u8_value);
|
||||
let h: scalar = Poseidon4::hash_to_scalar(u16_value);
|
||||
let i: scalar = Poseidon4::hash_to_scalar(u32_value);
|
||||
let j: scalar = Poseidon4::hash_to_scalar(u64_value);
|
||||
let k: scalar = Poseidon4::hash_to_scalar(u128_value);
|
||||
let l: scalar = Poseidon4::hash_to_scalar(scalar_value);
|
||||
// let m: scalar = Poseidon4::hash_to_scalar(string_value);
|
||||
let n: scalar = Poseidon4::hash_to_scalar(Foo { a: 1u128, b: 2u128 });
|
||||
|
||||
return a + l;
|
||||
}}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> group {
|
||||
let field_value: field = 1field;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Poseidon8 hash_to_group tests
|
||||
let a: group = Poseidon8::hash_to_group(field_value);
|
||||
let b: group = Poseidon8::hash_to_group(i8_value);
|
||||
let c: group = Poseidon8::hash_to_group(i16_value);
|
||||
let d: group = Poseidon8::hash_to_group(i32_value);
|
||||
let e: group = Poseidon8::hash_to_group(i64_value);
|
||||
let f: group = Poseidon8::hash_to_group(i128_value);
|
||||
let g: group = Poseidon8::hash_to_group(u8_value);
|
||||
let h: group = Poseidon8::hash_to_group(u16_value);
|
||||
let i: group = Poseidon8::hash_to_group(u32_value);
|
||||
let j: group = Poseidon8::hash_to_group(u64_value);
|
||||
let k: group = Poseidon8::hash_to_group(u128_value);
|
||||
let l: group = Poseidon8::hash_to_group(scalar_value);
|
||||
// let m: group = Poseidon8::hash_to_group(string_value);
|
||||
let n: group = Poseidon8::hash_to_group(Foo { a: 1u128, b: 2u128 });
|
||||
|
||||
return a + l;
|
||||
}}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
*/
|
||||
|
||||
program test.aleo {
|
||||
struct Foo {
|
||||
a: u128,
|
||||
b: u128,
|
||||
}
|
||||
|
||||
transition main(
|
||||
i8_value: i8,
|
||||
i16_value: i16,
|
||||
i32_value: i32,
|
||||
i64_value: i64,
|
||||
u8_value: u8,
|
||||
u16_value: u16,
|
||||
u32_value: u32,
|
||||
u64_value: u64,
|
||||
) -> scalar {
|
||||
let field_value: field = 1field;
|
||||
let i128_value: i128 = 1i128;
|
||||
let u128_value: u128 = 1u128;
|
||||
let scalar_value: scalar = 1scalar;
|
||||
// let string_value: string = "helloworld";
|
||||
|
||||
// Poseidon8 hash_to_scalar tests
|
||||
let a: scalar = Poseidon8::hash_to_scalar(field_value);
|
||||
let b: scalar = Poseidon8::hash_to_scalar(i8_value);
|
||||
let c: scalar = Poseidon8::hash_to_scalar(i16_value);
|
||||
let d: scalar = Poseidon8::hash_to_scalar(i32_value);
|
||||
let e: scalar = Poseidon8::hash_to_scalar(i64_value);
|
||||
let f: scalar = Poseidon8::hash_to_scalar(i128_value);
|
||||
let g: scalar = Poseidon8::hash_to_scalar(u8_value);
|
||||
let h: scalar = Poseidon8::hash_to_scalar(u16_value);
|
||||
let i: scalar = Poseidon8::hash_to_scalar(u32_value);
|
||||
let j: scalar = Poseidon8::hash_to_scalar(u64_value);
|
||||
let k: scalar = Poseidon8::hash_to_scalar(u128_value);
|
||||
let l: scalar = Poseidon8::hash_to_scalar(scalar_value);
|
||||
// let m: scalar = Poseidon8::hash_to_scalar(string_value);
|
||||
let n: scalar = Poseidon8::hash_to_scalar(Foo { a: 1u128, b: 2u128 });
|
||||
|
||||
return a + l;
|
||||
}}
|
Loading…
Reference in New Issue
Block a user