From edcf90580eb72a3d74c8e15bc3b5538ad9476b3c Mon Sep 17 00:00:00 2001 From: d0cd Date: Mon, 18 Sep 2023 12:52:52 -0400 Subject: [PATCH 1/7] Fix inlining issue (#2581) --- compiler/ast/src/passes/reconstructor.rs | 22 ++++++++++++- .../expectations/compiler/examples/board.out | 2 +- tests/expectations/compiler/examples/move.out | 2 +- tests/expectations/compiler/examples/vote.out | 2 +- .../flatten_inlined_tuples_of_structs.out | 6 ++-- .../records/init_expression_shorthand.out | 2 +- .../records/record_init_out_of_order.out | 2 +- .../flattened_function_and_inline_matches.out | 28 ++++++++-------- tests/expectations/execution/mint.out | 2 +- .../flattened_function_and_inline_matches.leo | 32 +++++++++++++------ 10 files changed, 66 insertions(+), 34 deletions(-) diff --git a/compiler/ast/src/passes/reconstructor.rs b/compiler/ast/src/passes/reconstructor.rs index 171312bfaf..8bae31b563 100644 --- a/compiler/ast/src/passes/reconstructor.rs +++ b/compiler/ast/src/passes/reconstructor.rs @@ -114,7 +114,27 @@ pub trait ExpressionReconstructor { } fn reconstruct_struct_init(&mut self, input: StructExpression) -> (Expression, Self::AdditionalOutput) { - (Expression::Struct(input), Default::default()) + ( + Expression::Struct(StructExpression { + name: input.name, + members: input + .members + .into_iter() + .map(|member| StructVariableInitializer { + identifier: member.identifier, + expression: match member.expression { + Some(expression) => Some(self.reconstruct_expression(expression).0), + None => Some(self.reconstruct_expression(Expression::Identifier(member.identifier)).0), + }, + span: member.span, + id: member.id, + }) + .collect(), + span: input.span, + id: input.id, + }), + Default::default(), + ) } fn reconstruct_err(&mut self, _input: ErrExpression) -> (Expression, Self::AdditionalOutput) { diff --git a/tests/expectations/compiler/examples/board.out b/tests/expectations/compiler/examples/board.out index 9fd952ced5..bb090727e2 100644 --- a/tests/expectations/compiler/examples/board.out +++ b/tests/expectations/compiler/examples/board.out @@ -6,7 +6,7 @@ outputs: type_checked_symbol_table: 747ce7178d5222a287460a44a6af1dda0d4d2646d3dafca6a24f3a1c71de86ce unrolled_symbol_table: 747ce7178d5222a287460a44a6af1dda0d4d2646d3dafca6a24f3a1c71de86ce initial_ast: d5be8fee6d81e342960c0422830cad66747617795c5fa7adaedb2088dce3be97 - unrolled_ast: d5be8fee6d81e342960c0422830cad66747617795c5fa7adaedb2088dce3be97 + unrolled_ast: f85ac52da5c38ffb02718a9d5e69c840362012106291fee2348c3d937568f996 ssa_ast: 304bd2dd3450cd385a9f760eea0519cd86025712e4a11da1403b8bffb23816fe flattened_ast: 2826ed0f1c04c254a9caef5459eeeb756f0868b9680d6dda27689c86ec856602 inlined_ast: 2826ed0f1c04c254a9caef5459eeeb756f0868b9680d6dda27689c86ec856602 diff --git a/tests/expectations/compiler/examples/move.out b/tests/expectations/compiler/examples/move.out index 05a4ecd4b3..23c9248165 100644 --- a/tests/expectations/compiler/examples/move.out +++ b/tests/expectations/compiler/examples/move.out @@ -6,7 +6,7 @@ outputs: type_checked_symbol_table: 1d7d583684c95811cd86e4ed36c9d20ac015eef8804fa6f5a9a53b5648c5d0c2 unrolled_symbol_table: 1d7d583684c95811cd86e4ed36c9d20ac015eef8804fa6f5a9a53b5648c5d0c2 initial_ast: bd5d74d72808b4c41ce341a9de74a1c97c825cdf6f682e37c24500468f10be7f - unrolled_ast: bd5d74d72808b4c41ce341a9de74a1c97c825cdf6f682e37c24500468f10be7f + unrolled_ast: e9fe622558335f8a9e478050ceb11174df84db5c7dac987500d81b69daf25375 ssa_ast: bdf2b040f0aa692dabb75d575d09d874194812e717ea89ae36c0bbbd8477a686 flattened_ast: ebabd9d811704b1e60109ca18e2091c63c740005712e3b8e475f8bd0ed48f110 inlined_ast: ebabd9d811704b1e60109ca18e2091c63c740005712e3b8e475f8bd0ed48f110 diff --git a/tests/expectations/compiler/examples/vote.out b/tests/expectations/compiler/examples/vote.out index ffa74606cb..89826d578f 100644 --- a/tests/expectations/compiler/examples/vote.out +++ b/tests/expectations/compiler/examples/vote.out @@ -6,7 +6,7 @@ outputs: type_checked_symbol_table: 1ffc999a1854e9e7698468455416d3e4a8633b1295681d4598ec850b49e41cc8 unrolled_symbol_table: 1ffc999a1854e9e7698468455416d3e4a8633b1295681d4598ec850b49e41cc8 initial_ast: cfa18935bddbcde425dfcd4420cdc332bc22cb8f20347c19e974e5745175c448 - unrolled_ast: cfa18935bddbcde425dfcd4420cdc332bc22cb8f20347c19e974e5745175c448 + unrolled_ast: f14edaac6648de812672a9b72416d49ba67aa74aee127572fe791adf26c21261 ssa_ast: 9db70fe3ef5b857ba47ade60a4dce039ff7afed2fcccd82ed484f5f0d10a839b flattened_ast: f766a37610cbe458b5a2cc6a22652be6041b07a128899d66b1f449c4bc6ebb65 inlined_ast: f766a37610cbe458b5a2cc6a22652be6041b07a128899d66b1f449c4bc6ebb65 diff --git a/tests/expectations/compiler/function/flatten_inlined_tuples_of_structs.out b/tests/expectations/compiler/function/flatten_inlined_tuples_of_structs.out index d537148ee8..93e7f63edd 100644 --- a/tests/expectations/compiler/function/flatten_inlined_tuples_of_structs.out +++ b/tests/expectations/compiler/function/flatten_inlined_tuples_of_structs.out @@ -9,7 +9,7 @@ outputs: unrolled_ast: bd57ac53308a67d19485d7f29a006bdd8d780ca05f2427ba0393e63ac000afd9 ssa_ast: 028180997e2f609c93e912c59bb2b84dc43c33ea8aec28ef1e651659f05e961c flattened_ast: 48008bc440590f8d6f7eec80daffb815a5c340efe5d389fe73a8bf28e236f025 - inlined_ast: 8b336b9b7625dcdcb9f70568d2aacf41386860af6f2d8b34789dff18c0b18e9c - dce_ast: 8b336b9b7625dcdcb9f70568d2aacf41386860af6f2d8b34789dff18c0b18e9c - bytecode: 7602c293bf2fee12ca5d58f3651e9a5699a3c1350fc34b8000dfc598ecd77226 + inlined_ast: 67800ff1866545d51b8cb58cf19307ad33e11e1d1c9a329d58ca965657d2809e + dce_ast: 67800ff1866545d51b8cb58cf19307ad33e11e1d1c9a329d58ca965657d2809e + bytecode: fffe093215f68fcc292f2c7b67e847897cd0334cdbf4a410f288d7957541a1d3 warnings: "" diff --git a/tests/expectations/compiler/records/init_expression_shorthand.out b/tests/expectations/compiler/records/init_expression_shorthand.out index ff9d0c2c70..10fe7d59c4 100644 --- a/tests/expectations/compiler/records/init_expression_shorthand.out +++ b/tests/expectations/compiler/records/init_expression_shorthand.out @@ -6,7 +6,7 @@ outputs: type_checked_symbol_table: ba25da0ee16aeea7f700fb370ea16e4fc2ba379bcf5fee6639826dcd2541bb14 unrolled_symbol_table: ba25da0ee16aeea7f700fb370ea16e4fc2ba379bcf5fee6639826dcd2541bb14 initial_ast: 42727bc4ab4e9294867ee74a08e2fe78ff3112b999b4432135e52856576c8e99 - unrolled_ast: 42727bc4ab4e9294867ee74a08e2fe78ff3112b999b4432135e52856576c8e99 + unrolled_ast: 7f3d5e14802552b7d376dc7f809a962a99e49bf7b7b874cb9efea211873c59d6 ssa_ast: 45a7e89d56652adafaa251a2141711f47e772e2b55a4397e257892bebf01965b flattened_ast: 5b0af0aebd2d18b4af1d877c888ccc6b3fa29b2e591452720740f4eb678b08d4 inlined_ast: 5b0af0aebd2d18b4af1d877c888ccc6b3fa29b2e591452720740f4eb678b08d4 diff --git a/tests/expectations/compiler/records/record_init_out_of_order.out b/tests/expectations/compiler/records/record_init_out_of_order.out index f45e60bec7..bfb63d5bdf 100644 --- a/tests/expectations/compiler/records/record_init_out_of_order.out +++ b/tests/expectations/compiler/records/record_init_out_of_order.out @@ -6,7 +6,7 @@ outputs: type_checked_symbol_table: 6c6790dd39288815379930977d3d72470a1449cd1b1993c0808cd53534d1f826 unrolled_symbol_table: 6c6790dd39288815379930977d3d72470a1449cd1b1993c0808cd53534d1f826 initial_ast: d62a5becf30494a5c07d515c158267012b6d1c3fdeb88fb07e2f054381cf8acd - unrolled_ast: d62a5becf30494a5c07d515c158267012b6d1c3fdeb88fb07e2f054381cf8acd + unrolled_ast: abcbeedd216970478f0f15f4183a6cbb672601ae80e98ee74cde45e87bc83d40 ssa_ast: ffe50cb7be9258000936ebe65897df029f1d552661be9e398cf932536a04a5c6 flattened_ast: 4efc05812dd074b640d27237c1efbeb006d2948ba97e377be1acaa92ca246a64 inlined_ast: 4efc05812dd074b640d27237c1efbeb006d2948ba97e377be1acaa92ca246a64 diff --git a/tests/expectations/execution/flattened_function_and_inline_matches.out b/tests/expectations/execution/flattened_function_and_inline_matches.out index 7be9aa6f80..5128f891b4 100644 --- a/tests/expectations/execution/flattened_function_and_inline_matches.out +++ b/tests/expectations/execution/flattened_function_and_inline_matches.out @@ -2,33 +2,33 @@ namespace: Execute expectation: Pass outputs: - - - initial_symbol_table: 054d3814a6ee68b36846e8bb0a850749c9f80828a06106a3408c3a3445bf9e5c - type_checked_symbol_table: 13284925b72baff0d5ecb7bb256a8bfb9fd6e3f936997707c6c832b3f2d34b43 - unrolled_symbol_table: 13284925b72baff0d5ecb7bb256a8bfb9fd6e3f936997707c6c832b3f2d34b43 - initial_ast: 312ddd4f956e0c21463e992634f659afb147d2916b2dd3ea3b4cdf77da83ea2d - unrolled_ast: 312ddd4f956e0c21463e992634f659afb147d2916b2dd3ea3b4cdf77da83ea2d - ssa_ast: 916c11c30f5603bd550dd9f02a59cff5ad3dac9519817506e44ab4e041ae53dd - flattened_ast: fa0c633312b9e571902cc78901d6daf2f05121c9081ff23d76d5521af8b9dc35 - inlined_ast: f2fb9af6d7aa19ee8bad573bb9cdb2d96cb80022e2bbee84d0f2679e98a49259 - dce_ast: f2fb9af6d7aa19ee8bad573bb9cdb2d96cb80022e2bbee84d0f2679e98a49259 - bytecode: 05437006a7a0a278a18c8ff76e9fec336ec4f86f6ff8abfb06b816256babef45 + - - initial_symbol_table: 9ee9bfe1921cee5f4de19fea4d372a2a54deb758471e5745e12164eb44c447cb + type_checked_symbol_table: 8c2546e10d7482d30a2650f0119041c8a6a20201eb47a4facfe20336976e5654 + unrolled_symbol_table: 8c2546e10d7482d30a2650f0119041c8a6a20201eb47a4facfe20336976e5654 + initial_ast: 68d7ba720407b7ac2fc26611b2f22c2d2f43766df3a30c05745f152aa9d3caa0 + unrolled_ast: 68d7ba720407b7ac2fc26611b2f22c2d2f43766df3a30c05745f152aa9d3caa0 + ssa_ast: a66901fb9ee02bc0cd23f2ca49f2b47d7dea7ee398098bc3b72edbf01977b8cc + flattened_ast: 4e3c46685c28a9d7a4169000de7d3c888e3a0ad28500b17b31eb784d189ce86d + inlined_ast: 3fbe6e8a6cd5e19c47e8f8b0a9bceca1534a2219fb6a4443529056cdbb1799c7 + dce_ast: 3fbe6e8a6cd5e19c47e8f8b0a9bceca1534a2219fb6a4443529056cdbb1799c7 + bytecode: a52c852c5ea5e31d35c812e4ab15e4c098022431bb58b592d797137abf015e29 warnings: "" results: bar: - input: "[true, true, 1u8, 0u8]" - output: "[1u8, 1u8, {\n a: 1u8,\n b: 0u8,\n c: {\n c: 1u8\n }\n}]" + output: "[4u8, 1u8, {\n a: 2u8,\n b: 1u8,\n c: {\n c: 2u8\n }\n}]" - input: "[true, false, 1u8, 1u8]" output: "[1u8, 1u8, {\n a: 1u8,\n b: 1u8,\n c: {\n c: 1u8\n }\n}]" - input: "[false, true, 2u8, 1u8]" - output: "[1u8, 1u8, {\n a: 2u8,\n b: 1u8,\n c: {\n c: 2u8\n }\n}]" + output: "[5u8, 2u8, {\n a: 2u8,\n b: 1u8,\n c: {\n c: 2u8\n }\n}]" - input: "[false, false, 2u8, 2u8]" output: "[2u8, 2u8, {\n a: 2u8,\n b: 2u8,\n c: {\n c: 2u8\n }\n}]" blar: - input: "[true, true, 1u8, 0u8]" - output: "[1u8, 1u8, {\n a: 1u8,\n b: 1u8,\n c: {\n c: 1u8\n }\n}]" + output: "[4u8, 1u8, {\n a: 2u8,\n b: 1u8,\n c: {\n c: 2u8\n }\n}]" - input: "[true, false, 1u8, 1u8]" output: "[1u8, 1u8, {\n a: 1u8,\n b: 1u8,\n c: {\n c: 1u8\n }\n}]" - input: "[false, true, 2u8, 1u8]" - output: "[1u8, 1u8, {\n a: 1u8,\n b: 1u8,\n c: {\n c: 1u8\n }\n}]" + output: "[5u8, 2u8, {\n a: 2u8,\n b: 1u8,\n c: {\n c: 2u8\n }\n}]" - input: "[false, false, 2u8, 2u8]" output: "[2u8, 2u8, {\n a: 2u8,\n b: 2u8,\n c: {\n c: 2u8\n }\n}]" diff --git a/tests/expectations/execution/mint.out b/tests/expectations/execution/mint.out index 358ce52ef9..4c7a056f10 100644 --- a/tests/expectations/execution/mint.out +++ b/tests/expectations/execution/mint.out @@ -6,7 +6,7 @@ outputs: type_checked_symbol_table: 538833491862c70880a4292ef436391c2be4483e6bd4c144c53d1dbbe3d58740 unrolled_symbol_table: 538833491862c70880a4292ef436391c2be4483e6bd4c144c53d1dbbe3d58740 initial_ast: 52c7b2b75064c6546d44fc697f86b746d9cd07e316cfb4dc93cccabf63d0708c - unrolled_ast: 52c7b2b75064c6546d44fc697f86b746d9cd07e316cfb4dc93cccabf63d0708c + unrolled_ast: a0c8e83b0bbb7a6759b2bf5a4635aa9b19ff33d6edc3013ecdaa3ed76fcacf80 ssa_ast: afc1d818c985c0fd4aee5264405f7758c96810c5362c7764b71d60bc8da32ff5 flattened_ast: e24f4c783778f4b9508e45bef5d7e2c69eb220d8d16f3cb5c86cb5bb145ce19e inlined_ast: e24f4c783778f4b9508e45bef5d7e2c69eb220d8d16f3cb5c86cb5bb145ce19e diff --git a/tests/tests/execution/flattened_function_and_inline_matches.leo b/tests/tests/execution/flattened_function_and_inline_matches.leo index 1713215422..0e5799fec7 100644 --- a/tests/tests/execution/flattened_function_and_inline_matches.leo +++ b/tests/tests/execution/flattened_function_and_inline_matches.leo @@ -27,7 +27,7 @@ program test.aleo { c: Extra, } - inline foo(a: u8, b: u8) -> (u8, u8, Data) { + inline foo(a: u8, b: u8, input: Data) -> (u8, u8, Data) { let extra: Extra = Extra { c: a }; let data: Data = Data { a: a, b: b, c: extra }; if (a == b) { @@ -35,11 +35,13 @@ program test.aleo { } let c: u8 = a + b; let d: u8 = a - b; + c = c + input.a; + d = d + input.b; return (c, d, data); } - function floo(a: u8, b: u8) -> (u8, u8, Data) { + function floo(a: u8, b: u8, input: Data) -> (u8, u8, Data) { let extra: Extra = Extra { c: a }; let data: Data = Data { a: a, b: b, c: extra }; if (a == b) { @@ -47,33 +49,43 @@ program test.aleo { } let c: u8 = a + b; let d: u8 = a - b; + c = c + input.a; + d = d + input.b; return (c, d, data); } transition bar(flag1: bool, flag2: bool, a: u8, b: u8) -> (u8, u8, Data) { - let start: (u8, u8, Data) = foo(a, b); + let data: Data = Data { a: a, b: b, c: Extra { c: a } }; + let start: (u8, u8, Data) = foo(a, b, data); + // (2, 1, Data { a: 1, b: 0, c: Extra { c: 1 } }) if flag1 { - start = foo(start.0, start.2.c.c); + // foo (2, 1, Data { a: 1, b: 0, c: Extra { c: 1 } }) + start = foo(start.0, start.2.c.c, start.2); + // } else { if flag2 { - start = foo(start.1, start.2.b); + // foo (1, 0, Data { a: 1, b: 0, c: Extra { c: 1 } }) + start = foo(start.1, start.2.b, start.2); } else { - start = foo(start.2.a, start.1); + // foo (1, 1, Data { a: 1, b: 0, c: Extra { c: 1 } }) + start = foo(start.2.a, start.1, start.2); } } return start; } transition blar(flag1: bool, flag2: bool, a: u8, b: u8) -> (u8, u8, Data) { - let start: (u8, u8, Data) = floo(a, b); + let data: Data = Data { a: a, b: b, c: Extra { c: a } }; + + let start: (u8, u8, Data) = floo(a, b, data); if flag1 { - start = floo(start.0, start.2.c.c); + start = floo(start.0, start.2.c.c, start.2); } else { if flag2 { - start = floo(start.1, start.2.b); + start = floo(start.1, start.2.b, start.2); } else { - start = floo(start.2.a, start.1); + start = floo(start.2.a, start.1, start.2); } } return start; From 1f60ec10741f8ea420ceebb1f83c4163070d2ab5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:26:20 +0000 Subject: [PATCH 2/7] Bump clap from 4.4.3 to 4.4.4 Bumps [clap](https://github.com/clap-rs/clap) from 4.4.3 to 4.4.4. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.3...v4.4.4) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06ee0ca47b..ccb5cde527 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -461,9 +461,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.3" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", @@ -471,9 +471,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", From 4590a36ba881ec9fdb3d141c7ab9fb447ff04314 Mon Sep 17 00:00:00 2001 From: Collin Chin <16715212+collinc97@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:26:44 -0700 Subject: [PATCH 3/7] Add test to verify support of the ternary operator on signatures (#2594) * Add test to verify support of the ternary operator on signatures * regen expectations --- Cargo.lock | 153 +++++++++--------- .../compiler/signature/signature.out | 20 +-- .../execution/primitive_casts.out | 30 ++-- tests/tests/compiler/signature/signature.leo | 8 + 4 files changed, 110 insertions(+), 101 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccb5cde527..e0346814a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -664,6 +664,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -1370,7 +1376,7 @@ dependencies = [ "rand_core", "reqwest", "rusty-hook", - "self_update 0.38.0", + "self_update", "serde", "serde_json", "snarkvm", @@ -2252,24 +2258,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "self_update" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a667e18055120bcc9a658d55d36f2f6bfc82e07968cc479ee7774e3bfb501e14" -dependencies = [ - "hyper", - "indicatif", - "log", - "quick-xml", - "regex", - "reqwest", - "semver", - "serde_json", - "tempfile", - "urlencoding", -] - [[package]] name = "self_update" version = "0.38.0" @@ -2413,7 +2401,7 @@ dependencies = [ [[package]] name = "snarkvm" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "anstyle", "anyhow", @@ -2426,7 +2414,7 @@ dependencies = [ "parking_lot", "rand", "rayon", - "self_update 0.37.0", + "self_update", "serde_json", "snarkvm-circuit", "snarkvm-console", @@ -2442,7 +2430,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -2472,7 +2460,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2486,7 +2474,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-network", @@ -2497,7 +2485,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-types", "snarkvm-console-algorithms", @@ -2507,7 +2495,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-types", @@ -2517,7 +2505,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "itertools 0.11.0", @@ -2535,12 +2523,12 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" [[package]] name = "snarkvm-circuit-network" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2551,8 +2539,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ + "paste", "snarkvm-circuit-account", "snarkvm-circuit-collections", "snarkvm-circuit-network", @@ -2564,7 +2553,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2579,7 +2568,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2592,7 +2581,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-console-types-boolean", @@ -2601,7 +2590,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2611,7 +2600,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2623,7 +2612,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2634,7 +2623,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2645,7 +2634,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2657,7 +2646,7 @@ dependencies = [ [[package]] name = "snarkvm-console" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2670,7 +2659,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "bs58", "snarkvm-console-network", @@ -2680,19 +2669,20 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "blake2s_simd", "smallvec", "snarkvm-console-types", "snarkvm-fields", "snarkvm-utilities", + "tiny-keccak", ] [[package]] name = "snarkvm-console-collections" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "rayon", @@ -2703,7 +2693,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "anyhow", "indexmap 2.0.0", @@ -2726,7 +2716,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "anyhow", "bech32", @@ -2743,7 +2733,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "enum_index", "enum_index_derive", @@ -2751,6 +2741,7 @@ dependencies = [ "num-derive", "num-traits", "once_cell", + "paste", "serde_json", "snarkvm-console-account", "snarkvm-console-collections", @@ -2762,7 +2753,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -2777,7 +2768,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2788,7 +2779,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", ] @@ -2796,7 +2787,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2805,7 +2796,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2816,7 +2807,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2826,7 +2817,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2836,7 +2827,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2847,7 +2838,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "rand", "rayon", @@ -2861,7 +2852,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -2878,7 +2869,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -2902,7 +2893,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "anyhow", "rand", @@ -2914,7 +2905,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "rayon", @@ -2932,7 +2923,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-coinbase" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -2952,7 +2943,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "serde_json", @@ -2962,7 +2953,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-ledger-narwhal-batch-certificate", "snarkvm-ledger-narwhal-batch-header", @@ -2975,7 +2966,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "serde_json", @@ -2987,7 +2978,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "serde_json", @@ -2998,7 +2989,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "bytes", "serde_json", @@ -3009,7 +3000,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "serde_json", @@ -3021,7 +3012,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "bytes", "serde_json", @@ -3034,7 +3025,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "snarkvm-console", "snarkvm-ledger-coinbase", @@ -3043,7 +3034,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "async-trait", "reqwest", @@ -3056,7 +3047,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "anyhow", "bincode", @@ -3069,6 +3060,7 @@ dependencies = [ "snarkvm-ledger-block", "snarkvm-ledger-coinbase", "snarkvm-ledger-committee", + "snarkvm-ledger-narwhal-batch-certificate", "snarkvm-synthesizer-program", "snarkvm-synthesizer-snark", ] @@ -3076,7 +3068,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -3100,7 +3092,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -3124,7 +3116,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "colored", @@ -3145,7 +3137,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "indexmap 2.0.0", "paste", @@ -3159,7 +3151,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "bincode", "once_cell", @@ -3172,7 +3164,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "aleo-std", "anyhow", @@ -3191,7 +3183,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" version = "0.14.6" -source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#05d7a1f1e371d77583506a34501a3de8a2949ea6" +source = "git+https://github.com/AleoHQ/snarkVM.git?branch=testnet3#6d298690252025d769e061f204b7057bba0d8b8a" dependencies = [ "proc-macro2", "quote 1.0.33", @@ -3372,6 +3364,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinytemplate" version = "1.2.1" diff --git a/tests/expectations/compiler/signature/signature.out b/tests/expectations/compiler/signature/signature.out index b12f223ed1..cf03f47e8b 100644 --- a/tests/expectations/compiler/signature/signature.out +++ b/tests/expectations/compiler/signature/signature.out @@ -2,14 +2,14 @@ namespace: Compile expectation: Pass outputs: - - - initial_symbol_table: f32367f3791d0e1cd70f702ca24d2d9d9c2bc0ebf91e95d4df773a3e9f110311 - type_checked_symbol_table: ac9e67a73f66c89100172339eb6d66e2b8895f98c53ddeb525d2f42d6e3234ec - unrolled_symbol_table: ac9e67a73f66c89100172339eb6d66e2b8895f98c53ddeb525d2f42d6e3234ec - initial_ast: 66326647c8591d4479e5622bc50d2fffb7fcc9791925a7ab7018617a59b693a4 - unrolled_ast: 66326647c8591d4479e5622bc50d2fffb7fcc9791925a7ab7018617a59b693a4 - ssa_ast: 76f4f34b1e014012ba3ecc136b58787ed41de71f5ff83565f825258b9e8ea76f - flattened_ast: b0658ac6a7f5033380851c648f130884de04fde4bef415fa015e4d664aabb427 - inlined_ast: b0658ac6a7f5033380851c648f130884de04fde4bef415fa015e4d664aabb427 - dce_ast: b0658ac6a7f5033380851c648f130884de04fde4bef415fa015e4d664aabb427 - bytecode: 87b34bffefde3c2b9e23ce08528737a4ef06a28ee9120c02d26ee41989f24cd2 + - - initial_symbol_table: f42679f84a0502913466b98ad0802570b196a03efb92762dbf14ddef9343e2bb + type_checked_symbol_table: badc647bf125be858219463ee7be65a54c641b1a351a7f0b17012263cce0ad5a + unrolled_symbol_table: badc647bf125be858219463ee7be65a54c641b1a351a7f0b17012263cce0ad5a + initial_ast: 59fbd8ee485c056cbbd498752bdad37b1f6d1d333c50d05706db366d59d2514c + unrolled_ast: 59fbd8ee485c056cbbd498752bdad37b1f6d1d333c50d05706db366d59d2514c + ssa_ast: 489c00729522b46ad624db1d6f7bd6548dc03784beaa68ba9fa31ff018c7bc24 + flattened_ast: fdfe1266895c258a1527a1afe29bf3c976dab7e8ae95100d831020b7c59fe468 + inlined_ast: fdfe1266895c258a1527a1afe29bf3c976dab7e8ae95100d831020b7c59fe468 + dce_ast: 38cd302599c7b5f07e6069457fb95bcd2e63f83e5ef98f798edb70261df55ffd + bytecode: 9a042a6076c83bb376f10443261e56704956030b03df62da5d5f4742ac10c74d warnings: "" diff --git a/tests/expectations/execution/primitive_casts.out b/tests/expectations/execution/primitive_casts.out index 840b6c5633..1708e443ac 100644 --- a/tests/expectations/execution/primitive_casts.out +++ b/tests/expectations/execution/primitive_casts.out @@ -16,46 +16,46 @@ outputs: results: address_casts: - input: "[aleo1hjnn8jdxlzzlqjywamdx4hzcxny5gszzm0q5xmnae4ed6qqn2gys4ugtey]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r2 as boolean;): Cannot downcast a field literal to a boolean type (yet).)" + output: "[aleo1hjnn8jdxlzzlqjywamdx4hzcxny5gszzm0q5xmnae4ed6qqn2gys4ugtey, false, 4215828253063057579372973753238191915437678788189540242352627279098623010748field, 4215828253063057579372973753238191915437678788189540242352627279098623010748group, -68i8, -22596i16, -919361604i32, -1115211937480464452i64, 69581248500420848509480883781010433980i128, 188u8, 42940u16, 3375605692u32, 17331532136229087164u64, 69581248500420848509480883781010433980u128, 597325464396926472386380471716694795022991767388272616119577778851337709500scalar]" bool_casts: - input: "[false]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a boolean literal to another type.)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" field_casts: - input: "[0field]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a field literal to an address type.)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" group_casts: - input: "[0group]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r2 as boolean;): Cannot downcast a field literal to a boolean type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" i128_casts: - input: "[0i128]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast an i128 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" i16_casts: - input: "[0i16]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast an i16 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" i32_casts: - input: "[0i32]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast an i32 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" i64_casts: - input: "[0i64]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast an i64 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" i8_casts: - input: "[0i8]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast an i8 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" scalar_casts: - input: "[0scalar]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a scalar literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" u128_casts: - input: "[0u128]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a u128 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" u16_casts: - input: "[0u16]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a u16 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" u32_casts: - input: "[0u32]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a u32 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" u64_casts: - input: "[0u64]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a u64 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" u8_casts: - input: "[0u8]" - output: "SnarkVMError(Failed to execute instruction (cast r0 into r1 as address;): Cannot downcast a u8 literal to another type (yet).)" + output: "[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc, false, 0field, 0group, 0i8, 0i16, 0i32, 0i64, 0i128, 0u8, 0u16, 0u32, 0u64, 0u128, 0scalar]" diff --git a/tests/tests/compiler/signature/signature.leo b/tests/tests/compiler/signature/signature.leo index 6d9e6eaff3..5a422871de 100644 --- a/tests/tests/compiler/signature/signature.leo +++ b/tests/tests/compiler/signature/signature.leo @@ -21,4 +21,12 @@ program test.aleo { let second: bool = s.verify(a, v); assert_eq(first, second); } + + transition literal_ops_on_signature(a: bool, b: signature, c: signature) -> signature { + let equal: bool = b == c; + let not_equal: bool = b != c; + let ternary: signature = a ? b : c; + + return ternary; + } } From f15677c2f66dc21dd047aef2b5dd4f0a30c6c846 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 10:05:48 +0000 Subject: [PATCH 4/7] Bump smallvec from 1.11.0 to 1.11.1 Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.11.0 to 1.11.1. - [Release notes](https://github.com/servo/rust-smallvec/releases) - [Commits](https://github.com/servo/rust-smallvec/compare/v1.11.0...v1.11.1) --- updated-dependencies: - dependency-name: smallvec dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- compiler/ast/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0346814a4..7ded5d72d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2391,9 +2391,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" dependencies = [ "serde", ] diff --git a/compiler/ast/Cargo.toml b/compiler/ast/Cargo.toml index aead191e92..b0aa561597 100644 --- a/compiler/ast/Cargo.toml +++ b/compiler/ast/Cargo.toml @@ -42,7 +42,7 @@ version = "1.0" features = [ "preserve_order" ] [dependencies.smallvec] -version = "1.11.0" +version = "1.11.1" features = [ "serde" ] [dev-dependencies.criterion] From ac0e474f2917ba0c83bd17287470328fe320788b Mon Sep 17 00:00:00 2001 From: Collin Chin <16715212+collinc97@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:12:51 -0700 Subject: [PATCH 5/7] Update release.yml (#2602) Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com> --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 890c814c77..9bb5d75eff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -139,7 +139,9 @@ jobs: runs-on: macos-latest steps: - name: Xcode Select - uses: devbotsxyz/xcode-select@v1.1.0 + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable - name: Checkout uses: actions/checkout@v2 From 82b39a81e97e9f5f820c950ae4ce50ea1f60e6b0 Mon Sep 17 00:00:00 2001 From: Collin Chin <16715212+collinc97@users.noreply.github.com> Date: Fri, 22 Sep 2023 08:31:30 -0700 Subject: [PATCH 6/7] implement Keccak256 Keccak384 Keccak512 with tests (#2603) --- compiler/ast/src/core/mod.rs | 19 -- compiler/ast/src/functions/core_function.rs | 177 ++++++++++++++++++ .../src/code_generation/visit_expressions.rs | 9 + compiler/passes/src/type_checking/checker.rs | 42 +++++ compiler/span/src/symbol.rs | 3 + .../keccak256/keccak256_hash_to_i128.out | 15 ++ .../keccak256/keccak256_hash_to_i16.out | 15 ++ .../keccak256/keccak256_hash_to_i32.out | 15 ++ .../keccak256/keccak256_hash_to_i64.out | 15 ++ .../keccak256/keccak256_hash_to_i8.out | 15 ++ .../keccak256/keccak256_hash_to_u128.out | 15 ++ .../keccak256/keccak256_hash_to_u16.out | 15 ++ .../keccak256/keccak256_hash_to_u32.out | 15 ++ .../keccak256/keccak256_hash_to_u64.out | 15 ++ .../keccak256/keccak256_hash_to_u8.out | 15 ++ .../keccak384/keccak384_hash_to_i128.out | 15 ++ .../keccak384/keccak384_hash_to_i16.out | 15 ++ .../keccak384/keccak384_hash_to_i32.out | 15 ++ .../keccak384/keccak384_hash_to_i64.out | 15 ++ .../keccak384/keccak384_hash_to_i8.out | 15 ++ .../keccak384/keccak384_hash_to_u128.out | 15 ++ .../keccak384/keccak384_hash_to_u16.out | 15 ++ .../keccak384/keccak384_hash_to_u32.out | 15 ++ .../keccak384/keccak384_hash_to_u64.out | 15 ++ .../keccak384/keccak384_hash_to_u8.out | 15 ++ .../keccak512/keccak512_hash_to_i128.out | 15 ++ .../keccak512/keccak512_hash_to_i16.out | 15 ++ .../keccak512/keccak512_hash_to_i32.out | 15 ++ .../keccak512/keccak512_hash_to_i64.out | 15 ++ .../keccak512/keccak512_hash_to_i8.out | 15 ++ .../keccak512/keccak512_hash_to_u128.out | 15 ++ .../keccak512/keccak512_hash_to_u16.out | 15 ++ .../keccak512/keccak512_hash_to_u32.out | 15 ++ .../keccak512/keccak512_hash_to_u64.out | 15 ++ .../keccak512/keccak512_hash_to_u8.out | 15 ++ .../algorithms/keccak256_hash_to_address.out | 15 ++ .../algorithms/keccak256_hash_to_field.out | 15 ++ .../algorithms/keccak256_hash_to_group.out | 15 ++ .../algorithms/keccak256_hash_to_scalar.out | 15 ++ .../algorithms/keccak384_hash_to_address.out | 15 ++ .../algorithms/keccak384_hash_to_field.out | 15 ++ .../algorithms/keccak384_hash_to_group.out | 15 ++ .../algorithms/keccak384_hash_to_scalar.out | 15 ++ .../algorithms/keccak512_hash_to_address.out | 15 ++ .../algorithms/keccak512_hash_to_field.out | 15 ++ .../algorithms/keccak512_hash_to_group.out | 15 ++ .../algorithms/keccak512_hash_to_scalar.out | 15 ++ .../keccak256/keccak256_hash_to_i128.leo | 52 +++++ .../keccak256/keccak256_hash_to_i16.leo | 52 +++++ .../keccak256/keccak256_hash_to_i32.leo | 52 +++++ .../keccak256/keccak256_hash_to_i64.leo | 52 +++++ .../keccak256/keccak256_hash_to_i8.leo | 52 +++++ .../keccak256/keccak256_hash_to_u128.leo | 52 +++++ .../keccak256/keccak256_hash_to_u16.leo | 52 +++++ .../keccak256/keccak256_hash_to_u32.leo | 52 +++++ .../keccak256/keccak256_hash_to_u64.leo | 52 +++++ .../keccak256/keccak256_hash_to_u8.leo | 52 +++++ .../keccak384/keccak384_hash_to_i128.leo | 52 +++++ .../keccak384/keccak384_hash_to_i16.leo | 52 +++++ .../keccak384/keccak384_hash_to_i32.leo | 52 +++++ .../keccak384/keccak384_hash_to_i64.leo | 52 +++++ .../keccak384/keccak384_hash_to_i8.leo | 52 +++++ .../keccak384/keccak384_hash_to_u128.leo | 52 +++++ .../keccak384/keccak384_hash_to_u16.leo | 52 +++++ .../keccak384/keccak384_hash_to_u32.leo | 52 +++++ .../keccak384/keccak384_hash_to_u64.leo | 52 +++++ .../keccak384/keccak384_hash_to_u8.leo | 52 +++++ .../keccak512/keccak512_hash_to_i128.leo | 52 +++++ .../keccak512/keccak512_hash_to_i16.leo | 52 +++++ .../keccak512/keccak512_hash_to_i32.leo | 52 +++++ .../keccak512/keccak512_hash_to_i64.leo | 52 +++++ .../keccak512/keccak512_hash_to_i8.leo | 52 +++++ .../keccak512/keccak512_hash_to_u128.leo | 52 +++++ .../keccak512/keccak512_hash_to_u16.leo | 52 +++++ .../keccak512/keccak512_hash_to_u32.leo | 52 +++++ .../keccak512/keccak512_hash_to_u64.leo | 52 +++++ .../keccak512/keccak512_hash_to_u8.leo | 52 +++++ .../algorithms/keccak256_hash_to_address.leo | 52 +++++ .../algorithms/keccak256_hash_to_field.leo | 51 +++++ .../algorithms/keccak256_hash_to_group.leo | 51 +++++ .../algorithms/keccak256_hash_to_scalar.leo | 51 +++++ .../algorithms/keccak384_hash_to_address.leo | 52 +++++ .../algorithms/keccak384_hash_to_field.leo | 51 +++++ .../algorithms/keccak384_hash_to_group.leo | 51 +++++ .../algorithms/keccak384_hash_to_scalar.leo | 51 +++++ .../algorithms/keccak512_hash_to_address.leo | 52 +++++ .../algorithms/keccak512_hash_to_field.leo | 51 +++++ .../algorithms/keccak512_hash_to_group.leo | 51 +++++ .../algorithms/keccak512_hash_to_scalar.leo | 51 +++++ 89 files changed, 3036 insertions(+), 19 deletions(-) delete mode 100644 compiler/ast/src/core/mod.rs create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak256_hash_to_address.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak256_hash_to_field.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak256_hash_to_group.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak256_hash_to_scalar.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak384_hash_to_address.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak384_hash_to_field.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak384_hash_to_group.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak384_hash_to_scalar.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak512_hash_to_address.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak512_hash_to_field.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak512_hash_to_group.out create mode 100644 tests/expectations/compiler/core/algorithms/keccak512_hash_to_scalar.out create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak256_hash_to_address.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak256_hash_to_field.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak256_hash_to_group.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak256_hash_to_scalar.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak384_hash_to_address.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak384_hash_to_field.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak384_hash_to_group.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak384_hash_to_scalar.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak512_hash_to_address.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak512_hash_to_field.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak512_hash_to_group.leo create mode 100644 tests/tests/compiler/core/algorithms/keccak512_hash_to_scalar.leo diff --git a/compiler/ast/src/core/mod.rs b/compiler/ast/src/core/mod.rs deleted file mode 100644 index 27caeebc3b..0000000000 --- a/compiler/ast/src/core/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -//! The core library structures for a Leo program. - -pub struct BHP \ No newline at end of file diff --git a/compiler/ast/src/functions/core_function.rs b/compiler/ast/src/functions/core_function.rs index 4587bf219b..b3e2c59414 100644 --- a/compiler/ast/src/functions/core_function.rs +++ b/compiler/ast/src/functions/core_function.rs @@ -107,6 +107,51 @@ pub enum CoreFunction { ChaChaRandU128, ChaChaRandScalar, + Keccak256HashToAddress, + Keccak256HashToField, + Keccak256HashToGroup, + Keccak256HashToI8, + Keccak256HashToI16, + Keccak256HashToI32, + Keccak256HashToI64, + Keccak256HashToI128, + Keccak256HashToU8, + Keccak256HashToU16, + Keccak256HashToU32, + Keccak256HashToU64, + Keccak256HashToU128, + Keccak256HashToScalar, + + Keccak384HashToAddress, + Keccak384HashToField, + Keccak384HashToGroup, + Keccak384HashToI8, + Keccak384HashToI16, + Keccak384HashToI32, + Keccak384HashToI64, + Keccak384HashToI128, + Keccak384HashToU8, + Keccak384HashToU16, + Keccak384HashToU32, + Keccak384HashToU64, + Keccak384HashToU128, + Keccak384HashToScalar, + + Keccak512HashToAddress, + Keccak512HashToField, + Keccak512HashToGroup, + Keccak512HashToI8, + Keccak512HashToI16, + Keccak512HashToI32, + Keccak512HashToI64, + Keccak512HashToI128, + Keccak512HashToU8, + Keccak512HashToU16, + Keccak512HashToU32, + Keccak512HashToU64, + Keccak512HashToU128, + Keccak512HashToScalar, + Pedersen64CommitToAddress, Pedersen64CommitToField, Pedersen64CommitToGroup, @@ -293,6 +338,51 @@ impl CoreFunction { (sym::ChaCha, sym::rand_u64) => Self::ChaChaRandU64, (sym::ChaCha, sym::rand_u128) => Self::ChaChaRandU128, + (sym::Keccak256, sym::hash_to_address) => Self::Keccak256HashToAddress, + (sym::Keccak256, sym::hash_to_field) => Self::Keccak256HashToField, + (sym::Keccak256, sym::hash_to_group) => Self::Keccak256HashToGroup, + (sym::Keccak256, sym::hash_to_i8) => Self::Keccak256HashToI8, + (sym::Keccak256, sym::hash_to_i16) => Self::Keccak256HashToI16, + (sym::Keccak256, sym::hash_to_i32) => Self::Keccak256HashToI32, + (sym::Keccak256, sym::hash_to_i64) => Self::Keccak256HashToI64, + (sym::Keccak256, sym::hash_to_i128) => Self::Keccak256HashToI128, + (sym::Keccak256, sym::hash_to_u8) => Self::Keccak256HashToU8, + (sym::Keccak256, sym::hash_to_u16) => Self::Keccak256HashToU16, + (sym::Keccak256, sym::hash_to_u32) => Self::Keccak256HashToU32, + (sym::Keccak256, sym::hash_to_u64) => Self::Keccak256HashToU64, + (sym::Keccak256, sym::hash_to_u128) => Self::Keccak256HashToU128, + (sym::Keccak256, sym::hash_to_scalar) => Self::Keccak256HashToScalar, + + (sym::Keccak384, sym::hash_to_address) => Self::Keccak384HashToAddress, + (sym::Keccak384, sym::hash_to_field) => Self::Keccak384HashToField, + (sym::Keccak384, sym::hash_to_group) => Self::Keccak384HashToGroup, + (sym::Keccak384, sym::hash_to_i8) => Self::Keccak384HashToI8, + (sym::Keccak384, sym::hash_to_i16) => Self::Keccak384HashToI16, + (sym::Keccak384, sym::hash_to_i32) => Self::Keccak384HashToI32, + (sym::Keccak384, sym::hash_to_i64) => Self::Keccak384HashToI64, + (sym::Keccak384, sym::hash_to_i128) => Self::Keccak384HashToI128, + (sym::Keccak384, sym::hash_to_u8) => Self::Keccak384HashToU8, + (sym::Keccak384, sym::hash_to_u16) => Self::Keccak384HashToU16, + (sym::Keccak384, sym::hash_to_u32) => Self::Keccak384HashToU32, + (sym::Keccak384, sym::hash_to_u64) => Self::Keccak384HashToU64, + (sym::Keccak384, sym::hash_to_u128) => Self::Keccak384HashToU128, + (sym::Keccak384, sym::hash_to_scalar) => Self::Keccak384HashToScalar, + + (sym::Keccak512, sym::hash_to_address) => Self::Keccak512HashToAddress, + (sym::Keccak512, sym::hash_to_field) => Self::Keccak512HashToField, + (sym::Keccak512, sym::hash_to_group) => Self::Keccak512HashToGroup, + (sym::Keccak512, sym::hash_to_i8) => Self::Keccak512HashToI8, + (sym::Keccak512, sym::hash_to_i16) => Self::Keccak512HashToI16, + (sym::Keccak512, sym::hash_to_i32) => Self::Keccak512HashToI32, + (sym::Keccak512, sym::hash_to_i64) => Self::Keccak512HashToI64, + (sym::Keccak512, sym::hash_to_i128) => Self::Keccak512HashToI128, + (sym::Keccak512, sym::hash_to_u8) => Self::Keccak512HashToU8, + (sym::Keccak512, sym::hash_to_u16) => Self::Keccak512HashToU16, + (sym::Keccak512, sym::hash_to_u32) => Self::Keccak512HashToU32, + (sym::Keccak512, sym::hash_to_u64) => Self::Keccak512HashToU64, + (sym::Keccak512, sym::hash_to_u128) => Self::Keccak512HashToU128, + (sym::Keccak512, sym::hash_to_scalar) => Self::Keccak512HashToScalar, + (sym::Pedersen64, sym::commit_to_address) => Self::Pedersen64CommitToAddress, (sym::Pedersen64, sym::commit_to_field) => Self::Pedersen64CommitToField, (sym::Pedersen64, sym::commit_to_group) => Self::Pedersen64CommitToGroup, @@ -480,6 +570,51 @@ impl CoreFunction { Self::ChaChaRandU128 => 0, Self::ChaChaRandScalar => 0, + Self::Keccak256HashToAddress => 1, + Self::Keccak256HashToField => 1, + Self::Keccak256HashToGroup => 1, + Self::Keccak256HashToI8 => 1, + Self::Keccak256HashToI16 => 1, + Self::Keccak256HashToI32 => 1, + Self::Keccak256HashToI64 => 1, + Self::Keccak256HashToI128 => 1, + Self::Keccak256HashToU8 => 1, + Self::Keccak256HashToU16 => 1, + Self::Keccak256HashToU32 => 1, + Self::Keccak256HashToU64 => 1, + Self::Keccak256HashToU128 => 1, + Self::Keccak256HashToScalar => 1, + + Self::Keccak384HashToAddress => 1, + Self::Keccak384HashToField => 1, + Self::Keccak384HashToGroup => 1, + Self::Keccak384HashToI8 => 1, + Self::Keccak384HashToI16 => 1, + Self::Keccak384HashToI32 => 1, + Self::Keccak384HashToI64 => 1, + Self::Keccak384HashToI128 => 1, + Self::Keccak384HashToU8 => 1, + Self::Keccak384HashToU16 => 1, + Self::Keccak384HashToU32 => 1, + Self::Keccak384HashToU64 => 1, + Self::Keccak384HashToU128 => 1, + Self::Keccak384HashToScalar => 1, + + Self::Keccak512HashToAddress => 1, + Self::Keccak512HashToField => 1, + Self::Keccak512HashToGroup => 1, + Self::Keccak512HashToI8 => 1, + Self::Keccak512HashToI16 => 1, + Self::Keccak512HashToI32 => 1, + Self::Keccak512HashToI64 => 1, + Self::Keccak512HashToI128 => 1, + Self::Keccak512HashToU8 => 1, + Self::Keccak512HashToU16 => 1, + Self::Keccak512HashToU32 => 1, + Self::Keccak512HashToU64 => 1, + Self::Keccak512HashToU128 => 1, + Self::Keccak512HashToScalar => 1, + Self::Pedersen64CommitToAddress => 2, Self::Pedersen64CommitToField => 2, Self::Pedersen64CommitToGroup => 2, @@ -665,6 +800,48 @@ impl CoreFunction { | CoreFunction::BHP1024HashToU64 | CoreFunction::BHP1024HashToU128 | CoreFunction::BHP1024HashToScalar + | CoreFunction::Keccak256HashToAddress + | CoreFunction::Keccak256HashToField + | CoreFunction::Keccak256HashToGroup + | CoreFunction::Keccak256HashToI8 + | CoreFunction::Keccak256HashToI16 + | CoreFunction::Keccak256HashToI32 + | CoreFunction::Keccak256HashToI64 + | CoreFunction::Keccak256HashToI128 + | CoreFunction::Keccak256HashToU8 + | CoreFunction::Keccak256HashToU16 + | CoreFunction::Keccak256HashToU32 + | CoreFunction::Keccak256HashToU64 + | CoreFunction::Keccak256HashToU128 + | CoreFunction::Keccak256HashToScalar + | CoreFunction::Keccak384HashToAddress + | CoreFunction::Keccak384HashToField + | CoreFunction::Keccak384HashToGroup + | CoreFunction::Keccak384HashToI8 + | CoreFunction::Keccak384HashToI16 + | CoreFunction::Keccak384HashToI32 + | CoreFunction::Keccak384HashToI64 + | CoreFunction::Keccak384HashToI128 + | CoreFunction::Keccak384HashToU8 + | CoreFunction::Keccak384HashToU16 + | CoreFunction::Keccak384HashToU32 + | CoreFunction::Keccak384HashToU64 + | CoreFunction::Keccak384HashToU128 + | CoreFunction::Keccak384HashToScalar + | CoreFunction::Keccak512HashToAddress + | CoreFunction::Keccak512HashToField + | CoreFunction::Keccak512HashToGroup + | CoreFunction::Keccak512HashToI8 + | CoreFunction::Keccak512HashToI16 + | CoreFunction::Keccak512HashToI32 + | CoreFunction::Keccak512HashToI64 + | CoreFunction::Keccak512HashToI128 + | CoreFunction::Keccak512HashToU8 + | CoreFunction::Keccak512HashToU16 + | CoreFunction::Keccak512HashToU32 + | CoreFunction::Keccak512HashToU64 + | CoreFunction::Keccak512HashToU128 + | CoreFunction::Keccak512HashToScalar | CoreFunction::Pedersen64CommitToAddress | CoreFunction::Pedersen64CommitToField | CoreFunction::Pedersen64CommitToGroup diff --git a/compiler/passes/src/code_generation/visit_expressions.rs b/compiler/passes/src/code_generation/visit_expressions.rs index 0280aec5d1..7e56444b52 100644 --- a/compiler/passes/src/code_generation/visit_expressions.rs +++ b/compiler/passes/src/code_generation/visit_expressions.rs @@ -315,6 +315,15 @@ impl<'a> CodeGenerator<'a> { Type::Identifier(Identifier { name: sym::BHP1024, .. }) => { construct_simple_function_call(&input.name, "bhp1024", arguments) } + Type::Identifier(Identifier { name: sym::Keccak256, .. }) => { + construct_simple_function_call(&input.name, "keccak256", arguments) + } + Type::Identifier(Identifier { name: sym::Keccak384, .. }) => { + construct_simple_function_call(&input.name, "keccak384", arguments) + } + Type::Identifier(Identifier { name: sym::Keccak512, .. }) => { + construct_simple_function_call(&input.name, "keccak512", arguments) + } Type::Identifier(Identifier { name: sym::Pedersen64, .. }) => { construct_simple_function_call(&input.name, "ped64", arguments) } diff --git a/compiler/passes/src/type_checking/checker.rs b/compiler/passes/src/type_checking/checker.rs index c0692ecbd2..8316a96b5b 100644 --- a/compiler/passes/src/type_checking/checker.rs +++ b/compiler/passes/src/type_checking/checker.rs @@ -480,6 +480,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToAddress | CoreFunction::BHP768HashToAddress | CoreFunction::BHP1024HashToAddress + | CoreFunction::Keccak256HashToAddress + | CoreFunction::Keccak384HashToAddress + | CoreFunction::Keccak512HashToAddress | CoreFunction::Poseidon2HashToAddress | CoreFunction::Poseidon4HashToAddress | CoreFunction::Poseidon8HashToAddress => { @@ -491,6 +494,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToField | CoreFunction::BHP768HashToField | CoreFunction::BHP1024HashToField + | CoreFunction::Keccak256HashToField + | CoreFunction::Keccak384HashToField + | CoreFunction::Keccak512HashToField | CoreFunction::Poseidon2HashToField | CoreFunction::Poseidon4HashToField | CoreFunction::Poseidon8HashToField => { @@ -502,6 +508,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToGroup | CoreFunction::BHP768HashToGroup | CoreFunction::BHP1024HashToGroup + | CoreFunction::Keccak256HashToGroup + | CoreFunction::Keccak384HashToGroup + | CoreFunction::Keccak512HashToGroup | CoreFunction::Poseidon2HashToGroup | CoreFunction::Poseidon4HashToGroup | CoreFunction::Poseidon8HashToGroup => { @@ -513,6 +522,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToI8 | CoreFunction::BHP768HashToI8 | CoreFunction::BHP1024HashToI8 + | CoreFunction::Keccak256HashToI8 + | CoreFunction::Keccak384HashToI8 + | CoreFunction::Keccak512HashToI8 | CoreFunction::Poseidon2HashToI8 | CoreFunction::Poseidon4HashToI8 | CoreFunction::Poseidon8HashToI8 => { @@ -524,6 +536,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToI16 | CoreFunction::BHP768HashToI16 | CoreFunction::BHP1024HashToI16 + | CoreFunction::Keccak256HashToI16 + | CoreFunction::Keccak384HashToI16 + | CoreFunction::Keccak512HashToI16 | CoreFunction::Poseidon2HashToI16 | CoreFunction::Poseidon4HashToI16 | CoreFunction::Poseidon8HashToI16 => { @@ -535,6 +550,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToI32 | CoreFunction::BHP768HashToI32 | CoreFunction::BHP1024HashToI32 + | CoreFunction::Keccak256HashToI32 + | CoreFunction::Keccak384HashToI32 + | CoreFunction::Keccak512HashToI32 | CoreFunction::Poseidon2HashToI32 | CoreFunction::Poseidon4HashToI32 | CoreFunction::Poseidon8HashToI32 => { @@ -546,6 +564,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToI64 | CoreFunction::BHP768HashToI64 | CoreFunction::BHP1024HashToI64 + | CoreFunction::Keccak256HashToI64 + | CoreFunction::Keccak384HashToI64 + | CoreFunction::Keccak512HashToI64 | CoreFunction::Poseidon2HashToI64 | CoreFunction::Poseidon4HashToI64 | CoreFunction::Poseidon8HashToI64 => { @@ -557,6 +578,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToI128 | CoreFunction::BHP768HashToI128 | CoreFunction::BHP1024HashToI128 + | CoreFunction::Keccak256HashToI128 + | CoreFunction::Keccak384HashToI128 + | CoreFunction::Keccak512HashToI128 | CoreFunction::Poseidon2HashToI128 | CoreFunction::Poseidon4HashToI128 | CoreFunction::Poseidon8HashToI128 => { @@ -568,6 +592,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToU8 | CoreFunction::BHP768HashToU8 | CoreFunction::BHP1024HashToU8 + | CoreFunction::Keccak256HashToU8 + | CoreFunction::Keccak384HashToU8 + | CoreFunction::Keccak512HashToU8 | CoreFunction::Poseidon2HashToU8 | CoreFunction::Poseidon4HashToU8 | CoreFunction::Poseidon8HashToU8 => { @@ -579,6 +606,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToU16 | CoreFunction::BHP768HashToU16 | CoreFunction::BHP1024HashToU16 + | CoreFunction::Keccak256HashToU16 + | CoreFunction::Keccak384HashToU16 + | CoreFunction::Keccak512HashToU16 | CoreFunction::Poseidon2HashToU16 | CoreFunction::Poseidon4HashToU16 | CoreFunction::Poseidon8HashToU16 => { @@ -590,6 +620,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToU32 | CoreFunction::BHP768HashToU32 | CoreFunction::BHP1024HashToU32 + | CoreFunction::Keccak256HashToU32 + | CoreFunction::Keccak384HashToU32 + | CoreFunction::Keccak512HashToU32 | CoreFunction::Poseidon2HashToU32 | CoreFunction::Poseidon4HashToU32 | CoreFunction::Poseidon8HashToU32 => { @@ -601,6 +634,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToU64 | CoreFunction::BHP768HashToU64 | CoreFunction::BHP1024HashToU64 + | CoreFunction::Keccak256HashToU64 + | CoreFunction::Keccak384HashToU64 + | CoreFunction::Keccak512HashToU64 | CoreFunction::Poseidon2HashToU64 | CoreFunction::Poseidon4HashToU64 | CoreFunction::Poseidon8HashToU64 => { @@ -612,6 +648,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToU128 | CoreFunction::BHP768HashToU128 | CoreFunction::BHP1024HashToU128 + | CoreFunction::Keccak256HashToU128 + | CoreFunction::Keccak384HashToU128 + | CoreFunction::Keccak512HashToU128 | CoreFunction::Poseidon2HashToU128 | CoreFunction::Poseidon4HashToU128 | CoreFunction::Poseidon8HashToU128 => { @@ -623,6 +662,9 @@ impl<'a> TypeChecker<'a> { | CoreFunction::BHP512HashToScalar | CoreFunction::BHP768HashToScalar | CoreFunction::BHP1024HashToScalar + | CoreFunction::Keccak256HashToScalar + | CoreFunction::Keccak384HashToScalar + | CoreFunction::Keccak512HashToScalar | CoreFunction::Poseidon2HashToScalar | CoreFunction::Poseidon4HashToScalar | CoreFunction::Poseidon8HashToScalar => { diff --git a/compiler/span/src/symbol.rs b/compiler/span/src/symbol.rs index 09fad96b58..7d65dd7a3d 100644 --- a/compiler/span/src/symbol.rs +++ b/compiler/span/src/symbol.rs @@ -170,6 +170,9 @@ symbols! { hash_to_u64, hash_to_u128, hash_to_scalar, + Keccak256, + Keccak384, + Keccak512, Mapping, Pedersen64, Pedersen128, diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.out new file mode 100644 index 0000000000..205b37f354 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: d61b6c9a81578cd47a707319541ce1cea3ac5e20020f2a5b8c0b0363df72ceb4 + type_checked_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + unrolled_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + initial_ast: 3f9a76a267efe2dd807cceadf0eb1103ce3bbffe3dcef8e9c634e91409c4e92b + unrolled_ast: 3f9a76a267efe2dd807cceadf0eb1103ce3bbffe3dcef8e9c634e91409c4e92b + ssa_ast: 8b628af19edbff2ff6739329caaaded94bd2ebb42782605be95daf977d202f3d + flattened_ast: 006fec7dfcea9b8edc2c92a4ac8374b34bfa1689fd99603c193e8558eccb85b5 + inlined_ast: 006fec7dfcea9b8edc2c92a4ac8374b34bfa1689fd99603c193e8558eccb85b5 + dce_ast: e65f786ad28fb5cff8cc8c7c93044345ea38adeb483a5e04407c9c53908dbf2b + bytecode: 590389deb5b7da7e5210fcae5fed44bddf2b1a0bd6d2b30817eb650dd5efa343 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.out new file mode 100644 index 0000000000..c37a2c30b0 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 077422b93c97f7cd8a28ff1ba7bbe58e07c4b7887304c46d35eb5ac6bf23c972 + type_checked_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + unrolled_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + initial_ast: 5098cf163889f06c306729c4cdbe437adb141c68773ab5d7af6c9db6ce5322c1 + unrolled_ast: 5098cf163889f06c306729c4cdbe437adb141c68773ab5d7af6c9db6ce5322c1 + ssa_ast: fc0281305cba005e642f7ab23c4aed8e297be2c664743437376d117cdbdaff67 + flattened_ast: f3ed75e409db4058dc34f2d1f78aa261bbc7544054b7839e3cdbc3465d0a7534 + inlined_ast: f3ed75e409db4058dc34f2d1f78aa261bbc7544054b7839e3cdbc3465d0a7534 + dce_ast: b4e8cf9e9c30b67e29d24a8e143363d52f6474f80114649a82551346bdaccaa0 + bytecode: 6ae1c5f0b41e9982c661326ee81b26e8c0b6d400f5a8454117984c37ab4e492a + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.out new file mode 100644 index 0000000000..c34e83e52b --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 0b9e361a60499d11d8de9a427cd689b0904e3660092b6ff95a1c07bf09964e11 + type_checked_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + unrolled_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + initial_ast: d4e7c27ccca22155f837e3b6d0833c4de03a6d500fc6deae5f0cac748565ebbe + unrolled_ast: d4e7c27ccca22155f837e3b6d0833c4de03a6d500fc6deae5f0cac748565ebbe + ssa_ast: 400ea50666d5ba3e392f3cb0605f0246b08cf0cef2b971a28e62ba7d793efa59 + flattened_ast: 5ffb39defd930d8cb1972c4dd2f20affe949f5ac34d22c7143f06cf4af64ff98 + inlined_ast: 5ffb39defd930d8cb1972c4dd2f20affe949f5ac34d22c7143f06cf4af64ff98 + dce_ast: e7a3feaa48dc9473e381e20cadb02a67eb394253077f8887112db91c56e3c164 + bytecode: baa423f7d34847421a44a1ccfede64fb02829a7d99c465b0605f85cf20705986 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.out new file mode 100644 index 0000000000..eb33cd34c3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 85b2afdf445a99fc5beb1bb9b7c98ddce8f4936dbdb5173447e64bfc5c73e96d + type_checked_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + unrolled_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + initial_ast: 3d1c1d4440c409a19b85c2536fde1301d6f95014df8522bc015a6852d1dca0e2 + unrolled_ast: 3d1c1d4440c409a19b85c2536fde1301d6f95014df8522bc015a6852d1dca0e2 + ssa_ast: 3bd86dc685b4ed91cd92cd8a7e14d4cf059a29c04303d42e4a574f3e0793d134 + flattened_ast: c7b54b2b858b591285d239c682c75cba6844edd7f31b21a7224567d34d0fad3f + inlined_ast: c7b54b2b858b591285d239c682c75cba6844edd7f31b21a7224567d34d0fad3f + dce_ast: 1c558e0da2876caf2126a3fff87bd8e50e0d6462db9c5a3efb76358d331fcc84 + bytecode: 4d5b9ec6fd0830de759b0df4e24136712875ed4bac5aca6ff53d8a6938693f56 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.out new file mode 100644 index 0000000000..821e9c46d9 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: e57034c883f65a0bf8bf21c5948e8e470938929205661f4629331145f96f457a + type_checked_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + unrolled_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + initial_ast: 92833e47204b59b37788c4ec212343979a18ed7f3a45f15165efb32339072c28 + unrolled_ast: 92833e47204b59b37788c4ec212343979a18ed7f3a45f15165efb32339072c28 + ssa_ast: ea8589847dd428451e47f2816336c901eac188be9f6738fec75a2bf0f1d2cbca + flattened_ast: fbb71c5fc61c07497e4caef27d20396d7cfedd3d60d1321c0c07e659a80ecb16 + inlined_ast: fbb71c5fc61c07497e4caef27d20396d7cfedd3d60d1321c0c07e659a80ecb16 + dce_ast: 04a3de0e312345fc0b85a40019a5c9cbf17838344430de742b122c20aee28045 + bytecode: dae1414959e50ca77ecae476843824b6220aa3ca4e95ab2a98deaa4b78987bc7 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.out new file mode 100644 index 0000000000..b3119372b4 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 30b74ef9405be6a65d0718e893155dfab9c5a27ba6331b46674fbfe804c078c7 + type_checked_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + unrolled_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + initial_ast: 2212034158c834667803573faba6667ddd08bc776e4255672eac824585c76ec2 + unrolled_ast: 2212034158c834667803573faba6667ddd08bc776e4255672eac824585c76ec2 + ssa_ast: 0cd336fabd60ae4185f6e37e01db7f79c53bc1a7c60607835ddaac8dea32f060 + flattened_ast: a25846920a22e7ba467e912f414fb0df64a8c9ae33db2508a3a028ab2d726c01 + inlined_ast: a25846920a22e7ba467e912f414fb0df64a8c9ae33db2508a3a028ab2d726c01 + dce_ast: 5e5bb6f4ec146fcc8cef69b6efdf3bb247c2379d1b4ed3a85a39f8fb084bc57e + bytecode: 770f2acaaeeba1f46a6b57a837f4abab295fe19070a150e6f59fc4e8d4cb19fa + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.out new file mode 100644 index 0000000000..b67521dea8 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 5a59bc205eed395ed0a857abe27790d3612aaac26fce76ec8b77b539dd85b4ad + type_checked_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + unrolled_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + initial_ast: a7a56ccb04db7b6764ec0213f484c231c6f9ee3cd68faf8d8b467a76ca07e298 + unrolled_ast: a7a56ccb04db7b6764ec0213f484c231c6f9ee3cd68faf8d8b467a76ca07e298 + ssa_ast: 6134e8a8a0fe6c02950148662b3b7b77425acde70be5630c6d29fab336387da0 + flattened_ast: d046b22ad8006892c4b97209303471eb812083be94245a55b35852636eedcda5 + inlined_ast: d046b22ad8006892c4b97209303471eb812083be94245a55b35852636eedcda5 + dce_ast: b2f239b6cc8c65f455d27893acedfbfd0d8eebb0f2e04af27a0b6b318c0898d8 + bytecode: 2827725e28e621b51cf5a40a1979da7558af0ec1e7e260b1ec255c169efd7948 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.out new file mode 100644 index 0000000000..1dac282249 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 992dd740994079e30efead06f29f9c2df115a70d54f7649eb5fadec3120db120 + type_checked_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + unrolled_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + initial_ast: 30f1add1461d8f07c9eb7c573d9a9d7289f136855946d5f8ff872b7f87dea438 + unrolled_ast: 30f1add1461d8f07c9eb7c573d9a9d7289f136855946d5f8ff872b7f87dea438 + ssa_ast: 38cbe72eb04fc7f1eabcde8948ca8884eb8913dd56d811cb64bf7978be2ee644 + flattened_ast: 637dfa95104f0f2d2beb8449ae711975b15314ce0f6a5c06b2537703e317c3b9 + inlined_ast: 637dfa95104f0f2d2beb8449ae711975b15314ce0f6a5c06b2537703e317c3b9 + dce_ast: 60306bd1d9b0446c04c1f121089daa7285b7eae22d36f6ccc8e46c3b1d602184 + bytecode: a90328ca973213775dcbfa872950cc8126b172ef1cd4c1a1650277b23b6f6957 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.out new file mode 100644 index 0000000000..0fe4ff897d --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 7c89248ded858c5bc52c59d418ebea9937f41f59e113313a43dce30d21780db9 + type_checked_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + unrolled_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + initial_ast: 601b6fdd0f13a4b55f7d136e4e31484dfe8cc727c75b163156fa18449b74268a + unrolled_ast: 601b6fdd0f13a4b55f7d136e4e31484dfe8cc727c75b163156fa18449b74268a + ssa_ast: d3dadc07ab20dc1a14a6676b97c3487d4a081eef9570e3b4d5036bcb5bd103ac + flattened_ast: 805ea6e2cea6778e879509c66287d903fbbe9e558ea243176a4d8fceca9343c7 + inlined_ast: 805ea6e2cea6778e879509c66287d903fbbe9e558ea243176a4d8fceca9343c7 + dce_ast: f28507eae282d4bfba9821407c261ab8e1972197d4171bbfa8967bffcf23ec4b + bytecode: 56496fd935df4646cdd71fb7cee3390df240c99433835d70ef5967a33e6d7de8 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.out b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.out new file mode 100644 index 0000000000..ce84912cf9 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 9de9a9614bae9e392c40cbe50c32763866d8facbe3b7b0e618c773c9c1e2452b + type_checked_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + unrolled_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + initial_ast: 9543d9a74b1616747f02212f0dee15345bde9a2264ff2074f453e17cb9fbd3b4 + unrolled_ast: 9543d9a74b1616747f02212f0dee15345bde9a2264ff2074f453e17cb9fbd3b4 + ssa_ast: 4a2b682e4a06e4e8b3c38373822e9418d6ec64a2ced7669fc14a16c8e2e26928 + flattened_ast: 36249d7d789728d6dc2d50bbd385e4167d4c046740411d6c992768f28b7cd9b7 + inlined_ast: 36249d7d789728d6dc2d50bbd385e4167d4c046740411d6c992768f28b7cd9b7 + dce_ast: 7134438e310abde6fc3a2b71c9830cd9f403919ddff03733243b0b806c9e5495 + bytecode: db058ed7b34e9c94cb51c9152685548070f56ec9b80abe82b0ae5789a0f81cee + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.out new file mode 100644 index 0000000000..3caeddc967 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: d61b6c9a81578cd47a707319541ce1cea3ac5e20020f2a5b8c0b0363df72ceb4 + type_checked_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + unrolled_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + initial_ast: 8f6d277873a8157f40e8bfefe1767cd1d5a9a1e9e40e4747e3327bfa3cd899ae + unrolled_ast: 8f6d277873a8157f40e8bfefe1767cd1d5a9a1e9e40e4747e3327bfa3cd899ae + ssa_ast: be8663ba9c845e2d2a1065bc45718b9a1ccb758806902ce1248a8206b3e8af33 + flattened_ast: 793e4b7767fe79d05e27976c7047db7bfeee8b6512ac98a663e680b393ca45b4 + inlined_ast: 793e4b7767fe79d05e27976c7047db7bfeee8b6512ac98a663e680b393ca45b4 + dce_ast: d86598503d1c3ca8d8da4f0918349c569e9fc3ad4e806bce9d079386b35c43d5 + bytecode: 3c60fe2ccd72f2fee542194a4a812f65cb74ffe4aa77947d0ef39a626d9175d9 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.out new file mode 100644 index 0000000000..90e9a6e67c --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 077422b93c97f7cd8a28ff1ba7bbe58e07c4b7887304c46d35eb5ac6bf23c972 + type_checked_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + unrolled_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + initial_ast: 94fd5ebc2511aba13ed72038eb17dba19af0b95fdbbbbba6897ae386d6ee704c + unrolled_ast: 94fd5ebc2511aba13ed72038eb17dba19af0b95fdbbbbba6897ae386d6ee704c + ssa_ast: 3accc6fc98f83407ae2b37f68e133f5ba422ab777b10e1cee0ee73ca0841b1ea + flattened_ast: 3e5370d4b22b001d889dca2572af06349675eefbcffdc0100dbbf7dabda34c5c + inlined_ast: 3e5370d4b22b001d889dca2572af06349675eefbcffdc0100dbbf7dabda34c5c + dce_ast: 9ffef43b15d41e9a53410cf15da5881cf87f5509084f61a6b1f815e8c139a1a8 + bytecode: f6c112b08c4a5b02002de56b8dfba054dca0fdb49feeda7146384ce5bc4b9e3b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.out new file mode 100644 index 0000000000..d6d9f530bc --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 0b9e361a60499d11d8de9a427cd689b0904e3660092b6ff95a1c07bf09964e11 + type_checked_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + unrolled_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + initial_ast: 5fa9a43fddef706caba1a3c5bd948906571355fc779a5cc2294c89b95120de70 + unrolled_ast: 5fa9a43fddef706caba1a3c5bd948906571355fc779a5cc2294c89b95120de70 + ssa_ast: 93956cb9322836aaf337ce74f3b80d5045310c07f8fe30147ad0b0fe036e133c + flattened_ast: 5c91b01aeb7f25c3121e70c06fe27f064104108b953483868df9a1851156b90b + inlined_ast: 5c91b01aeb7f25c3121e70c06fe27f064104108b953483868df9a1851156b90b + dce_ast: e1f193572ed4614989d123959d21a6d720f3a5fd28ced15acc05186a0f395561 + bytecode: ff30f43337c830695fd7271014aee19d33c0489de50d3d66db69b3d73da357ce + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.out new file mode 100644 index 0000000000..7b54b6bdc3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 85b2afdf445a99fc5beb1bb9b7c98ddce8f4936dbdb5173447e64bfc5c73e96d + type_checked_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + unrolled_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + initial_ast: 701c8072060a09af67e375611ad1959371211be199bdb68511a1ac120972c6ab + unrolled_ast: 701c8072060a09af67e375611ad1959371211be199bdb68511a1ac120972c6ab + ssa_ast: 95749c201dbf4bc09689b8266763bebbf82f1458368b8d4a6166446a0ef6bf52 + flattened_ast: a2f9857fe270b070c4ecaf322d56706ae8522e4b7de27f2b7db6c27e4e82e936 + inlined_ast: a2f9857fe270b070c4ecaf322d56706ae8522e4b7de27f2b7db6c27e4e82e936 + dce_ast: d60742f9b17394137b9c45ec1a7be558a20140003c7ca92c019a126ccc63a9b4 + bytecode: 9613835dc4e36f266d29110dd595208e54ebd4b8dcf371985a38796c15044f38 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.out new file mode 100644 index 0000000000..82d2af67ee --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: e57034c883f65a0bf8bf21c5948e8e470938929205661f4629331145f96f457a + type_checked_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + unrolled_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + initial_ast: 453c47e6d2ee3a0b424f287af590fd8f20c6e57ab6261a15884a3697aaa4e20a + unrolled_ast: 453c47e6d2ee3a0b424f287af590fd8f20c6e57ab6261a15884a3697aaa4e20a + ssa_ast: ce766ea02dcda49e9f81d380fbe20e84dcd41298862e3966faa4271077f42129 + flattened_ast: b757232d97546241dd31cb445f9cfa3fed4634500de46b4cf8e09ff9e0fb6d91 + inlined_ast: b757232d97546241dd31cb445f9cfa3fed4634500de46b4cf8e09ff9e0fb6d91 + dce_ast: 16f1ce7c51071924096d3b6ac0cde5bc26dd74d786cef9c86e0e7afeed604e3a + bytecode: ca074224fb21da9078cf66f586228b5d09460ff02edf0f84847970c375695b57 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.out new file mode 100644 index 0000000000..96c19ef173 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 30b74ef9405be6a65d0718e893155dfab9c5a27ba6331b46674fbfe804c078c7 + type_checked_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + unrolled_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + initial_ast: 5aa347afaa0bcb14a81c5dd188e0c31ebbf2ff69ed93d8298299df9d79b109c4 + unrolled_ast: 5aa347afaa0bcb14a81c5dd188e0c31ebbf2ff69ed93d8298299df9d79b109c4 + ssa_ast: c3189e3839831ae6b86f638711d43318173ff89fe2ccf0dbb1b50294e33b5ba1 + flattened_ast: 14a0c46412e3d26ec040f2e014a9638fa35af85e1b2a336bd2be2e4212a1c752 + inlined_ast: 14a0c46412e3d26ec040f2e014a9638fa35af85e1b2a336bd2be2e4212a1c752 + dce_ast: 6a24415ac8a99f16ef2cb35996935fc4b41eb073afd987d766f142678b62c44c + bytecode: b0c87022d5e30dd47b5a097c7e1c00bd8c487886a84212ce7db0c7b1c5856259 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.out new file mode 100644 index 0000000000..08c83b6eb0 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 5a59bc205eed395ed0a857abe27790d3612aaac26fce76ec8b77b539dd85b4ad + type_checked_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + unrolled_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + initial_ast: 8d5ccfa7a2b81d90c30571e1e8b0e03392ae984d077beb44d270f503b3ae1f03 + unrolled_ast: 8d5ccfa7a2b81d90c30571e1e8b0e03392ae984d077beb44d270f503b3ae1f03 + ssa_ast: eb5b96165c5565ca9f47c52ec872f4f989b2d519f6237b69a78dfc94fac02668 + flattened_ast: 58e7057028e69bec09d15ec26c092442265d0e5882486f0dab128677ed4595ea + inlined_ast: 58e7057028e69bec09d15ec26c092442265d0e5882486f0dab128677ed4595ea + dce_ast: dc3acfedccb7511b5875c0869c9f0b1e3bbdb52f076b908cb756129a414b854c + bytecode: 8b851887789d1b0d14a68de7f393a839940770b54680c74656c872dde5ff20dc + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.out new file mode 100644 index 0000000000..e09a5b1987 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 992dd740994079e30efead06f29f9c2df115a70d54f7649eb5fadec3120db120 + type_checked_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + unrolled_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + initial_ast: f97cf6822b0b012e424cbf916f060884aee0a781f70c95c6f6c50672eaae8d94 + unrolled_ast: f97cf6822b0b012e424cbf916f060884aee0a781f70c95c6f6c50672eaae8d94 + ssa_ast: b80d4df95ee5316d676399a0b8e0049b465272bb7ed2f67ea8b15b11f2cd01cc + flattened_ast: fff6defafaecbb94471f425c56ded3316fc09669ac96c3f2e860885fcd3f4c6a + inlined_ast: fff6defafaecbb94471f425c56ded3316fc09669ac96c3f2e860885fcd3f4c6a + dce_ast: c302f26c887a819542548c63ec9e5893d50156c9b938c5fdb0e4acb6261e7e81 + bytecode: 8cfc137d9de5f78970ffe8a7fd36cf828d967798364ebb25ed2654f97e993df2 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.out new file mode 100644 index 0000000000..c261d56673 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 7c89248ded858c5bc52c59d418ebea9937f41f59e113313a43dce30d21780db9 + type_checked_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + unrolled_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + initial_ast: 0ea3cd238cece2bd3f9e9627751791f8bdb2ccf8d62b2d4c92f08fdc9949d8d5 + unrolled_ast: 0ea3cd238cece2bd3f9e9627751791f8bdb2ccf8d62b2d4c92f08fdc9949d8d5 + ssa_ast: 91d7fe587ea671b61a23af52e63ae1d8f85f43765a4875c72fff5409e437f808 + flattened_ast: 7097a1be09831ae10e89be40923603fc98308c8591feeee4d14cb96c68265c26 + inlined_ast: 7097a1be09831ae10e89be40923603fc98308c8591feeee4d14cb96c68265c26 + dce_ast: b685e8e5212f711fe3d257768182f38e9253f4e8fb7f925c85c95ce634b8654d + bytecode: e21f3d467b66f55e41c864391412af065fcfd0b44bb6697e68693b5c8620e4bc + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.out b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.out new file mode 100644 index 0000000000..39fa77ed78 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 9de9a9614bae9e392c40cbe50c32763866d8facbe3b7b0e618c773c9c1e2452b + type_checked_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + unrolled_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + initial_ast: 1293ea0a9fd32b3ab0da2f2df8f4f6123aca459e304681f9b2678cc5523bd026 + unrolled_ast: 1293ea0a9fd32b3ab0da2f2df8f4f6123aca459e304681f9b2678cc5523bd026 + ssa_ast: 596408067fa115be60a4c66fce8f2edb079521cc0bb3cb676827f1d81a2fe567 + flattened_ast: d31ff87aed6db6e61f4ea3feb7ff9cfe7a521d69b02572d71bac4f758984f338 + inlined_ast: d31ff87aed6db6e61f4ea3feb7ff9cfe7a521d69b02572d71bac4f758984f338 + dce_ast: 1a5e594f5af0dd258b4d8a88fad977dcb51b50bb6e410422664ad271b227b0bd + bytecode: 999b9d0cdf8e006833a2d8ce94eb8ace714cd08c8df3e0b3531e28f6489e0984 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.out new file mode 100644 index 0000000000..29bd7f452a --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: d61b6c9a81578cd47a707319541ce1cea3ac5e20020f2a5b8c0b0363df72ceb4 + type_checked_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + unrolled_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + initial_ast: 7c3269a344a832f4e6b5b092c3f08f98e784aa3ca7187e16738d10a5bf702c72 + unrolled_ast: 7c3269a344a832f4e6b5b092c3f08f98e784aa3ca7187e16738d10a5bf702c72 + ssa_ast: f48c51473878f28bd896beadefebd2d0e98283d04137c3dab6d68511dd6b5c48 + flattened_ast: 88061d4bdb65f5281592a16a8bc24fc6b83aa59bd4bf617bcd4b080adce464a0 + inlined_ast: 88061d4bdb65f5281592a16a8bc24fc6b83aa59bd4bf617bcd4b080adce464a0 + dce_ast: 3bf1d88752e451f461637005c988ddca8c71669054b4ed5b9a0c6f48a7b34a53 + bytecode: 88e5bed3bec5448667a7407b85018435a99703ea27f2e24c965cee2b37ae5dc3 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.out new file mode 100644 index 0000000000..d4ab2c49f4 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 077422b93c97f7cd8a28ff1ba7bbe58e07c4b7887304c46d35eb5ac6bf23c972 + type_checked_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + unrolled_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + initial_ast: ab7d012e02d49ffef0d08b47c95251c3d621054de5176dcdae1a6320691b3d1a + unrolled_ast: ab7d012e02d49ffef0d08b47c95251c3d621054de5176dcdae1a6320691b3d1a + ssa_ast: 20e093c7b4410425ab54f784b8d43bd0bda23803446a089dcbfc99c9af327c63 + flattened_ast: 1a10b58e36bf0e71c6263af2a79ae1181826c5af78cd127f570ea5e578e48530 + inlined_ast: 1a10b58e36bf0e71c6263af2a79ae1181826c5af78cd127f570ea5e578e48530 + dce_ast: d41a624032b738c305931aab7e92f786255c20ce1f4f12b1aaef6d844ac2a91f + bytecode: 9b27d0806063bc598a773122d554a2d3da168e9813e2c2e55c4e0eedc2198f1c + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.out new file mode 100644 index 0000000000..02a1a84a58 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 0b9e361a60499d11d8de9a427cd689b0904e3660092b6ff95a1c07bf09964e11 + type_checked_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + unrolled_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + initial_ast: 93cdbd224664c44377b1ccc6459e28f4ba0650ec615433a7617c077c642ecaa3 + unrolled_ast: 93cdbd224664c44377b1ccc6459e28f4ba0650ec615433a7617c077c642ecaa3 + ssa_ast: 2edc5eee55afb31b5728ad0d2ada8143d8cdbca838cb76921713355e50422bdc + flattened_ast: 89a72dfe8ca7e294566e33fdfb8ba91f9d910b91815800bcae4dc897b4067b54 + inlined_ast: 89a72dfe8ca7e294566e33fdfb8ba91f9d910b91815800bcae4dc897b4067b54 + dce_ast: 85c5305f13ada6e8522b64d2acdfdad55c171f93c4ceed4db798f047481d5495 + bytecode: 6965d0539f26e7885d7fa616d93bb5326315793d3843573135bcda58cbaeb149 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.out new file mode 100644 index 0000000000..a1f4b474eb --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 85b2afdf445a99fc5beb1bb9b7c98ddce8f4936dbdb5173447e64bfc5c73e96d + type_checked_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + unrolled_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + initial_ast: e77ae4c9d73a0e0ec3125674deb07bac8be5eab932154cbe69d075db4478d8f1 + unrolled_ast: e77ae4c9d73a0e0ec3125674deb07bac8be5eab932154cbe69d075db4478d8f1 + ssa_ast: 53242edad187f8d960912edcf85ee98923a7bc61a0c31f3f3f5fcc1349eb1cf7 + flattened_ast: 05a83f18d37cd0c863957fc2ecd790912cd251608f8d8b663ae53de83e0513e1 + inlined_ast: 05a83f18d37cd0c863957fc2ecd790912cd251608f8d8b663ae53de83e0513e1 + dce_ast: 3896b0f70addb35a89c05cb53f980fafc9d9050c57049298fe47ea72ee6ef89c + bytecode: c497462939dadd3b6fa6a391939d169f8caf2da5064471e177e9dc2ca24af1c0 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.out new file mode 100644 index 0000000000..119779e815 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: e57034c883f65a0bf8bf21c5948e8e470938929205661f4629331145f96f457a + type_checked_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + unrolled_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + initial_ast: 83f5bc1862345a3f0f9751f3cca5249d479b3f45d14b1a41e19e14ab99a318e0 + unrolled_ast: 83f5bc1862345a3f0f9751f3cca5249d479b3f45d14b1a41e19e14ab99a318e0 + ssa_ast: b6775601268fc31d6958c11294b516b366e68604e748cff6204a091ac0d4e5da + flattened_ast: 475da3a29a106c93fbc55eb2f007687aa3aa967dce2b211e0aadc2743c58f07b + inlined_ast: 475da3a29a106c93fbc55eb2f007687aa3aa967dce2b211e0aadc2743c58f07b + dce_ast: 39fd0a2567410ff9acd7e92988163c1b5a5926f89ed62e862fc2173560abb7fd + bytecode: 26f4c496d5e435d186f9ec58390da76af8848cecaaac30920a4daab0e2523a73 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.out new file mode 100644 index 0000000000..703d3d4074 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 30b74ef9405be6a65d0718e893155dfab9c5a27ba6331b46674fbfe804c078c7 + type_checked_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + unrolled_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + initial_ast: f026139202150198f479e35bd573496cc0c6c7b8bc02be9062326e267ed8f917 + unrolled_ast: f026139202150198f479e35bd573496cc0c6c7b8bc02be9062326e267ed8f917 + ssa_ast: f4fd06f27f544ed914d9c37714b0b75f0dc82598336dbd8362a387980f6845f5 + flattened_ast: 4ea4494f16680702cffb88f2ffb5be873127858252ef87bc7ddc5900cb998b33 + inlined_ast: 4ea4494f16680702cffb88f2ffb5be873127858252ef87bc7ddc5900cb998b33 + dce_ast: 250f6a9533ea59fade92d9257b6777cdbf3547c9ac6e3ea3855beddd5af3b13f + bytecode: 9a6698dbd340581ab6a6ab74e6ac3b2b04d107afafb2ef967cf878a68f90e66a + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.out new file mode 100644 index 0000000000..b5efad08a9 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 5a59bc205eed395ed0a857abe27790d3612aaac26fce76ec8b77b539dd85b4ad + type_checked_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + unrolled_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + initial_ast: d6c6e1e9114f2e6e35a27163bb96e8f3559c1a1ce48a53b95eb68c336829d61b + unrolled_ast: d6c6e1e9114f2e6e35a27163bb96e8f3559c1a1ce48a53b95eb68c336829d61b + ssa_ast: 97e9d6c5c2bb1d1a0ae488932c71c058601a7eebfda5d8a30b94735e874821c8 + flattened_ast: c532ab105e2aba5ec04d199f098baf16f895242af400b06f67912ccb8380f662 + inlined_ast: c532ab105e2aba5ec04d199f098baf16f895242af400b06f67912ccb8380f662 + dce_ast: fdde53b7506a6811ceba22fecd33d485181de0f73ae969d4ada64dfcee8098e1 + bytecode: 382d6faca5454efb2c43e692e7ef46168de32044fd4eb589025fb7dabc62d3bb + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.out new file mode 100644 index 0000000000..b4721747ce --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 992dd740994079e30efead06f29f9c2df115a70d54f7649eb5fadec3120db120 + type_checked_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + unrolled_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + initial_ast: e40d10bf0bbb177d1cbe5f53035b4f4ca5173e28ae7643f054b43a8de3c3f5d0 + unrolled_ast: e40d10bf0bbb177d1cbe5f53035b4f4ca5173e28ae7643f054b43a8de3c3f5d0 + ssa_ast: 4af71aa576bccbdca88413a4326bec924110e06650eef6d32903601bad53fa5a + flattened_ast: b4365715971ce614d4620925a32f8104e5960b7684bc9fe351dbec9b49f0754a + inlined_ast: b4365715971ce614d4620925a32f8104e5960b7684bc9fe351dbec9b49f0754a + dce_ast: 4a2a899efd4a266c18f72938c37d42a4e6a91af5dbe0f9a7ba21a29fd7860b23 + bytecode: cdf35ecca4bd73879647e3f8b20554dc0c6bea1b7064b2e62fe501aaf54469e8 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.out new file mode 100644 index 0000000000..13a4fa79f3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 7c89248ded858c5bc52c59d418ebea9937f41f59e113313a43dce30d21780db9 + type_checked_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + unrolled_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + initial_ast: 1481e2c29419e537e9c8243ee74b10c6de58f5428db1399862784ee9e304b63b + unrolled_ast: 1481e2c29419e537e9c8243ee74b10c6de58f5428db1399862784ee9e304b63b + ssa_ast: 80bd7ec9a3d56da47469c65c3c533a4127665992b167c311dd8164728184ba90 + flattened_ast: 152fb4952598ef6eaf75a5a972a38f00d3d2a43c2b627309fd7b1164f0fa5fee + inlined_ast: 152fb4952598ef6eaf75a5a972a38f00d3d2a43c2b627309fd7b1164f0fa5fee + dce_ast: 57b269b910800a713b821d8f285ed632d274ac0b97277df14f1d1355bf8f404d + bytecode: d7b1e51dba2a0e4e06e66b15ff10ea2c3d799073949f6b155489a46bbae70395 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.out b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.out new file mode 100644 index 0000000000..14ba6dbdb8 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 9de9a9614bae9e392c40cbe50c32763866d8facbe3b7b0e618c773c9c1e2452b + type_checked_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + unrolled_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + initial_ast: 7ec1dd301960dc49ce741a6cce2fc7cdf6bb63394fe012522d2763ba460fb6d8 + unrolled_ast: 7ec1dd301960dc49ce741a6cce2fc7cdf6bb63394fe012522d2763ba460fb6d8 + ssa_ast: fee00d77a912cb653b2fd33d98334490b832ea4456995ef24b02de8e1791f61e + flattened_ast: cd239b04a842a29071b4bc9bf4164bc4971818a451043d7ea133018b32ad8ede + inlined_ast: cd239b04a842a29071b4bc9bf4164bc4971818a451043d7ea133018b32ad8ede + dce_ast: 8fa60a1f89693094383fc5bdf26cb69a99a6a96d9db00ed54e918e560fc5bc78 + bytecode: 1729c5267f2280cfde27fd1c7806b03bb56e95306b8c269d0c186f05365ccef5 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak256_hash_to_address.out b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_address.out new file mode 100644 index 0000000000..fe9e0b04a7 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_address.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + unrolled_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + initial_ast: f3fc8cda6ed0473de45f4c599fa6ff48bc6d2cef5a901f9ca5f45a449c19a66a + unrolled_ast: f3fc8cda6ed0473de45f4c599fa6ff48bc6d2cef5a901f9ca5f45a449c19a66a + ssa_ast: 125b5c6e7c9940f58b255d02b7f83ef44de863263a4169cf3df35f3d6935c1fb + flattened_ast: 2b1e7b92b0e1c54cccff73023ca835cc83ec9f0987d6369f130281b4e8a94ad2 + inlined_ast: 2b1e7b92b0e1c54cccff73023ca835cc83ec9f0987d6369f130281b4e8a94ad2 + dce_ast: b18fecc1fb16346a6a66e69b7bd9e65c40f4640f551f6e2f44777a18c8d00178 + bytecode: 03845ec2f54d49f71640659603ead8f68ad067a15fda438e5e13524777d1559b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak256_hash_to_field.out b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_field.out new file mode 100644 index 0000000000..0564480d63 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_field.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + unrolled_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + initial_ast: 954eb3c2890226ed99e460fb27372568832f225b9f3ff043cec27d366e77e680 + unrolled_ast: 954eb3c2890226ed99e460fb27372568832f225b9f3ff043cec27d366e77e680 + ssa_ast: e72f4513bcab0b7229e2b1b4ae4c3af7ec02b6e8771c4ffa737f463f48adc144 + flattened_ast: 0556b16318972ed0d5f0fa09a6d6e9bc93071df66c554da2ff3b35c02a22a381 + inlined_ast: 0556b16318972ed0d5f0fa09a6d6e9bc93071df66c554da2ff3b35c02a22a381 + dce_ast: 78b479aca57ab3c141525758af93993561f2bddf765ba4dff76eb29c18c7f941 + bytecode: 21736a09a94367a2bf017cd7dc7dade802a2f064f2343cd3d295eac4e3dca0ae + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak256_hash_to_group.out b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_group.out new file mode 100644 index 0000000000..db66bea880 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_group.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: fd9620b494239c2b62c2da7b951d51f08a1c0ad366a726e6b108da648ce5fb58 + type_checked_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + unrolled_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + initial_ast: df29eb947655e0b15d8816ffd7f1d1c67e4b74824c1180123d5130f6f7aa2281 + unrolled_ast: df29eb947655e0b15d8816ffd7f1d1c67e4b74824c1180123d5130f6f7aa2281 + ssa_ast: 060a8cf08cd57730a0f6d694a2f7810c1ea3a39095a7380893fb5d863139d4b9 + flattened_ast: eee3d32337729dee18fb66fbaf6557c4daf0cdeef0b79870dee42726fa8e5070 + inlined_ast: eee3d32337729dee18fb66fbaf6557c4daf0cdeef0b79870dee42726fa8e5070 + dce_ast: f04596e25887e067da907ed7f037cf21fae4897732ad81964fb428f58f9f0a8c + bytecode: 12b2cee6aa44638371f466d0f9a4b6396e2a466669a11a938b7ac251a5b23eb6 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak256_hash_to_scalar.out b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_scalar.out new file mode 100644 index 0000000000..b3dac6386c --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak256_hash_to_scalar.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 15549a7085ac019c35b881b7ef00f56cbfbf0a21e9ceb4d4599fa4e06359d9e5 + type_checked_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + unrolled_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + initial_ast: cc840ffb92a26a2b3e8ca04f93c40944faf213e87a387ee4bda0465e074ea6ce + unrolled_ast: cc840ffb92a26a2b3e8ca04f93c40944faf213e87a387ee4bda0465e074ea6ce + ssa_ast: 1278525717fa5e9b2c22c391edfe10c14804f5d674a358885f38a10185db9ea0 + flattened_ast: d03e19c50971c93b1594b41c94e85e8b0ad2c374c95b7fc87b6e10b5cbbd10fb + inlined_ast: d03e19c50971c93b1594b41c94e85e8b0ad2c374c95b7fc87b6e10b5cbbd10fb + dce_ast: 3c623604b706161adab3235f7a0124ce3be34a32319640ff941c89aade6fa080 + bytecode: 9600a008a2a7ac916f8e19cd292c150bf1474805e87b407c17fc2e079013c356 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak384_hash_to_address.out b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_address.out new file mode 100644 index 0000000000..3ef7680208 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_address.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + unrolled_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + initial_ast: 1f3f713689a364da7799bed1cb13a41dfddcf0f2b0d6cca10ed05f7d6b30df3b + unrolled_ast: 1f3f713689a364da7799bed1cb13a41dfddcf0f2b0d6cca10ed05f7d6b30df3b + ssa_ast: 1dd688e597454010c9a0822be172e4b8bc47381915b896cd5d8e97fa0914c1c7 + flattened_ast: dc3cf8e9ac7249ffc35d02b8914989d6449b1fb37395577cf3dc96555fc4bd13 + inlined_ast: dc3cf8e9ac7249ffc35d02b8914989d6449b1fb37395577cf3dc96555fc4bd13 + dce_ast: b18fecc1fb16346a6a66e69b7bd9e65c40f4640f551f6e2f44777a18c8d00178 + bytecode: 03845ec2f54d49f71640659603ead8f68ad067a15fda438e5e13524777d1559b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak384_hash_to_field.out b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_field.out new file mode 100644 index 0000000000..b55e2b1f8a --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_field.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + unrolled_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + initial_ast: 3a2576b0a93389ed4ec800447c3ffa4920033204b806fb6e6314cae96e6b5c03 + unrolled_ast: 3a2576b0a93389ed4ec800447c3ffa4920033204b806fb6e6314cae96e6b5c03 + ssa_ast: 1c5afbbce420c031f16b291d548ca2231b3dec0316664ce6547abca8f9a0cae2 + flattened_ast: a9a0a4c68f8b7561329bd7a9c7f81aaece939c9df14ff82508e9ddc05aad2bdb + inlined_ast: a9a0a4c68f8b7561329bd7a9c7f81aaece939c9df14ff82508e9ddc05aad2bdb + dce_ast: da75548e69f125b66b292cf4072e83b5fb6c92a6c40531655684f25428b6f08d + bytecode: f5347c70dbb10f7c191f2e29dc9b2e58760207351d34b8e0a5ccb91e360e9f79 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak384_hash_to_group.out b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_group.out new file mode 100644 index 0000000000..8bb291f1ab --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_group.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: fd9620b494239c2b62c2da7b951d51f08a1c0ad366a726e6b108da648ce5fb58 + type_checked_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + unrolled_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + initial_ast: 4247aabbd55a1e6a2cbfa7c299af86a89a7509ed0e13595b0bc46dfd44b595a7 + unrolled_ast: 4247aabbd55a1e6a2cbfa7c299af86a89a7509ed0e13595b0bc46dfd44b595a7 + ssa_ast: 4f62058738e58e69a13f043fb0665877fcba3dc44a97c5883de321264407c720 + flattened_ast: 0d294dddc5fbfa35fa5730199dc2144f186aa93d97b62b6af86a4b6d42d255a9 + inlined_ast: 0d294dddc5fbfa35fa5730199dc2144f186aa93d97b62b6af86a4b6d42d255a9 + dce_ast: d0ad3c52664b7926932d59b17f825bad6f9e4c831b1e0a87f803c3fb041f9a24 + bytecode: 7be24faec6f77c016109224b474ae5e5ef66bc3d02d058ae748d6b992990d165 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak384_hash_to_scalar.out b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_scalar.out new file mode 100644 index 0000000000..ed56b79952 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak384_hash_to_scalar.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 15549a7085ac019c35b881b7ef00f56cbfbf0a21e9ceb4d4599fa4e06359d9e5 + type_checked_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + unrolled_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + initial_ast: 74e647eaf625f542b53a0096abd2f97ce17a39ebff80bc8be69efdc92f42359b + unrolled_ast: 74e647eaf625f542b53a0096abd2f97ce17a39ebff80bc8be69efdc92f42359b + ssa_ast: f15e6d14da955177fe5c5809386d7a143dbfe27b84106153c5cce9054630c28e + flattened_ast: 7d565655b040b8d19ba55689d31a72786938c94e095ee0632dc8ac3f3421063f + inlined_ast: 7d565655b040b8d19ba55689d31a72786938c94e095ee0632dc8ac3f3421063f + dce_ast: 5ae10398955c28bfb3174b24653ae0859366395d12bd6e21af267da4d93bde41 + bytecode: b2109894ba866067ec33ab20cdc34620697485b592f6a0d511e922a89bb065e1 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak512_hash_to_address.out b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_address.out new file mode 100644 index 0000000000..91218f4dd7 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_address.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + unrolled_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + initial_ast: bedd5210c9c85926db1570286d3af26fa455ff15eaa1dd72b648db2009a7edd5 + unrolled_ast: bedd5210c9c85926db1570286d3af26fa455ff15eaa1dd72b648db2009a7edd5 + ssa_ast: ae982eca8c61dc6cec70947d683744e4396757533a89ff574da9879c24d536c6 + flattened_ast: 7cce5d9969b7a7fd5d9837c4bceff3a57b0aff536f9e4f7c420292a7a51854cd + inlined_ast: 7cce5d9969b7a7fd5d9837c4bceff3a57b0aff536f9e4f7c420292a7a51854cd + dce_ast: b18fecc1fb16346a6a66e69b7bd9e65c40f4640f551f6e2f44777a18c8d00178 + bytecode: 03845ec2f54d49f71640659603ead8f68ad067a15fda438e5e13524777d1559b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak512_hash_to_field.out b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_field.out new file mode 100644 index 0000000000..35fa091a57 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_field.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + unrolled_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + initial_ast: 41cbb2a60f56fb9e0635f3a11e959e9e75ba6a11541bbd47f7e1321dc7df7cdc + unrolled_ast: 41cbb2a60f56fb9e0635f3a11e959e9e75ba6a11541bbd47f7e1321dc7df7cdc + ssa_ast: e791d20adce2a317c4b36c7b64ffa3896b63ae3e9f386d285d93b26f73d45054 + flattened_ast: 0b89e25715c0ebbf8824c5455ac3baea84b9dc3066b534b4ff381a8e431baff7 + inlined_ast: 0b89e25715c0ebbf8824c5455ac3baea84b9dc3066b534b4ff381a8e431baff7 + dce_ast: 5b2c26b4368627ed2fe0d908b80b654b08093a2503987fe2548735e46dfd81f9 + bytecode: 31250720832dea7675bf097f3ff4a7e878a544854d76a583daeaa8508e5b7165 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak512_hash_to_group.out b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_group.out new file mode 100644 index 0000000000..2e5e6d85db --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_group.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: fd9620b494239c2b62c2da7b951d51f08a1c0ad366a726e6b108da648ce5fb58 + type_checked_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + unrolled_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + initial_ast: dc41c23161a01a00d01faa27e22454daac729a741d39c5c0f03f32388d709149 + unrolled_ast: dc41c23161a01a00d01faa27e22454daac729a741d39c5c0f03f32388d709149 + ssa_ast: 7d08d80254e02abdb4a4a5fee443f7f51bf03fa943086ae68816c93836764a8b + flattened_ast: 3f190fb474f52d158fb91c58481f3e8c188a454af068b0bcb38c85901ff9d1af + inlined_ast: 3f190fb474f52d158fb91c58481f3e8c188a454af068b0bcb38c85901ff9d1af + dce_ast: a324a68d939b144a29573c698e03464d2e2140fdc7f21fcfbe78e13697bf22cd + bytecode: 04dce70893b730595c768593a76510f027b13559817d71dc7b804933692e59a9 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/keccak512_hash_to_scalar.out b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_scalar.out new file mode 100644 index 0000000000..eea1416c74 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/keccak512_hash_to_scalar.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 15549a7085ac019c35b881b7ef00f56cbfbf0a21e9ceb4d4599fa4e06359d9e5 + type_checked_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + unrolled_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + initial_ast: 3c939d7f3076e6edf7f74ddb21ee27196d969bf78c7611677641ffdf0f1322c3 + unrolled_ast: 3c939d7f3076e6edf7f74ddb21ee27196d969bf78c7611677641ffdf0f1322c3 + ssa_ast: c17b9dc607933ace7772f121637ca1eb8e1d9d689e48c0c5297adb25832d5c12 + flattened_ast: e889acf552b1994212ddccdfc230db3bbd42abd2f40720d1481dc5513626f0b1 + inlined_ast: e889acf552b1994212ddccdfc230db3bbd42abd2f40720d1481dc5513626f0b1 + dce_ast: 296741a087aa45358113d04edef2c5f5764da3073cd710132b8d71a91b7abcc1 + bytecode: 48564e67f77504fa5f896b7b8f03dcc3bd690898df96eed9027776e1346b07ad + warnings: "" diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.leo new file mode 100644 index 0000000000..ef3d9a5e02 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_i128 tests + let a: i128 = Keccak256::hash_to_i128(addr_value); + let b: i128 = Keccak256::hash_to_i128(bool_value); + let c: i128 = Keccak256::hash_to_i128(field_value); + let d: i128 = Keccak256::hash_to_i128(group_value); + let e: i128 = Keccak256::hash_to_i128(i8_value); + let f: i128 = Keccak256::hash_to_i128(i16_value); + let g: i128 = Keccak256::hash_to_i128(i32_value); + let h: i128 = Keccak256::hash_to_i128(i64_value); + let i: i128 = Keccak256::hash_to_i128(i128_value); + let j: i128 = Keccak256::hash_to_i128(u8_value); + let k: i128 = Keccak256::hash_to_i128(u16_value); + let l: i128 = Keccak256::hash_to_i128(u32_value); + let m: i128 = Keccak256::hash_to_i128(u64_value); + let n: i128 = Keccak256::hash_to_i128(u128_value); + let o: i128 = Keccak256::hash_to_i128(scalar_value); + // let p: i128 = Keccak256::hash_to_i128(string_value); + let q: i128 = Keccak256::hash_to_i128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.leo new file mode 100644 index 0000000000..a72047cd5b --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_i16 tests + let a: i16 = Keccak256::hash_to_i16(addr_value); + let b: i16 = Keccak256::hash_to_i16(bool_value); + let c: i16 = Keccak256::hash_to_i16(field_value); + let d: i16 = Keccak256::hash_to_i16(group_value); + let e: i16 = Keccak256::hash_to_i16(i8_value); + let f: i16 = Keccak256::hash_to_i16(i16_value); + let g: i16 = Keccak256::hash_to_i16(i32_value); + let h: i16 = Keccak256::hash_to_i16(i64_value); + let i: i16 = Keccak256::hash_to_i16(i128_value); + let j: i16 = Keccak256::hash_to_i16(u8_value); + let k: i16 = Keccak256::hash_to_i16(u16_value); + let l: i16 = Keccak256::hash_to_i16(u32_value); + let m: i16 = Keccak256::hash_to_i16(u64_value); + let n: i16 = Keccak256::hash_to_i16(u128_value); + let o: i16 = Keccak256::hash_to_i16(scalar_value); + // let p: i16 = Keccak256::hash_to_i16(string_value); + let q: i16 = Keccak256::hash_to_i16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.leo new file mode 100644 index 0000000000..4fd72df1d2 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_i32 tests + let a: i32 = Keccak256::hash_to_i32(addr_value); + let b: i32 = Keccak256::hash_to_i32(bool_value); + let c: i32 = Keccak256::hash_to_i32(field_value); + let d: i32 = Keccak256::hash_to_i32(group_value); + let e: i32 = Keccak256::hash_to_i32(i8_value); + let f: i32 = Keccak256::hash_to_i32(i16_value); + let g: i32 = Keccak256::hash_to_i32(i32_value); + let h: i32 = Keccak256::hash_to_i32(i64_value); + let i: i32 = Keccak256::hash_to_i32(i128_value); + let j: i32 = Keccak256::hash_to_i32(u8_value); + let k: i32 = Keccak256::hash_to_i32(u16_value); + let l: i32 = Keccak256::hash_to_i32(u32_value); + let m: i32 = Keccak256::hash_to_i32(u64_value); + let n: i32 = Keccak256::hash_to_i32(u128_value); + let o: i32 = Keccak256::hash_to_i32(scalar_value); + // let p: i32 = Keccak256::hash_to_i32(string_value); + let q: i32 = Keccak256::hash_to_i32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.leo new file mode 100644 index 0000000000..88ed60a9ec --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_i64 tests + let a: i64 = Keccak256::hash_to_i64(addr_value); + let b: i64 = Keccak256::hash_to_i64(bool_value); + let c: i64 = Keccak256::hash_to_i64(field_value); + let d: i64 = Keccak256::hash_to_i64(group_value); + let e: i64 = Keccak256::hash_to_i64(i8_value); + let f: i64 = Keccak256::hash_to_i64(i16_value); + let g: i64 = Keccak256::hash_to_i64(i32_value); + let h: i64 = Keccak256::hash_to_i64(i64_value); + let i: i64 = Keccak256::hash_to_i64(i128_value); + let j: i64 = Keccak256::hash_to_i64(u8_value); + let k: i64 = Keccak256::hash_to_i64(u16_value); + let l: i64 = Keccak256::hash_to_i64(u32_value); + let m: i64 = Keccak256::hash_to_i64(u64_value); + let n: i64 = Keccak256::hash_to_i64(u128_value); + let o: i64 = Keccak256::hash_to_i64(scalar_value); + // let p: i64 = Keccak256::hash_to_i64(string_value); + let q: i64 = Keccak256::hash_to_i64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.leo new file mode 100644 index 0000000000..88fa58877e --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_i8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_i8 tests + let a: i8 = Keccak256::hash_to_i8(addr_value); + let b: i8 = Keccak256::hash_to_i8(bool_value); + let c: i8 = Keccak256::hash_to_i8(field_value); + let d: i8 = Keccak256::hash_to_i8(group_value); + let e: i8 = Keccak256::hash_to_i8(i8_value); + let f: i8 = Keccak256::hash_to_i8(i16_value); + let g: i8 = Keccak256::hash_to_i8(i32_value); + let h: i8 = Keccak256::hash_to_i8(i64_value); + let i: i8 = Keccak256::hash_to_i8(i128_value); + let j: i8 = Keccak256::hash_to_i8(u8_value); + let k: i8 = Keccak256::hash_to_i8(u16_value); + let l: i8 = Keccak256::hash_to_i8(u32_value); + let m: i8 = Keccak256::hash_to_i8(u64_value); + let n: i8 = Keccak256::hash_to_i8(u128_value); + let o: i8 = Keccak256::hash_to_i8(scalar_value); + // let p: i8 = Keccak256::hash_to_i8(string_value); + let q: i8 = Keccak256::hash_to_i8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.leo new file mode 100644 index 0000000000..329d90f682 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_u128 tests + let a: u128 = Keccak256::hash_to_u128(addr_value); + let b: u128 = Keccak256::hash_to_u128(bool_value); + let c: u128 = Keccak256::hash_to_u128(field_value); + let d: u128 = Keccak256::hash_to_u128(group_value); + let e: u128 = Keccak256::hash_to_u128(i8_value); + let f: u128 = Keccak256::hash_to_u128(i16_value); + let g: u128 = Keccak256::hash_to_u128(i32_value); + let h: u128 = Keccak256::hash_to_u128(i64_value); + let i: u128 = Keccak256::hash_to_u128(i128_value); + let j: u128 = Keccak256::hash_to_u128(u8_value); + let k: u128 = Keccak256::hash_to_u128(u16_value); + let l: u128 = Keccak256::hash_to_u128(u32_value); + let m: u128 = Keccak256::hash_to_u128(u64_value); + let n: u128 = Keccak256::hash_to_u128(u128_value); + let o: u128 = Keccak256::hash_to_u128(scalar_value); + // let p: u128 = Keccak256::hash_to_u128(string_value); + let q: u128 = Keccak256::hash_to_u128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.leo new file mode 100644 index 0000000000..f6398803b7 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_u16 tests + let a: u16 = Keccak256::hash_to_u16(addr_value); + let b: u16 = Keccak256::hash_to_u16(bool_value); + let c: u16 = Keccak256::hash_to_u16(field_value); + let d: u16 = Keccak256::hash_to_u16(group_value); + let e: u16 = Keccak256::hash_to_u16(i8_value); + let f: u16 = Keccak256::hash_to_u16(i16_value); + let g: u16 = Keccak256::hash_to_u16(i32_value); + let h: u16 = Keccak256::hash_to_u16(i64_value); + let i: u16 = Keccak256::hash_to_u16(i128_value); + let j: u16 = Keccak256::hash_to_u16(u8_value); + let k: u16 = Keccak256::hash_to_u16(u16_value); + let l: u16 = Keccak256::hash_to_u16(u32_value); + let m: u16 = Keccak256::hash_to_u16(u64_value); + let n: u16 = Keccak256::hash_to_u16(u128_value); + let o: u16 = Keccak256::hash_to_u16(scalar_value); + // let p: u16 = Keccak256::hash_to_u16(string_value); + let q: u16 = Keccak256::hash_to_u16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.leo new file mode 100644 index 0000000000..2942b5b8bc --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_u32 tests + let a: u32 = Keccak256::hash_to_u32(addr_value); + let b: u32 = Keccak256::hash_to_u32(bool_value); + let c: u32 = Keccak256::hash_to_u32(field_value); + let d: u32 = Keccak256::hash_to_u32(group_value); + let e: u32 = Keccak256::hash_to_u32(i8_value); + let f: u32 = Keccak256::hash_to_u32(i16_value); + let g: u32 = Keccak256::hash_to_u32(i32_value); + let h: u32 = Keccak256::hash_to_u32(i64_value); + let i: u32 = Keccak256::hash_to_u32(i128_value); + let j: u32 = Keccak256::hash_to_u32(u8_value); + let k: u32 = Keccak256::hash_to_u32(u16_value); + let l: u32 = Keccak256::hash_to_u32(u32_value); + let m: u32 = Keccak256::hash_to_u32(u64_value); + let n: u32 = Keccak256::hash_to_u32(u128_value); + let o: u32 = Keccak256::hash_to_u32(scalar_value); + // let p: u32 = Keccak256::hash_to_u32(string_value); + let q: u32 = Keccak256::hash_to_u32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.leo new file mode 100644 index 0000000000..d1a36f06a2 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_u64 tests + let a: u64 = Keccak256::hash_to_u64(addr_value); + let b: u64 = Keccak256::hash_to_u64(bool_value); + let c: u64 = Keccak256::hash_to_u64(field_value); + let d: u64 = Keccak256::hash_to_u64(group_value); + let e: u64 = Keccak256::hash_to_u64(i8_value); + let f: u64 = Keccak256::hash_to_u64(i16_value); + let g: u64 = Keccak256::hash_to_u64(i32_value); + let h: u64 = Keccak256::hash_to_u64(i64_value); + let i: u64 = Keccak256::hash_to_u64(i128_value); + let j: u64 = Keccak256::hash_to_u64(u8_value); + let k: u64 = Keccak256::hash_to_u64(u16_value); + let l: u64 = Keccak256::hash_to_u64(u32_value); + let m: u64 = Keccak256::hash_to_u64(u64_value); + let n: u64 = Keccak256::hash_to_u64(u128_value); + let o: u64 = Keccak256::hash_to_u64(scalar_value); + // let p: u64 = Keccak256::hash_to_u64(string_value); + let q: u64 = Keccak256::hash_to_u64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.leo b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.leo new file mode 100644 index 0000000000..1df7e292f2 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak256/keccak256_hash_to_u8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_u8 tests + let a: u8 = Keccak256::hash_to_u8(addr_value); + let b: u8 = Keccak256::hash_to_u8(bool_value); + let c: u8 = Keccak256::hash_to_u8(field_value); + let d: u8 = Keccak256::hash_to_u8(group_value); + let e: u8 = Keccak256::hash_to_u8(i8_value); + let f: u8 = Keccak256::hash_to_u8(i16_value); + let g: u8 = Keccak256::hash_to_u8(i32_value); + let h: u8 = Keccak256::hash_to_u8(i64_value); + let i: u8 = Keccak256::hash_to_u8(i128_value); + let j: u8 = Keccak256::hash_to_u8(u8_value); + let k: u8 = Keccak256::hash_to_u8(u16_value); + let l: u8 = Keccak256::hash_to_u8(u32_value); + let m: u8 = Keccak256::hash_to_u8(u64_value); + let n: u8 = Keccak256::hash_to_u8(u128_value); + let o: u8 = Keccak256::hash_to_u8(scalar_value); + // let p: u8 = Keccak256::hash_to_u8(string_value); + let q: u8 = Keccak256::hash_to_u8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.leo new file mode 100644 index 0000000000..180e158b23 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_i128 tests + let a: i128 = Keccak384::hash_to_i128(addr_value); + let b: i128 = Keccak384::hash_to_i128(bool_value); + let c: i128 = Keccak384::hash_to_i128(field_value); + let d: i128 = Keccak384::hash_to_i128(group_value); + let e: i128 = Keccak384::hash_to_i128(i8_value); + let f: i128 = Keccak384::hash_to_i128(i16_value); + let g: i128 = Keccak384::hash_to_i128(i32_value); + let h: i128 = Keccak384::hash_to_i128(i64_value); + let i: i128 = Keccak384::hash_to_i128(i128_value); + let j: i128 = Keccak384::hash_to_i128(u8_value); + let k: i128 = Keccak384::hash_to_i128(u16_value); + let l: i128 = Keccak384::hash_to_i128(u32_value); + let m: i128 = Keccak384::hash_to_i128(u64_value); + let n: i128 = Keccak384::hash_to_i128(u128_value); + let o: i128 = Keccak384::hash_to_i128(scalar_value); + // let p: i128 = Keccak384::hash_to_i128(string_value); + let q: i128 = Keccak384::hash_to_i128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.leo new file mode 100644 index 0000000000..a0d60a327c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_i16 tests + let a: i16 = Keccak384::hash_to_i16(addr_value); + let b: i16 = Keccak384::hash_to_i16(bool_value); + let c: i16 = Keccak384::hash_to_i16(field_value); + let d: i16 = Keccak384::hash_to_i16(group_value); + let e: i16 = Keccak384::hash_to_i16(i8_value); + let f: i16 = Keccak384::hash_to_i16(i16_value); + let g: i16 = Keccak384::hash_to_i16(i32_value); + let h: i16 = Keccak384::hash_to_i16(i64_value); + let i: i16 = Keccak384::hash_to_i16(i128_value); + let j: i16 = Keccak384::hash_to_i16(u8_value); + let k: i16 = Keccak384::hash_to_i16(u16_value); + let l: i16 = Keccak384::hash_to_i16(u32_value); + let m: i16 = Keccak384::hash_to_i16(u64_value); + let n: i16 = Keccak384::hash_to_i16(u128_value); + let o: i16 = Keccak384::hash_to_i16(scalar_value); + // let p: i16 = Keccak384::hash_to_i16(string_value); + let q: i16 = Keccak384::hash_to_i16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.leo new file mode 100644 index 0000000000..a9fd3deb18 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_i32 tests + let a: i32 = Keccak384::hash_to_i32(addr_value); + let b: i32 = Keccak384::hash_to_i32(bool_value); + let c: i32 = Keccak384::hash_to_i32(field_value); + let d: i32 = Keccak384::hash_to_i32(group_value); + let e: i32 = Keccak384::hash_to_i32(i8_value); + let f: i32 = Keccak384::hash_to_i32(i16_value); + let g: i32 = Keccak384::hash_to_i32(i32_value); + let h: i32 = Keccak384::hash_to_i32(i64_value); + let i: i32 = Keccak384::hash_to_i32(i128_value); + let j: i32 = Keccak384::hash_to_i32(u8_value); + let k: i32 = Keccak384::hash_to_i32(u16_value); + let l: i32 = Keccak384::hash_to_i32(u32_value); + let m: i32 = Keccak384::hash_to_i32(u64_value); + let n: i32 = Keccak384::hash_to_i32(u128_value); + let o: i32 = Keccak384::hash_to_i32(scalar_value); + // let p: i32 = Keccak384::hash_to_i32(string_value); + let q: i32 = Keccak384::hash_to_i32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.leo new file mode 100644 index 0000000000..777bb3d942 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_i64 tests + let a: i64 = Keccak384::hash_to_i64(addr_value); + let b: i64 = Keccak384::hash_to_i64(bool_value); + let c: i64 = Keccak384::hash_to_i64(field_value); + let d: i64 = Keccak384::hash_to_i64(group_value); + let e: i64 = Keccak384::hash_to_i64(i8_value); + let f: i64 = Keccak384::hash_to_i64(i16_value); + let g: i64 = Keccak384::hash_to_i64(i32_value); + let h: i64 = Keccak384::hash_to_i64(i64_value); + let i: i64 = Keccak384::hash_to_i64(i128_value); + let j: i64 = Keccak384::hash_to_i64(u8_value); + let k: i64 = Keccak384::hash_to_i64(u16_value); + let l: i64 = Keccak384::hash_to_i64(u32_value); + let m: i64 = Keccak384::hash_to_i64(u64_value); + let n: i64 = Keccak384::hash_to_i64(u128_value); + let o: i64 = Keccak384::hash_to_i64(scalar_value); + // let p: i64 = Keccak384::hash_to_i64(string_value); + let q: i64 = Keccak384::hash_to_i64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.leo new file mode 100644 index 0000000000..bc3c0a827c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_i8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_i8 tests + let a: i8 = Keccak384::hash_to_i8(addr_value); + let b: i8 = Keccak384::hash_to_i8(bool_value); + let c: i8 = Keccak384::hash_to_i8(field_value); + let d: i8 = Keccak384::hash_to_i8(group_value); + let e: i8 = Keccak384::hash_to_i8(i8_value); + let f: i8 = Keccak384::hash_to_i8(i16_value); + let g: i8 = Keccak384::hash_to_i8(i32_value); + let h: i8 = Keccak384::hash_to_i8(i64_value); + let i: i8 = Keccak384::hash_to_i8(i128_value); + let j: i8 = Keccak384::hash_to_i8(u8_value); + let k: i8 = Keccak384::hash_to_i8(u16_value); + let l: i8 = Keccak384::hash_to_i8(u32_value); + let m: i8 = Keccak384::hash_to_i8(u64_value); + let n: i8 = Keccak384::hash_to_i8(u128_value); + let o: i8 = Keccak384::hash_to_i8(scalar_value); + // let p: i8 = Keccak384::hash_to_i8(string_value); + let q: i8 = Keccak384::hash_to_i8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.leo new file mode 100644 index 0000000000..cb27ac589c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_u128 tests + let a: u128 = Keccak384::hash_to_u128(addr_value); + let b: u128 = Keccak384::hash_to_u128(bool_value); + let c: u128 = Keccak384::hash_to_u128(field_value); + let d: u128 = Keccak384::hash_to_u128(group_value); + let e: u128 = Keccak384::hash_to_u128(i8_value); + let f: u128 = Keccak384::hash_to_u128(i16_value); + let g: u128 = Keccak384::hash_to_u128(i32_value); + let h: u128 = Keccak384::hash_to_u128(i64_value); + let i: u128 = Keccak384::hash_to_u128(i128_value); + let j: u128 = Keccak384::hash_to_u128(u8_value); + let k: u128 = Keccak384::hash_to_u128(u16_value); + let l: u128 = Keccak384::hash_to_u128(u32_value); + let m: u128 = Keccak384::hash_to_u128(u64_value); + let n: u128 = Keccak384::hash_to_u128(u128_value); + let o: u128 = Keccak384::hash_to_u128(scalar_value); + // let p: u128 = Keccak384::hash_to_u128(string_value); + let q: u128 = Keccak384::hash_to_u128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.leo new file mode 100644 index 0000000000..b20200cd0e --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_u16 tests + let a: u16 = Keccak384::hash_to_u16(addr_value); + let b: u16 = Keccak384::hash_to_u16(bool_value); + let c: u16 = Keccak384::hash_to_u16(field_value); + let d: u16 = Keccak384::hash_to_u16(group_value); + let e: u16 = Keccak384::hash_to_u16(i8_value); + let f: u16 = Keccak384::hash_to_u16(i16_value); + let g: u16 = Keccak384::hash_to_u16(i32_value); + let h: u16 = Keccak384::hash_to_u16(i64_value); + let i: u16 = Keccak384::hash_to_u16(i128_value); + let j: u16 = Keccak384::hash_to_u16(u8_value); + let k: u16 = Keccak384::hash_to_u16(u16_value); + let l: u16 = Keccak384::hash_to_u16(u32_value); + let m: u16 = Keccak384::hash_to_u16(u64_value); + let n: u16 = Keccak384::hash_to_u16(u128_value); + let o: u16 = Keccak384::hash_to_u16(scalar_value); + // let p: u16 = Keccak384::hash_to_u16(string_value); + let q: u16 = Keccak384::hash_to_u16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.leo new file mode 100644 index 0000000000..ee3bc2ad0a --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_u32 tests + let a: u32 = Keccak384::hash_to_u32(addr_value); + let b: u32 = Keccak384::hash_to_u32(bool_value); + let c: u32 = Keccak384::hash_to_u32(field_value); + let d: u32 = Keccak384::hash_to_u32(group_value); + let e: u32 = Keccak384::hash_to_u32(i8_value); + let f: u32 = Keccak384::hash_to_u32(i16_value); + let g: u32 = Keccak384::hash_to_u32(i32_value); + let h: u32 = Keccak384::hash_to_u32(i64_value); + let i: u32 = Keccak384::hash_to_u32(i128_value); + let j: u32 = Keccak384::hash_to_u32(u8_value); + let k: u32 = Keccak384::hash_to_u32(u16_value); + let l: u32 = Keccak384::hash_to_u32(u32_value); + let m: u32 = Keccak384::hash_to_u32(u64_value); + let n: u32 = Keccak384::hash_to_u32(u128_value); + let o: u32 = Keccak384::hash_to_u32(scalar_value); + // let p: u32 = Keccak384::hash_to_u32(string_value); + let q: u32 = Keccak384::hash_to_u32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.leo new file mode 100644 index 0000000000..9905d6635a --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_u64 tests + let a: u64 = Keccak384::hash_to_u64(addr_value); + let b: u64 = Keccak384::hash_to_u64(bool_value); + let c: u64 = Keccak384::hash_to_u64(field_value); + let d: u64 = Keccak384::hash_to_u64(group_value); + let e: u64 = Keccak384::hash_to_u64(i8_value); + let f: u64 = Keccak384::hash_to_u64(i16_value); + let g: u64 = Keccak384::hash_to_u64(i32_value); + let h: u64 = Keccak384::hash_to_u64(i64_value); + let i: u64 = Keccak384::hash_to_u64(i128_value); + let j: u64 = Keccak384::hash_to_u64(u8_value); + let k: u64 = Keccak384::hash_to_u64(u16_value); + let l: u64 = Keccak384::hash_to_u64(u32_value); + let m: u64 = Keccak384::hash_to_u64(u64_value); + let n: u64 = Keccak384::hash_to_u64(u128_value); + let o: u64 = Keccak384::hash_to_u64(scalar_value); + // let p: u64 = Keccak384::hash_to_u64(string_value); + let q: u64 = Keccak384::hash_to_u64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.leo b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.leo new file mode 100644 index 0000000000..683457f723 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak384/keccak384_hash_to_u8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_u8 tests + let a: u8 = Keccak384::hash_to_u8(addr_value); + let b: u8 = Keccak384::hash_to_u8(bool_value); + let c: u8 = Keccak384::hash_to_u8(field_value); + let d: u8 = Keccak384::hash_to_u8(group_value); + let e: u8 = Keccak384::hash_to_u8(i8_value); + let f: u8 = Keccak384::hash_to_u8(i16_value); + let g: u8 = Keccak384::hash_to_u8(i32_value); + let h: u8 = Keccak384::hash_to_u8(i64_value); + let i: u8 = Keccak384::hash_to_u8(i128_value); + let j: u8 = Keccak384::hash_to_u8(u8_value); + let k: u8 = Keccak384::hash_to_u8(u16_value); + let l: u8 = Keccak384::hash_to_u8(u32_value); + let m: u8 = Keccak384::hash_to_u8(u64_value); + let n: u8 = Keccak384::hash_to_u8(u128_value); + let o: u8 = Keccak384::hash_to_u8(scalar_value); + // let p: u8 = Keccak384::hash_to_u8(string_value); + let q: u8 = Keccak384::hash_to_u8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.leo new file mode 100644 index 0000000000..9f95cfdb08 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_i128 tests + let a: i128 = Keccak512::hash_to_i128(addr_value); + let b: i128 = Keccak512::hash_to_i128(bool_value); + let c: i128 = Keccak512::hash_to_i128(field_value); + let d: i128 = Keccak512::hash_to_i128(group_value); + let e: i128 = Keccak512::hash_to_i128(i8_value); + let f: i128 = Keccak512::hash_to_i128(i16_value); + let g: i128 = Keccak512::hash_to_i128(i32_value); + let h: i128 = Keccak512::hash_to_i128(i64_value); + let i: i128 = Keccak512::hash_to_i128(i128_value); + let j: i128 = Keccak512::hash_to_i128(u8_value); + let k: i128 = Keccak512::hash_to_i128(u16_value); + let l: i128 = Keccak512::hash_to_i128(u32_value); + let m: i128 = Keccak512::hash_to_i128(u64_value); + let n: i128 = Keccak512::hash_to_i128(u128_value); + let o: i128 = Keccak512::hash_to_i128(scalar_value); + // let p: i128 = Keccak512::hash_to_i128(string_value); + let q: i128 = Keccak512::hash_to_i128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.leo new file mode 100644 index 0000000000..91764a9b9c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_i16 tests + let a: i16 = Keccak512::hash_to_i16(addr_value); + let b: i16 = Keccak512::hash_to_i16(bool_value); + let c: i16 = Keccak512::hash_to_i16(field_value); + let d: i16 = Keccak512::hash_to_i16(group_value); + let e: i16 = Keccak512::hash_to_i16(i8_value); + let f: i16 = Keccak512::hash_to_i16(i16_value); + let g: i16 = Keccak512::hash_to_i16(i32_value); + let h: i16 = Keccak512::hash_to_i16(i64_value); + let i: i16 = Keccak512::hash_to_i16(i128_value); + let j: i16 = Keccak512::hash_to_i16(u8_value); + let k: i16 = Keccak512::hash_to_i16(u16_value); + let l: i16 = Keccak512::hash_to_i16(u32_value); + let m: i16 = Keccak512::hash_to_i16(u64_value); + let n: i16 = Keccak512::hash_to_i16(u128_value); + let o: i16 = Keccak512::hash_to_i16(scalar_value); + // let p: i16 = Keccak512::hash_to_i16(string_value); + let q: i16 = Keccak512::hash_to_i16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.leo new file mode 100644 index 0000000000..b54b9b6b84 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_i32 tests + let a: i32 = Keccak512::hash_to_i32(addr_value); + let b: i32 = Keccak512::hash_to_i32(bool_value); + let c: i32 = Keccak512::hash_to_i32(field_value); + let d: i32 = Keccak512::hash_to_i32(group_value); + let e: i32 = Keccak512::hash_to_i32(i8_value); + let f: i32 = Keccak512::hash_to_i32(i16_value); + let g: i32 = Keccak512::hash_to_i32(i32_value); + let h: i32 = Keccak512::hash_to_i32(i64_value); + let i: i32 = Keccak512::hash_to_i32(i128_value); + let j: i32 = Keccak512::hash_to_i32(u8_value); + let k: i32 = Keccak512::hash_to_i32(u16_value); + let l: i32 = Keccak512::hash_to_i32(u32_value); + let m: i32 = Keccak512::hash_to_i32(u64_value); + let n: i32 = Keccak512::hash_to_i32(u128_value); + let o: i32 = Keccak512::hash_to_i32(scalar_value); + // let p: i32 = Keccak512::hash_to_i32(string_value); + let q: i32 = Keccak512::hash_to_i32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.leo new file mode 100644 index 0000000000..f8e8ee73a8 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_i64 tests + let a: i64 = Keccak512::hash_to_i64(addr_value); + let b: i64 = Keccak512::hash_to_i64(bool_value); + let c: i64 = Keccak512::hash_to_i64(field_value); + let d: i64 = Keccak512::hash_to_i64(group_value); + let e: i64 = Keccak512::hash_to_i64(i8_value); + let f: i64 = Keccak512::hash_to_i64(i16_value); + let g: i64 = Keccak512::hash_to_i64(i32_value); + let h: i64 = Keccak512::hash_to_i64(i64_value); + let i: i64 = Keccak512::hash_to_i64(i128_value); + let j: i64 = Keccak512::hash_to_i64(u8_value); + let k: i64 = Keccak512::hash_to_i64(u16_value); + let l: i64 = Keccak512::hash_to_i64(u32_value); + let m: i64 = Keccak512::hash_to_i64(u64_value); + let n: i64 = Keccak512::hash_to_i64(u128_value); + let o: i64 = Keccak512::hash_to_i64(scalar_value); + // let p: i64 = Keccak512::hash_to_i64(string_value); + let q: i64 = Keccak512::hash_to_i64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.leo new file mode 100644 index 0000000000..a7ae5b82fd --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_i8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_i8 tests + let a: i8 = Keccak512::hash_to_i8(addr_value); + let b: i8 = Keccak512::hash_to_i8(bool_value); + let c: i8 = Keccak512::hash_to_i8(field_value); + let d: i8 = Keccak512::hash_to_i8(group_value); + let e: i8 = Keccak512::hash_to_i8(i8_value); + let f: i8 = Keccak512::hash_to_i8(i16_value); + let g: i8 = Keccak512::hash_to_i8(i32_value); + let h: i8 = Keccak512::hash_to_i8(i64_value); + let i: i8 = Keccak512::hash_to_i8(i128_value); + let j: i8 = Keccak512::hash_to_i8(u8_value); + let k: i8 = Keccak512::hash_to_i8(u16_value); + let l: i8 = Keccak512::hash_to_i8(u32_value); + let m: i8 = Keccak512::hash_to_i8(u64_value); + let n: i8 = Keccak512::hash_to_i8(u128_value); + let o: i8 = Keccak512::hash_to_i8(scalar_value); + // let p: i8 = Keccak512::hash_to_i8(string_value); + let q: i8 = Keccak512::hash_to_i8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.leo new file mode 100644 index 0000000000..12c666f9dc --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_u128 tests + let a: u128 = Keccak512::hash_to_u128(addr_value); + let b: u128 = Keccak512::hash_to_u128(bool_value); + let c: u128 = Keccak512::hash_to_u128(field_value); + let d: u128 = Keccak512::hash_to_u128(group_value); + let e: u128 = Keccak512::hash_to_u128(i8_value); + let f: u128 = Keccak512::hash_to_u128(i16_value); + let g: u128 = Keccak512::hash_to_u128(i32_value); + let h: u128 = Keccak512::hash_to_u128(i64_value); + let i: u128 = Keccak512::hash_to_u128(i128_value); + let j: u128 = Keccak512::hash_to_u128(u8_value); + let k: u128 = Keccak512::hash_to_u128(u16_value); + let l: u128 = Keccak512::hash_to_u128(u32_value); + let m: u128 = Keccak512::hash_to_u128(u64_value); + let n: u128 = Keccak512::hash_to_u128(u128_value); + let o: u128 = Keccak512::hash_to_u128(scalar_value); + // let p: u128 = Keccak512::hash_to_u128(string_value); + let q: u128 = Keccak512::hash_to_u128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.leo new file mode 100644 index 0000000000..90806acf00 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_u16 tests + let a: u16 = Keccak512::hash_to_u16(addr_value); + let b: u16 = Keccak512::hash_to_u16(bool_value); + let c: u16 = Keccak512::hash_to_u16(field_value); + let d: u16 = Keccak512::hash_to_u16(group_value); + let e: u16 = Keccak512::hash_to_u16(i8_value); + let f: u16 = Keccak512::hash_to_u16(i16_value); + let g: u16 = Keccak512::hash_to_u16(i32_value); + let h: u16 = Keccak512::hash_to_u16(i64_value); + let i: u16 = Keccak512::hash_to_u16(i128_value); + let j: u16 = Keccak512::hash_to_u16(u8_value); + let k: u16 = Keccak512::hash_to_u16(u16_value); + let l: u16 = Keccak512::hash_to_u16(u32_value); + let m: u16 = Keccak512::hash_to_u16(u64_value); + let n: u16 = Keccak512::hash_to_u16(u128_value); + let o: u16 = Keccak512::hash_to_u16(scalar_value); + // let p: u16 = Keccak512::hash_to_u16(string_value); + let q: u16 = Keccak512::hash_to_u16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.leo new file mode 100644 index 0000000000..bd82ce5adf --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_u32 tests + let a: u32 = Keccak512::hash_to_u32(addr_value); + let b: u32 = Keccak512::hash_to_u32(bool_value); + let c: u32 = Keccak512::hash_to_u32(field_value); + let d: u32 = Keccak512::hash_to_u32(group_value); + let e: u32 = Keccak512::hash_to_u32(i8_value); + let f: u32 = Keccak512::hash_to_u32(i16_value); + let g: u32 = Keccak512::hash_to_u32(i32_value); + let h: u32 = Keccak512::hash_to_u32(i64_value); + let i: u32 = Keccak512::hash_to_u32(i128_value); + let j: u32 = Keccak512::hash_to_u32(u8_value); + let k: u32 = Keccak512::hash_to_u32(u16_value); + let l: u32 = Keccak512::hash_to_u32(u32_value); + let m: u32 = Keccak512::hash_to_u32(u64_value); + let n: u32 = Keccak512::hash_to_u32(u128_value); + let o: u32 = Keccak512::hash_to_u32(scalar_value); + // let p: u32 = Keccak512::hash_to_u32(string_value); + let q: u32 = Keccak512::hash_to_u32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.leo new file mode 100644 index 0000000000..e5674d859d --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_u64 tests + let a: u64 = Keccak512::hash_to_u64(addr_value); + let b: u64 = Keccak512::hash_to_u64(bool_value); + let c: u64 = Keccak512::hash_to_u64(field_value); + let d: u64 = Keccak512::hash_to_u64(group_value); + let e: u64 = Keccak512::hash_to_u64(i8_value); + let f: u64 = Keccak512::hash_to_u64(i16_value); + let g: u64 = Keccak512::hash_to_u64(i32_value); + let h: u64 = Keccak512::hash_to_u64(i64_value); + let i: u64 = Keccak512::hash_to_u64(i128_value); + let j: u64 = Keccak512::hash_to_u64(u8_value); + let k: u64 = Keccak512::hash_to_u64(u16_value); + let l: u64 = Keccak512::hash_to_u64(u32_value); + let m: u64 = Keccak512::hash_to_u64(u64_value); + let n: u64 = Keccak512::hash_to_u64(u128_value); + let o: u64 = Keccak512::hash_to_u64(scalar_value); + // let p: u64 = Keccak512::hash_to_u64(string_value); + let q: u64 = Keccak512::hash_to_u64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.leo b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.leo new file mode 100644 index 0000000000..6c6d5a67e8 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/keccak512/keccak512_hash_to_u8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_u8 tests + let a: u8 = Keccak512::hash_to_u8(addr_value); + let b: u8 = Keccak512::hash_to_u8(bool_value); + let c: u8 = Keccak512::hash_to_u8(field_value); + let d: u8 = Keccak512::hash_to_u8(group_value); + let e: u8 = Keccak512::hash_to_u8(i8_value); + let f: u8 = Keccak512::hash_to_u8(i16_value); + let g: u8 = Keccak512::hash_to_u8(i32_value); + let h: u8 = Keccak512::hash_to_u8(i64_value); + let i: u8 = Keccak512::hash_to_u8(i128_value); + let j: u8 = Keccak512::hash_to_u8(u8_value); + let k: u8 = Keccak512::hash_to_u8(u16_value); + let l: u8 = Keccak512::hash_to_u8(u32_value); + let m: u8 = Keccak512::hash_to_u8(u64_value); + let n: u8 = Keccak512::hash_to_u8(u128_value); + let o: u8 = Keccak512::hash_to_u8(scalar_value); + // let p: u8 = Keccak512::hash_to_u8(string_value); + let q: u8 = Keccak512::hash_to_u8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/keccak256_hash_to_address.leo b/tests/tests/compiler/core/algorithms/keccak256_hash_to_address.leo new file mode 100644 index 0000000000..b22301c568 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak256_hash_to_address.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_address tests + let a: address = Keccak256::hash_to_address(addr_value); + let b: address = Keccak256::hash_to_address(bool_value); + let c: address = Keccak256::hash_to_address(field_value); + let d: address = Keccak256::hash_to_address(group_value); + let e: address = Keccak256::hash_to_address(i8_value); + let f: address = Keccak256::hash_to_address(i16_value); + let g: address = Keccak256::hash_to_address(i32_value); + let h: address = Keccak256::hash_to_address(i64_value); + let i: address = Keccak256::hash_to_address(i128_value); + let j: address = Keccak256::hash_to_address(u8_value); + let k: address = Keccak256::hash_to_address(u16_value); + let l: address = Keccak256::hash_to_address(u32_value); + let m: address = Keccak256::hash_to_address(u64_value); + let n: address = Keccak256::hash_to_address(u128_value); + let o: address = Keccak256::hash_to_address(scalar_value); + // let p: address = Keccak256::hash_to_address(string_value); + let q: address = Keccak256::hash_to_address(Foo { a: 1u128, b: 1u128 }); + + return field_value; + } +} diff --git a/tests/tests/compiler/core/algorithms/keccak256_hash_to_field.leo b/tests/tests/compiler/core/algorithms/keccak256_hash_to_field.leo new file mode 100644 index 0000000000..9c65823c3c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak256_hash_to_field.leo @@ -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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_field tests + let a: field = Keccak256::hash_to_field(addr_value); + let b: field = Keccak256::hash_to_field(bool_value); + let c: field = Keccak256::hash_to_field(field_value); + let d: field = Keccak256::hash_to_field(group_value); + let e: field = Keccak256::hash_to_field(i8_value); + let f: field = Keccak256::hash_to_field(i16_value); + let g: field = Keccak256::hash_to_field(i32_value); + let h: field = Keccak256::hash_to_field(i64_value); + let i: field = Keccak256::hash_to_field(i128_value); + let j: field = Keccak256::hash_to_field(u8_value); + let k: field = Keccak256::hash_to_field(u16_value); + let l: field = Keccak256::hash_to_field(u32_value); + let m: field = Keccak256::hash_to_field(u64_value); + let n: field = Keccak256::hash_to_field(u128_value); + let o: field = Keccak256::hash_to_field(scalar_value); + // let p: field = Keccak256::hash_to_field(string_value); + let q: field = Keccak256::hash_to_field(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak256_hash_to_group.leo b/tests/tests/compiler/core/algorithms/keccak256_hash_to_group.leo new file mode 100644 index 0000000000..870fff846d --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak256_hash_to_group.leo @@ -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 = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_group tests + let a: group = Keccak256::hash_to_group(addr_value); + let b: group = Keccak256::hash_to_group(bool_value); + let c: group = Keccak256::hash_to_group(field_value); + let d: group = Keccak256::hash_to_group(group_value); + let e: group = Keccak256::hash_to_group(i8_value); + let f: group = Keccak256::hash_to_group(i16_value); + let g: group = Keccak256::hash_to_group(i32_value); + let h: group = Keccak256::hash_to_group(i64_value); + let i: group = Keccak256::hash_to_group(i128_value); + let j: group = Keccak256::hash_to_group(u8_value); + let k: group = Keccak256::hash_to_group(u16_value); + let l: group = Keccak256::hash_to_group(u32_value); + let m: group = Keccak256::hash_to_group(u64_value); + let n: group = Keccak256::hash_to_group(u128_value); + let o: group = Keccak256::hash_to_group(scalar_value); + // let p: group = Keccak256::hash_to_group(string_value); + let q: group = Keccak256::hash_to_group(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak256_hash_to_scalar.leo b/tests/tests/compiler/core/algorithms/keccak256_hash_to_scalar.leo new file mode 100644 index 0000000000..e2cd515362 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak256_hash_to_scalar.leo @@ -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, + ) -> scalar { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak256 hash_to_scalar tests + let a: scalar = Keccak256::hash_to_scalar(addr_value); + let b: scalar = Keccak256::hash_to_scalar(bool_value); + let c: scalar = Keccak256::hash_to_scalar(field_value); + let d: scalar = Keccak256::hash_to_scalar(group_value); + let e: scalar = Keccak256::hash_to_scalar(i8_value); + let f: scalar = Keccak256::hash_to_scalar(i16_value); + let g: scalar = Keccak256::hash_to_scalar(i32_value); + let h: scalar = Keccak256::hash_to_scalar(i64_value); + let i: scalar = Keccak256::hash_to_scalar(i128_value); + let j: scalar = Keccak256::hash_to_scalar(u8_value); + let k: scalar = Keccak256::hash_to_scalar(u16_value); + let l: scalar = Keccak256::hash_to_scalar(u32_value); + let m: scalar = Keccak256::hash_to_scalar(u64_value); + let n: scalar = Keccak256::hash_to_scalar(u128_value); + let o: scalar = Keccak256::hash_to_scalar(scalar_value); + // let p: scalar = Keccak256::hash_to_scalar(string_value); + let q: scalar = Keccak256::hash_to_scalar(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak384_hash_to_address.leo b/tests/tests/compiler/core/algorithms/keccak384_hash_to_address.leo new file mode 100644 index 0000000000..0edcadb9d4 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak384_hash_to_address.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_address tests + let a: address = Keccak384::hash_to_address(addr_value); + let b: address = Keccak384::hash_to_address(bool_value); + let c: address = Keccak384::hash_to_address(field_value); + let d: address = Keccak384::hash_to_address(group_value); + let e: address = Keccak384::hash_to_address(i8_value); + let f: address = Keccak384::hash_to_address(i16_value); + let g: address = Keccak384::hash_to_address(i32_value); + let h: address = Keccak384::hash_to_address(i64_value); + let i: address = Keccak384::hash_to_address(i128_value); + let j: address = Keccak384::hash_to_address(u8_value); + let k: address = Keccak384::hash_to_address(u16_value); + let l: address = Keccak384::hash_to_address(u32_value); + let m: address = Keccak384::hash_to_address(u64_value); + let n: address = Keccak384::hash_to_address(u128_value); + let o: address = Keccak384::hash_to_address(scalar_value); + // let p: address = Keccak384::hash_to_address(string_value); + let q: address = Keccak384::hash_to_address(Foo { a: 1u128, b: 1u128 }); + + return field_value; + } +} diff --git a/tests/tests/compiler/core/algorithms/keccak384_hash_to_field.leo b/tests/tests/compiler/core/algorithms/keccak384_hash_to_field.leo new file mode 100644 index 0000000000..d4825e23f4 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak384_hash_to_field.leo @@ -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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_field tests + let a: field = Keccak384::hash_to_field(addr_value); + let b: field = Keccak384::hash_to_field(bool_value); + let c: field = Keccak384::hash_to_field(field_value); + let d: field = Keccak384::hash_to_field(group_value); + let e: field = Keccak384::hash_to_field(i8_value); + let f: field = Keccak384::hash_to_field(i16_value); + let g: field = Keccak384::hash_to_field(i32_value); + let h: field = Keccak384::hash_to_field(i64_value); + let i: field = Keccak384::hash_to_field(i128_value); + let j: field = Keccak384::hash_to_field(u8_value); + let k: field = Keccak384::hash_to_field(u16_value); + let l: field = Keccak384::hash_to_field(u32_value); + let m: field = Keccak384::hash_to_field(u64_value); + let n: field = Keccak384::hash_to_field(u128_value); + let o: field = Keccak384::hash_to_field(scalar_value); + // let p: field = Keccak384::hash_to_field(string_value); + let q: field = Keccak384::hash_to_field(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak384_hash_to_group.leo b/tests/tests/compiler/core/algorithms/keccak384_hash_to_group.leo new file mode 100644 index 0000000000..8890a28252 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak384_hash_to_group.leo @@ -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 = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_group tests + let a: group = Keccak384::hash_to_group(addr_value); + let b: group = Keccak384::hash_to_group(bool_value); + let c: group = Keccak384::hash_to_group(field_value); + let d: group = Keccak384::hash_to_group(group_value); + let e: group = Keccak384::hash_to_group(i8_value); + let f: group = Keccak384::hash_to_group(i16_value); + let g: group = Keccak384::hash_to_group(i32_value); + let h: group = Keccak384::hash_to_group(i64_value); + let i: group = Keccak384::hash_to_group(i128_value); + let j: group = Keccak384::hash_to_group(u8_value); + let k: group = Keccak384::hash_to_group(u16_value); + let l: group = Keccak384::hash_to_group(u32_value); + let m: group = Keccak384::hash_to_group(u64_value); + let n: group = Keccak384::hash_to_group(u128_value); + let o: group = Keccak384::hash_to_group(scalar_value); + // let p: group = Keccak384::hash_to_group(string_value); + let q: group = Keccak384::hash_to_group(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak384_hash_to_scalar.leo b/tests/tests/compiler/core/algorithms/keccak384_hash_to_scalar.leo new file mode 100644 index 0000000000..2b487962c6 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak384_hash_to_scalar.leo @@ -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, + ) -> scalar { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak384 hash_to_scalar tests + let a: scalar = Keccak384::hash_to_scalar(addr_value); + let b: scalar = Keccak384::hash_to_scalar(bool_value); + let c: scalar = Keccak384::hash_to_scalar(field_value); + let d: scalar = Keccak384::hash_to_scalar(group_value); + let e: scalar = Keccak384::hash_to_scalar(i8_value); + let f: scalar = Keccak384::hash_to_scalar(i16_value); + let g: scalar = Keccak384::hash_to_scalar(i32_value); + let h: scalar = Keccak384::hash_to_scalar(i64_value); + let i: scalar = Keccak384::hash_to_scalar(i128_value); + let j: scalar = Keccak384::hash_to_scalar(u8_value); + let k: scalar = Keccak384::hash_to_scalar(u16_value); + let l: scalar = Keccak384::hash_to_scalar(u32_value); + let m: scalar = Keccak384::hash_to_scalar(u64_value); + let n: scalar = Keccak384::hash_to_scalar(u128_value); + let o: scalar = Keccak384::hash_to_scalar(scalar_value); + // let p: scalar = Keccak384::hash_to_scalar(string_value); + let q: scalar = Keccak384::hash_to_scalar(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak512_hash_to_address.leo b/tests/tests/compiler/core/algorithms/keccak512_hash_to_address.leo new file mode 100644 index 0000000000..919c690d04 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak512_hash_to_address.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_address tests + let a: address = Keccak512::hash_to_address(addr_value); + let b: address = Keccak512::hash_to_address(bool_value); + let c: address = Keccak512::hash_to_address(field_value); + let d: address = Keccak512::hash_to_address(group_value); + let e: address = Keccak512::hash_to_address(i8_value); + let f: address = Keccak512::hash_to_address(i16_value); + let g: address = Keccak512::hash_to_address(i32_value); + let h: address = Keccak512::hash_to_address(i64_value); + let i: address = Keccak512::hash_to_address(i128_value); + let j: address = Keccak512::hash_to_address(u8_value); + let k: address = Keccak512::hash_to_address(u16_value); + let l: address = Keccak512::hash_to_address(u32_value); + let m: address = Keccak512::hash_to_address(u64_value); + let n: address = Keccak512::hash_to_address(u128_value); + let o: address = Keccak512::hash_to_address(scalar_value); + // let p: address = Keccak512::hash_to_address(string_value); + let q: address = Keccak512::hash_to_address(Foo { a: 1u128, b: 1u128 }); + + return field_value; + } +} diff --git a/tests/tests/compiler/core/algorithms/keccak512_hash_to_field.leo b/tests/tests/compiler/core/algorithms/keccak512_hash_to_field.leo new file mode 100644 index 0000000000..3fa7c16525 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak512_hash_to_field.leo @@ -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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_field tests + let a: field = Keccak512::hash_to_field(addr_value); + let b: field = Keccak512::hash_to_field(bool_value); + let c: field = Keccak512::hash_to_field(field_value); + let d: field = Keccak512::hash_to_field(group_value); + let e: field = Keccak512::hash_to_field(i8_value); + let f: field = Keccak512::hash_to_field(i16_value); + let g: field = Keccak512::hash_to_field(i32_value); + let h: field = Keccak512::hash_to_field(i64_value); + let i: field = Keccak512::hash_to_field(i128_value); + let j: field = Keccak512::hash_to_field(u8_value); + let k: field = Keccak512::hash_to_field(u16_value); + let l: field = Keccak512::hash_to_field(u32_value); + let m: field = Keccak512::hash_to_field(u64_value); + let n: field = Keccak512::hash_to_field(u128_value); + let o: field = Keccak512::hash_to_field(scalar_value); + // let p: field = Keccak512::hash_to_field(string_value); + let q: field = Keccak512::hash_to_field(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak512_hash_to_group.leo b/tests/tests/compiler/core/algorithms/keccak512_hash_to_group.leo new file mode 100644 index 0000000000..7ed8ff5585 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak512_hash_to_group.leo @@ -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 = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_group tests + let a: group = Keccak512::hash_to_group(addr_value); + let b: group = Keccak512::hash_to_group(bool_value); + let c: group = Keccak512::hash_to_group(field_value); + let d: group = Keccak512::hash_to_group(group_value); + let e: group = Keccak512::hash_to_group(i8_value); + let f: group = Keccak512::hash_to_group(i16_value); + let g: group = Keccak512::hash_to_group(i32_value); + let h: group = Keccak512::hash_to_group(i64_value); + let i: group = Keccak512::hash_to_group(i128_value); + let j: group = Keccak512::hash_to_group(u8_value); + let k: group = Keccak512::hash_to_group(u16_value); + let l: group = Keccak512::hash_to_group(u32_value); + let m: group = Keccak512::hash_to_group(u64_value); + let n: group = Keccak512::hash_to_group(u128_value); + let o: group = Keccak512::hash_to_group(scalar_value); + // let p: group = Keccak512::hash_to_group(string_value); + let q: group = Keccak512::hash_to_group(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/keccak512_hash_to_scalar.leo b/tests/tests/compiler/core/algorithms/keccak512_hash_to_scalar.leo new file mode 100644 index 0000000000..4523f822e1 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/keccak512_hash_to_scalar.leo @@ -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, + ) -> scalar { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // Keccak512 hash_to_scalar tests + let a: scalar = Keccak512::hash_to_scalar(addr_value); + let b: scalar = Keccak512::hash_to_scalar(bool_value); + let c: scalar = Keccak512::hash_to_scalar(field_value); + let d: scalar = Keccak512::hash_to_scalar(group_value); + let e: scalar = Keccak512::hash_to_scalar(i8_value); + let f: scalar = Keccak512::hash_to_scalar(i16_value); + let g: scalar = Keccak512::hash_to_scalar(i32_value); + let h: scalar = Keccak512::hash_to_scalar(i64_value); + let i: scalar = Keccak512::hash_to_scalar(i128_value); + let j: scalar = Keccak512::hash_to_scalar(u8_value); + let k: scalar = Keccak512::hash_to_scalar(u16_value); + let l: scalar = Keccak512::hash_to_scalar(u32_value); + let m: scalar = Keccak512::hash_to_scalar(u64_value); + let n: scalar = Keccak512::hash_to_scalar(u128_value); + let o: scalar = Keccak512::hash_to_scalar(scalar_value); + // let p: scalar = Keccak512::hash_to_scalar(string_value); + let q: scalar = Keccak512::hash_to_scalar(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} From 9c20f42d1d7db880c71376e867a6c01aa0748823 Mon Sep 17 00:00:00 2001 From: Collin Chin <16715212+collinc97@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:54:14 -0700 Subject: [PATCH 7/7] Feat/sha3 (#2604) * implement Keccak256 Keccak384 Keccak512 with tests * implement SHA3_256 SHA3_384 SHA3_512 with tests --- compiler/ast/src/functions/core_function.rs | 177 ++++++++++++++++++ .../src/code_generation/visit_expressions.rs | 9 + compiler/passes/src/type_checking/checker.rs | 70 +++++-- compiler/span/src/symbol.rs | 3 + .../sha3_256/sha3_256_hash_to_i128.out | 15 ++ .../sha3_256/sha3_256_hash_to_i16.out | 15 ++ .../sha3_256/sha3_256_hash_to_i32.out | 15 ++ .../sha3_256/sha3_256_hash_to_i64.out | 15 ++ .../integers/sha3_256/sha3_256_hash_to_i8.out | 15 ++ .../sha3_256/sha3_256_hash_to_u128.out | 15 ++ .../sha3_256/sha3_256_hash_to_u16.out | 15 ++ .../sha3_256/sha3_256_hash_to_u32.out | 15 ++ .../sha3_256/sha3_256_hash_to_u64.out | 15 ++ .../integers/sha3_256/sha3_256_hash_to_u8.out | 15 ++ .../sha3_384/sha3_384_hash_to_i128.out | 15 ++ .../sha3_384/sha3_384_hash_to_i16.out | 15 ++ .../sha3_384/sha3_384_hash_to_i32.out | 15 ++ .../sha3_384/sha3_384_hash_to_i64.out | 15 ++ .../integers/sha3_384/sha3_384_hash_to_i8.out | 15 ++ .../sha3_384/sha3_384_hash_to_u128.out | 15 ++ .../sha3_384/sha3_384_hash_to_u16.out | 15 ++ .../sha3_384/sha3_384_hash_to_u32.out | 15 ++ .../sha3_384/sha3_384_hash_to_u64.out | 15 ++ .../integers/sha3_384/sha3_384_hash_to_u8.out | 15 ++ .../sha3_512/sha3_512_hash_to_i128.out | 15 ++ .../sha3_512/sha3_512_hash_to_i16.out | 15 ++ .../sha3_512/sha3_512_hash_to_i32.out | 15 ++ .../sha3_512/sha3_512_hash_to_i64.out | 15 ++ .../integers/sha3_512/sha3_512_hash_to_i8.out | 15 ++ .../sha3_512/sha3_512_hash_to_u128.out | 15 ++ .../sha3_512/sha3_512_hash_to_u16.out | 15 ++ .../sha3_512/sha3_512_hash_to_u32.out | 15 ++ .../sha3_512/sha3_512_hash_to_u64.out | 15 ++ .../integers/sha3_512/sha3_512_hash_to_u8.out | 15 ++ .../algorithms/sha3_256_hash_to_address.out | 15 ++ .../algorithms/sha3_256_hash_to_field.out | 15 ++ .../algorithms/sha3_256_hash_to_group.out | 15 ++ .../algorithms/sha3_256_hash_to_scalar.out | 15 ++ .../algorithms/sha3_384_hash_to_address.out | 15 ++ .../algorithms/sha3_384_hash_to_field.out | 15 ++ .../algorithms/sha3_384_hash_to_group.out | 15 ++ .../algorithms/sha3_384_hash_to_scalar.out | 15 ++ .../algorithms/sha3_512_hash_to_address.out | 15 ++ .../algorithms/sha3_512_hash_to_field.out | 15 ++ .../algorithms/sha3_512_hash_to_group.out | 15 ++ .../algorithms/sha3_512_hash_to_scalar.out | 15 ++ .../sha3_256/sha3_256_hash_to_i128.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_i16.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_i32.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_i64.leo | 52 +++++ .../integers/sha3_256/sha3_256_hash_to_i8.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_u128.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_u16.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_u32.leo | 52 +++++ .../sha3_256/sha3_256_hash_to_u64.leo | 52 +++++ .../integers/sha3_256/sha3_256_hash_to_u8.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_i128.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_i16.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_i32.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_i64.leo | 52 +++++ .../integers/sha3_384/sha3_384_hash_to_i8.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_u128.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_u16.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_u32.leo | 52 +++++ .../sha3_384/sha3_384_hash_to_u64.leo | 52 +++++ .../integers/sha3_384/sha3_384_hash_to_u8.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_i128.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_i16.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_i32.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_i64.leo | 52 +++++ .../integers/sha3_512/sha3_512_hash_to_i8.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_u128.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_u16.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_u32.leo | 52 +++++ .../sha3_512/sha3_512_hash_to_u64.leo | 52 +++++ .../integers/sha3_512/sha3_512_hash_to_u8.leo | 52 +++++ .../algorithms/sha3_256_hash_to_address.leo | 52 +++++ .../algorithms/sha3_256_hash_to_field.leo | 51 +++++ .../algorithms/sha3_256_hash_to_group.leo | 51 +++++ .../algorithms/sha3_256_hash_to_scalar.leo | 51 +++++ .../algorithms/sha3_384_hash_to_address.leo | 52 +++++ .../algorithms/sha3_384_hash_to_field.leo | 51 +++++ .../algorithms/sha3_384_hash_to_group.leo | 51 +++++ .../algorithms/sha3_384_hash_to_scalar.leo | 51 +++++ .../algorithms/sha3_512_hash_to_address.leo | 52 +++++ .../algorithms/sha3_512_hash_to_field.leo | 51 +++++ .../algorithms/sha3_512_hash_to_group.leo | 51 +++++ .../algorithms/sha3_512_hash_to_scalar.leo | 51 +++++ 88 files changed, 3050 insertions(+), 14 deletions(-) create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.out create mode 100644 tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_256_hash_to_address.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_256_hash_to_field.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_256_hash_to_group.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_256_hash_to_scalar.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_384_hash_to_address.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_384_hash_to_field.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_384_hash_to_group.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_384_hash_to_scalar.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_512_hash_to_address.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_512_hash_to_field.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_512_hash_to_group.out create mode 100644 tests/expectations/compiler/core/algorithms/sha3_512_hash_to_scalar.out create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.leo create mode 100644 tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_256_hash_to_address.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_256_hash_to_field.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_256_hash_to_group.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_256_hash_to_scalar.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_384_hash_to_address.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_384_hash_to_field.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_384_hash_to_group.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_384_hash_to_scalar.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_512_hash_to_address.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_512_hash_to_field.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_512_hash_to_group.leo create mode 100644 tests/tests/compiler/core/algorithms/sha3_512_hash_to_scalar.leo diff --git a/compiler/ast/src/functions/core_function.rs b/compiler/ast/src/functions/core_function.rs index b3e2c59414..21bc740014 100644 --- a/compiler/ast/src/functions/core_function.rs +++ b/compiler/ast/src/functions/core_function.rs @@ -233,6 +233,51 @@ pub enum CoreFunction { Poseidon8HashToU128, Poseidon8HashToScalar, + SHA3_256HashToAddress, + SHA3_256HashToField, + SHA3_256HashToGroup, + SHA3_256HashToI8, + SHA3_256HashToI16, + SHA3_256HashToI32, + SHA3_256HashToI64, + SHA3_256HashToI128, + SHA3_256HashToU8, + SHA3_256HashToU16, + SHA3_256HashToU32, + SHA3_256HashToU64, + SHA3_256HashToU128, + SHA3_256HashToScalar, + + SHA3_384HashToAddress, + SHA3_384HashToField, + SHA3_384HashToGroup, + SHA3_384HashToI8, + SHA3_384HashToI16, + SHA3_384HashToI32, + SHA3_384HashToI64, + SHA3_384HashToI128, + SHA3_384HashToU8, + SHA3_384HashToU16, + SHA3_384HashToU32, + SHA3_384HashToU64, + SHA3_384HashToU128, + SHA3_384HashToScalar, + + SHA3_512HashToAddress, + SHA3_512HashToField, + SHA3_512HashToGroup, + SHA3_512HashToI8, + SHA3_512HashToI16, + SHA3_512HashToI32, + SHA3_512HashToI64, + SHA3_512HashToI128, + SHA3_512HashToU8, + SHA3_512HashToU16, + SHA3_512HashToU32, + SHA3_512HashToU64, + SHA3_512HashToU128, + SHA3_512HashToScalar, + MappingGet, MappingGetOrUse, MappingSet, @@ -464,6 +509,51 @@ impl CoreFunction { (sym::Poseidon8, sym::hash_to_u128) => Self::Poseidon8HashToU128, (sym::Poseidon8, sym::hash_to_scalar) => Self::Poseidon8HashToScalar, + (sym::SHA3_256, sym::hash_to_address) => Self::SHA3_256HashToAddress, + (sym::SHA3_256, sym::hash_to_field) => Self::SHA3_256HashToField, + (sym::SHA3_256, sym::hash_to_group) => Self::SHA3_256HashToGroup, + (sym::SHA3_256, sym::hash_to_i8) => Self::SHA3_256HashToI8, + (sym::SHA3_256, sym::hash_to_i16) => Self::SHA3_256HashToI16, + (sym::SHA3_256, sym::hash_to_i32) => Self::SHA3_256HashToI32, + (sym::SHA3_256, sym::hash_to_i64) => Self::SHA3_256HashToI64, + (sym::SHA3_256, sym::hash_to_i128) => Self::SHA3_256HashToI128, + (sym::SHA3_256, sym::hash_to_u8) => Self::SHA3_256HashToU8, + (sym::SHA3_256, sym::hash_to_u16) => Self::SHA3_256HashToU16, + (sym::SHA3_256, sym::hash_to_u32) => Self::SHA3_256HashToU32, + (sym::SHA3_256, sym::hash_to_u64) => Self::SHA3_256HashToU64, + (sym::SHA3_256, sym::hash_to_u128) => Self::SHA3_256HashToU128, + (sym::SHA3_256, sym::hash_to_scalar) => Self::SHA3_256HashToScalar, + + (sym::SHA3_384, sym::hash_to_address) => Self::SHA3_384HashToAddress, + (sym::SHA3_384, sym::hash_to_field) => Self::SHA3_384HashToField, + (sym::SHA3_384, sym::hash_to_group) => Self::SHA3_384HashToGroup, + (sym::SHA3_384, sym::hash_to_i8) => Self::SHA3_384HashToI8, + (sym::SHA3_384, sym::hash_to_i16) => Self::SHA3_384HashToI16, + (sym::SHA3_384, sym::hash_to_i32) => Self::SHA3_384HashToI32, + (sym::SHA3_384, sym::hash_to_i64) => Self::SHA3_384HashToI64, + (sym::SHA3_384, sym::hash_to_i128) => Self::SHA3_384HashToI128, + (sym::SHA3_384, sym::hash_to_u8) => Self::SHA3_384HashToU8, + (sym::SHA3_384, sym::hash_to_u16) => Self::SHA3_384HashToU16, + (sym::SHA3_384, sym::hash_to_u32) => Self::SHA3_384HashToU32, + (sym::SHA3_384, sym::hash_to_u64) => Self::SHA3_384HashToU64, + (sym::SHA3_384, sym::hash_to_u128) => Self::SHA3_384HashToU128, + (sym::SHA3_384, sym::hash_to_scalar) => Self::SHA3_384HashToScalar, + + (sym::SHA3_512, sym::hash_to_address) => Self::SHA3_512HashToAddress, + (sym::SHA3_512, sym::hash_to_field) => Self::SHA3_512HashToField, + (sym::SHA3_512, sym::hash_to_group) => Self::SHA3_512HashToGroup, + (sym::SHA3_512, sym::hash_to_i8) => Self::SHA3_512HashToI8, + (sym::SHA3_512, sym::hash_to_i16) => Self::SHA3_512HashToI16, + (sym::SHA3_512, sym::hash_to_i32) => Self::SHA3_512HashToI32, + (sym::SHA3_512, sym::hash_to_i64) => Self::SHA3_512HashToI64, + (sym::SHA3_512, sym::hash_to_i128) => Self::SHA3_512HashToI128, + (sym::SHA3_512, sym::hash_to_u8) => Self::SHA3_512HashToU8, + (sym::SHA3_512, sym::hash_to_u16) => Self::SHA3_512HashToU16, + (sym::SHA3_512, sym::hash_to_u32) => Self::SHA3_512HashToU32, + (sym::SHA3_512, sym::hash_to_u64) => Self::SHA3_512HashToU64, + (sym::SHA3_512, sym::hash_to_u128) => Self::SHA3_512HashToU128, + (sym::SHA3_512, sym::hash_to_scalar) => Self::SHA3_512HashToScalar, + (sym::Mapping, sym::get) => Self::MappingGet, (sym::Mapping, sym::get_or_use) => Self::MappingGetOrUse, (sym::Mapping, sym::set) => Self::MappingSet, @@ -696,6 +786,51 @@ impl CoreFunction { Self::Poseidon8HashToU128 => 1, Self::Poseidon8HashToScalar => 1, + Self::SHA3_256HashToAddress => 1, + Self::SHA3_256HashToField => 1, + Self::SHA3_256HashToGroup => 1, + Self::SHA3_256HashToI8 => 1, + Self::SHA3_256HashToI16 => 1, + Self::SHA3_256HashToI32 => 1, + Self::SHA3_256HashToI64 => 1, + Self::SHA3_256HashToI128 => 1, + Self::SHA3_256HashToU8 => 1, + Self::SHA3_256HashToU16 => 1, + Self::SHA3_256HashToU32 => 1, + Self::SHA3_256HashToU64 => 1, + Self::SHA3_256HashToU128 => 1, + Self::SHA3_256HashToScalar => 1, + + Self::SHA3_384HashToAddress => 1, + Self::SHA3_384HashToField => 1, + Self::SHA3_384HashToGroup => 1, + Self::SHA3_384HashToI8 => 1, + Self::SHA3_384HashToI16 => 1, + Self::SHA3_384HashToI32 => 1, + Self::SHA3_384HashToI64 => 1, + Self::SHA3_384HashToI128 => 1, + Self::SHA3_384HashToU8 => 1, + Self::SHA3_384HashToU16 => 1, + Self::SHA3_384HashToU32 => 1, + Self::SHA3_384HashToU64 => 1, + Self::SHA3_384HashToU128 => 1, + Self::SHA3_384HashToScalar => 1, + + Self::SHA3_512HashToAddress => 1, + Self::SHA3_512HashToField => 1, + Self::SHA3_512HashToGroup => 1, + Self::SHA3_512HashToI8 => 1, + Self::SHA3_512HashToI16 => 1, + Self::SHA3_512HashToI32 => 1, + Self::SHA3_512HashToI64 => 1, + Self::SHA3_512HashToI128 => 1, + Self::SHA3_512HashToU8 => 1, + Self::SHA3_512HashToU16 => 1, + Self::SHA3_512HashToU32 => 1, + Self::SHA3_512HashToU64 => 1, + Self::SHA3_512HashToU128 => 1, + Self::SHA3_512HashToScalar => 1, + Self::MappingGet => 2, Self::MappingGetOrUse => 3, Self::MappingSet => 3, @@ -918,6 +1053,48 @@ impl CoreFunction { | CoreFunction::Poseidon8HashToU64 | CoreFunction::Poseidon8HashToU128 | CoreFunction::Poseidon8HashToScalar + | CoreFunction::SHA3_256HashToAddress + | CoreFunction::SHA3_256HashToField + | CoreFunction::SHA3_256HashToGroup + | CoreFunction::SHA3_256HashToI8 + | CoreFunction::SHA3_256HashToI16 + | CoreFunction::SHA3_256HashToI32 + | CoreFunction::SHA3_256HashToI64 + | CoreFunction::SHA3_256HashToI128 + | CoreFunction::SHA3_256HashToU8 + | CoreFunction::SHA3_256HashToU16 + | CoreFunction::SHA3_256HashToU32 + | CoreFunction::SHA3_256HashToU64 + | CoreFunction::SHA3_256HashToU128 + | CoreFunction::SHA3_256HashToScalar + | CoreFunction::SHA3_384HashToAddress + | CoreFunction::SHA3_384HashToField + | CoreFunction::SHA3_384HashToGroup + | CoreFunction::SHA3_384HashToI8 + | CoreFunction::SHA3_384HashToI16 + | CoreFunction::SHA3_384HashToI32 + | CoreFunction::SHA3_384HashToI64 + | CoreFunction::SHA3_384HashToI128 + | CoreFunction::SHA3_384HashToU8 + | CoreFunction::SHA3_384HashToU16 + | CoreFunction::SHA3_384HashToU32 + | CoreFunction::SHA3_384HashToU64 + | CoreFunction::SHA3_384HashToU128 + | CoreFunction::SHA3_384HashToScalar + | CoreFunction::SHA3_512HashToAddress + | CoreFunction::SHA3_512HashToField + | CoreFunction::SHA3_512HashToGroup + | CoreFunction::SHA3_512HashToI8 + | CoreFunction::SHA3_512HashToI16 + | CoreFunction::SHA3_512HashToI32 + | CoreFunction::SHA3_512HashToI64 + | CoreFunction::SHA3_512HashToI128 + | CoreFunction::SHA3_512HashToU8 + | CoreFunction::SHA3_512HashToU16 + | CoreFunction::SHA3_512HashToU32 + | CoreFunction::SHA3_512HashToU64 + | CoreFunction::SHA3_512HashToU128 + | CoreFunction::SHA3_512HashToScalar | CoreFunction::GroupToXCoordinate | CoreFunction::GroupToYCoordinate | CoreFunction::SignatureVerify => false, diff --git a/compiler/passes/src/code_generation/visit_expressions.rs b/compiler/passes/src/code_generation/visit_expressions.rs index 7e56444b52..ab1d68784d 100644 --- a/compiler/passes/src/code_generation/visit_expressions.rs +++ b/compiler/passes/src/code_generation/visit_expressions.rs @@ -339,6 +339,15 @@ impl<'a> CodeGenerator<'a> { Type::Identifier(Identifier { name: sym::Poseidon8, .. }) => { construct_simple_function_call(&input.name, "psd8", arguments) } + Type::Identifier(Identifier { name: sym::SHA3_256, .. }) => { + construct_simple_function_call(&input.name, "sha3_256", arguments) + } + Type::Identifier(Identifier { name: sym::SHA3_384, .. }) => { + construct_simple_function_call(&input.name, "sha3_384", arguments) + } + Type::Identifier(Identifier { name: sym::SHA3_512, .. }) => { + construct_simple_function_call(&input.name, "sha3_512", arguments) + } Type::Identifier(Identifier { name: sym::Mapping, .. }) => match input.name.name { sym::get => { let mut instruction = " get".to_string(); diff --git a/compiler/passes/src/type_checking/checker.rs b/compiler/passes/src/type_checking/checker.rs index 8316a96b5b..f0c5c1364c 100644 --- a/compiler/passes/src/type_checking/checker.rs +++ b/compiler/passes/src/type_checking/checker.rs @@ -485,7 +485,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToAddress | CoreFunction::Poseidon2HashToAddress | CoreFunction::Poseidon4HashToAddress - | CoreFunction::Poseidon8HashToAddress => { + | CoreFunction::Poseidon8HashToAddress + | CoreFunction::SHA3_256HashToAddress + | CoreFunction::SHA3_384HashToAddress + | CoreFunction::SHA3_512HashToAddress => { // 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::Address) @@ -499,7 +502,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToField | CoreFunction::Poseidon2HashToField | CoreFunction::Poseidon4HashToField - | CoreFunction::Poseidon8HashToField => { + | CoreFunction::Poseidon8HashToField + | CoreFunction::SHA3_256HashToField + | CoreFunction::SHA3_384HashToField + | CoreFunction::SHA3_512HashToField => { // 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) @@ -513,7 +519,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToGroup | CoreFunction::Poseidon2HashToGroup | CoreFunction::Poseidon4HashToGroup - | CoreFunction::Poseidon8HashToGroup => { + | CoreFunction::Poseidon8HashToGroup + | CoreFunction::SHA3_256HashToGroup + | CoreFunction::SHA3_384HashToGroup + | CoreFunction::SHA3_512HashToGroup => { // 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) @@ -527,7 +536,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToI8 | CoreFunction::Poseidon2HashToI8 | CoreFunction::Poseidon4HashToI8 - | CoreFunction::Poseidon8HashToI8 => { + | CoreFunction::Poseidon8HashToI8 + | CoreFunction::SHA3_256HashToI8 + | CoreFunction::SHA3_384HashToI8 + | CoreFunction::SHA3_512HashToI8 => { // 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::Integer(IntegerType::I8)) @@ -541,7 +553,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToI16 | CoreFunction::Poseidon2HashToI16 | CoreFunction::Poseidon4HashToI16 - | CoreFunction::Poseidon8HashToI16 => { + | CoreFunction::Poseidon8HashToI16 + | CoreFunction::SHA3_256HashToI16 + | CoreFunction::SHA3_384HashToI16 + | CoreFunction::SHA3_512HashToI16 => { // 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::Integer(IntegerType::I16)) @@ -555,7 +570,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToI32 | CoreFunction::Poseidon2HashToI32 | CoreFunction::Poseidon4HashToI32 - | CoreFunction::Poseidon8HashToI32 => { + | CoreFunction::Poseidon8HashToI32 + | CoreFunction::SHA3_256HashToI32 + | CoreFunction::SHA3_384HashToI32 + | CoreFunction::SHA3_512HashToI32 => { // 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::Integer(IntegerType::I32)) @@ -569,7 +587,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToI64 | CoreFunction::Poseidon2HashToI64 | CoreFunction::Poseidon4HashToI64 - | CoreFunction::Poseidon8HashToI64 => { + | CoreFunction::Poseidon8HashToI64 + | CoreFunction::SHA3_256HashToI64 + | CoreFunction::SHA3_384HashToI64 + | CoreFunction::SHA3_512HashToI64 => { // 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::Integer(IntegerType::I64)) @@ -583,7 +604,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToI128 | CoreFunction::Poseidon2HashToI128 | CoreFunction::Poseidon4HashToI128 - | CoreFunction::Poseidon8HashToI128 => { + | CoreFunction::Poseidon8HashToI128 + | CoreFunction::SHA3_256HashToI128 + | CoreFunction::SHA3_384HashToI128 + | CoreFunction::SHA3_512HashToI128 => { // 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::Integer(IntegerType::I128)) @@ -597,7 +621,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToU8 | CoreFunction::Poseidon2HashToU8 | CoreFunction::Poseidon4HashToU8 - | CoreFunction::Poseidon8HashToU8 => { + | CoreFunction::Poseidon8HashToU8 + | CoreFunction::SHA3_256HashToU8 + | CoreFunction::SHA3_384HashToU8 + | CoreFunction::SHA3_512HashToU8 => { // 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::Integer(IntegerType::U8)) @@ -611,7 +638,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToU16 | CoreFunction::Poseidon2HashToU16 | CoreFunction::Poseidon4HashToU16 - | CoreFunction::Poseidon8HashToU16 => { + | CoreFunction::Poseidon8HashToU16 + | CoreFunction::SHA3_256HashToU16 + | CoreFunction::SHA3_384HashToU16 + | CoreFunction::SHA3_512HashToU16 => { // 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::Integer(IntegerType::U16)) @@ -625,7 +655,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToU32 | CoreFunction::Poseidon2HashToU32 | CoreFunction::Poseidon4HashToU32 - | CoreFunction::Poseidon8HashToU32 => { + | CoreFunction::Poseidon8HashToU32 + | CoreFunction::SHA3_256HashToU32 + | CoreFunction::SHA3_384HashToU32 + | CoreFunction::SHA3_512HashToU32 => { // 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::Integer(IntegerType::U32)) @@ -639,7 +672,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToU64 | CoreFunction::Poseidon2HashToU64 | CoreFunction::Poseidon4HashToU64 - | CoreFunction::Poseidon8HashToU64 => { + | CoreFunction::Poseidon8HashToU64 + | CoreFunction::SHA3_256HashToU64 + | CoreFunction::SHA3_384HashToU64 + | CoreFunction::SHA3_512HashToU64 => { // 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::Integer(IntegerType::U64)) @@ -653,7 +689,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToU128 | CoreFunction::Poseidon2HashToU128 | CoreFunction::Poseidon4HashToU128 - | CoreFunction::Poseidon8HashToU128 => { + | CoreFunction::Poseidon8HashToU128 + | CoreFunction::SHA3_256HashToU128 + | CoreFunction::SHA3_384HashToU128 + | CoreFunction::SHA3_512HashToU128 => { // 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::Integer(IntegerType::U128)) @@ -667,7 +706,10 @@ impl<'a> TypeChecker<'a> { | CoreFunction::Keccak512HashToScalar | CoreFunction::Poseidon2HashToScalar | CoreFunction::Poseidon4HashToScalar - | CoreFunction::Poseidon8HashToScalar => { + | CoreFunction::Poseidon8HashToScalar + | CoreFunction::SHA3_256HashToScalar + | CoreFunction::SHA3_384HashToScalar + | CoreFunction::SHA3_512HashToScalar => { // 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) diff --git a/compiler/span/src/symbol.rs b/compiler/span/src/symbol.rs index 7d65dd7a3d..48395330b7 100644 --- a/compiler/span/src/symbol.rs +++ b/compiler/span/src/symbol.rs @@ -196,6 +196,9 @@ symbols! { rand_u128, remove, set, + SHA3_256, + SHA3_384, + SHA3_512, to_x_coordinate, to_y_coordinate, verify, diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.out new file mode 100644 index 0000000000..cf0343b5a3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: d61b6c9a81578cd47a707319541ce1cea3ac5e20020f2a5b8c0b0363df72ceb4 + type_checked_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + unrolled_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + initial_ast: ffd2062499cea8e3285d1f55b03e15a425bb15dd79c07de78926837383c597d4 + unrolled_ast: ffd2062499cea8e3285d1f55b03e15a425bb15dd79c07de78926837383c597d4 + ssa_ast: 39fac0c17b0caa961e02a2ac85930a40473a16867e2b1dca03cdf546a2aa97e4 + flattened_ast: 9bb73b8544fe6a07230bd6efad041044749da9fc6b1e5501ee91b220c9073de5 + inlined_ast: 9bb73b8544fe6a07230bd6efad041044749da9fc6b1e5501ee91b220c9073de5 + dce_ast: 778dcd199da4e7e469d0bd86539d12663c4141f63a9a980c0dff0f38c242e866 + bytecode: 90719e9440e244c74e57dd63e47c928680066f5d4289d1f15e9c4a2c78e75e84 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.out new file mode 100644 index 0000000000..e0ced72b1c --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 077422b93c97f7cd8a28ff1ba7bbe58e07c4b7887304c46d35eb5ac6bf23c972 + type_checked_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + unrolled_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + initial_ast: 93268b9cc1210692dba0dd5c66ea44d260b73a48f11ef336e00eecb41af17961 + unrolled_ast: 93268b9cc1210692dba0dd5c66ea44d260b73a48f11ef336e00eecb41af17961 + ssa_ast: b7366eb368db041e7af4b1b42ef47823992251e2f755ecb30fbecb7942483ed6 + flattened_ast: 6e3c26500476fa092c9a8606eeca9eeecc09454ecb7e4d556c964e60916713ac + inlined_ast: 6e3c26500476fa092c9a8606eeca9eeecc09454ecb7e4d556c964e60916713ac + dce_ast: 8b309dc8b818aebaf6f15cbb01168424be22d87a6292ce471f95976a5664a742 + bytecode: 2bf257739832acc917b4b4f18f149a72e6a8394336740568bd06cb6141704762 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.out new file mode 100644 index 0000000000..a7c3544dba --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 0b9e361a60499d11d8de9a427cd689b0904e3660092b6ff95a1c07bf09964e11 + type_checked_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + unrolled_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + initial_ast: ae9589cbec7374c2c372989e84a137fe7bd4f4c67d530dae7863ea82242e8944 + unrolled_ast: ae9589cbec7374c2c372989e84a137fe7bd4f4c67d530dae7863ea82242e8944 + ssa_ast: 100476f2be6256f6e3df690958acc74d3c25737773c87942b82695644d05b4b5 + flattened_ast: 92762cc1a0b23bad01815ca3e90146b24cf51b25b3976dcdaca8a51221e717a2 + inlined_ast: 92762cc1a0b23bad01815ca3e90146b24cf51b25b3976dcdaca8a51221e717a2 + dce_ast: dfb41bc52394ca124666c199f18a9be9b01f2ba470db152822d3c251b1df9f5b + bytecode: 7420791e00dae08a4887c2fa36f481bcbfe5b3c8d5c8268ec753a904f3e51ae1 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.out new file mode 100644 index 0000000000..19e1b6f08a --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 85b2afdf445a99fc5beb1bb9b7c98ddce8f4936dbdb5173447e64bfc5c73e96d + type_checked_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + unrolled_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + initial_ast: 48af8b3091ed6d5c0b6475faba9fb39941e5d657f478e86f5f8cc252688fba5f + unrolled_ast: 48af8b3091ed6d5c0b6475faba9fb39941e5d657f478e86f5f8cc252688fba5f + ssa_ast: 0307b7fd9472cecd38a701827971acbc3a15913ba3f4c14ee9a62cf7eb49b9e2 + flattened_ast: 8452d9c5b56ed410fc16162091334f0eabcda0345ab7acfe9333e378d6bffa92 + inlined_ast: 8452d9c5b56ed410fc16162091334f0eabcda0345ab7acfe9333e378d6bffa92 + dce_ast: a4dd3bfa2f75e88ff998741a6c9b70dbe8562cf8cc9121d5e83bb3dca301c69b + bytecode: 6c433e307d008c270d0de4f6a677aa5069fcf55a7613d777379bbab14c24be61 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.out new file mode 100644 index 0000000000..2d830a897f --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: e57034c883f65a0bf8bf21c5948e8e470938929205661f4629331145f96f457a + type_checked_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + unrolled_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + initial_ast: fd91a4a9dfc01bda3fb3e5628909d7ed471a1c31f9e9332a446aa43514756c6c + unrolled_ast: fd91a4a9dfc01bda3fb3e5628909d7ed471a1c31f9e9332a446aa43514756c6c + ssa_ast: 64ffec45b5881a246b411f82923b0019816c65d957fa06ad531c57ca4bd82f7a + flattened_ast: c68f90539390a741a1bf506ca1f3741a56fcb89702fd168feea1cd551fc15c0b + inlined_ast: c68f90539390a741a1bf506ca1f3741a56fcb89702fd168feea1cd551fc15c0b + dce_ast: f004960c4e63658e56062883f5b4edf0e45ee70639d973b3d391368ea7a0c1bb + bytecode: 2d9a914eb6d3310ce7e2a0f8d7f3ea4e34fad2533c9e2c7b7bfcc9da17ee1313 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.out new file mode 100644 index 0000000000..c268cbd495 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 30b74ef9405be6a65d0718e893155dfab9c5a27ba6331b46674fbfe804c078c7 + type_checked_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + unrolled_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + initial_ast: 6c4e65d2d0ef9109e4da1e478100c8bc910e71db1f8d43e359e914f02c8eb4b8 + unrolled_ast: 6c4e65d2d0ef9109e4da1e478100c8bc910e71db1f8d43e359e914f02c8eb4b8 + ssa_ast: 95b38ead08112d7e2f6c585649bb6a71a4556943aa1ea9ed6850053aa465c96a + flattened_ast: 7d63858d5b3b8325fee54663588f8a66e3177752bf5cf77bddb5ef4141fab0d4 + inlined_ast: 7d63858d5b3b8325fee54663588f8a66e3177752bf5cf77bddb5ef4141fab0d4 + dce_ast: f30e7b4168e14c64322838e64736333dd0c68912fe1dbc62ca37467dcb791b80 + bytecode: e2c7366a24109eb7d575db5c998ee9833edf454546a359ea4508eeabfff11d19 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.out new file mode 100644 index 0000000000..e30d48479a --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 5a59bc205eed395ed0a857abe27790d3612aaac26fce76ec8b77b539dd85b4ad + type_checked_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + unrolled_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + initial_ast: 712a22f4f035c3b83555e2eeb03d2cec4427710d03a3a82596658d8cc9488a5e + unrolled_ast: 712a22f4f035c3b83555e2eeb03d2cec4427710d03a3a82596658d8cc9488a5e + ssa_ast: 2d00066d981ed60d92996292424186891c6de9f475a83bed92a41dd81e85838a + flattened_ast: a9a80e71a4064cc0fef912e02f4a2ec1166101e72dad82ee95142e581cc6a8a2 + inlined_ast: a9a80e71a4064cc0fef912e02f4a2ec1166101e72dad82ee95142e581cc6a8a2 + dce_ast: 88d82c6c990400586d426ec521348bf7fb94d3e7aa01a6a7f0dc6b25018617f4 + bytecode: a789b985627d6892e58cab9b998763a2ab106196eb6b1c0c4452af122c7908fc + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.out new file mode 100644 index 0000000000..6e6f75a759 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 992dd740994079e30efead06f29f9c2df115a70d54f7649eb5fadec3120db120 + type_checked_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + unrolled_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + initial_ast: f539a688aa3df35a14b932f2895e912201da956dde3d909391ee26f6982006f3 + unrolled_ast: f539a688aa3df35a14b932f2895e912201da956dde3d909391ee26f6982006f3 + ssa_ast: 954e06c21389dbdbe15c481d1587877ccf6387583931ee4a8894ce5378f6ccb7 + flattened_ast: 891bb08d28fdf2a95189e5b9eea58a09dcd9a882012caa419448f35e6057aeec + inlined_ast: 891bb08d28fdf2a95189e5b9eea58a09dcd9a882012caa419448f35e6057aeec + dce_ast: 063caf2ce386cd4098dc81c25c6a14fc4001c17eecd3fd0734946917a4fd97e5 + bytecode: 32f8e6f9a0f4869bb08c45ba1b94b5411c3641959a3f21203f34f54bfbdf120f + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.out new file mode 100644 index 0000000000..5db93450d3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 7c89248ded858c5bc52c59d418ebea9937f41f59e113313a43dce30d21780db9 + type_checked_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + unrolled_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + initial_ast: e1e2d5d766393652287c9fcf7b62a6304ecca9b8e18e8e184468c4bdf06536ac + unrolled_ast: e1e2d5d766393652287c9fcf7b62a6304ecca9b8e18e8e184468c4bdf06536ac + ssa_ast: 7ad2e51e419ace9d8b63d727ea404f4967dd937a9b793a3c85c3a5d0c5093e6b + flattened_ast: 20c82f5ed23f192de63a8a9777871de7b0b36845c4fae5fcc75176edfcdffa8a + inlined_ast: 20c82f5ed23f192de63a8a9777871de7b0b36845c4fae5fcc75176edfcdffa8a + dce_ast: 364863ebd963618338d958c46c26330630c0a4a6412daf7d3c22b416079471c2 + bytecode: 9c22fdc85a23a84932bff4c1d2f420db2e3c8f60fe55b628e573a100318afc09 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.out b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.out new file mode 100644 index 0000000000..7983f1d0f3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 9de9a9614bae9e392c40cbe50c32763866d8facbe3b7b0e618c773c9c1e2452b + type_checked_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + unrolled_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + initial_ast: 5a1dc87d26f9e00000f22a25eed70329f049b7ead8f2ac4e1e04ab9243bd0fda + unrolled_ast: 5a1dc87d26f9e00000f22a25eed70329f049b7ead8f2ac4e1e04ab9243bd0fda + ssa_ast: 8c91763dc610b9875b0dd20aa65d5453000b3fc5ce429b2f7e92595b86c180e9 + flattened_ast: ad67aa5db587fd1a7598d9430d9434657c3e438e71e33ae090db8e24747fbb7b + inlined_ast: ad67aa5db587fd1a7598d9430d9434657c3e438e71e33ae090db8e24747fbb7b + dce_ast: 9a74eb0f05a8096f8aea0cddc15b22122972d5f705bd06089db13b6ba52f82b7 + bytecode: 3abe59e41cf33d2c2faa4a8b214ca184aa3b1a34b4264e0d26d520d9ccfaa10d + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.out new file mode 100644 index 0000000000..50679f5ab3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: d61b6c9a81578cd47a707319541ce1cea3ac5e20020f2a5b8c0b0363df72ceb4 + type_checked_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + unrolled_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + initial_ast: 09862478d8179097733eba04c4d0c3aca09fb152faf75e76b87c17185e355905 + unrolled_ast: 09862478d8179097733eba04c4d0c3aca09fb152faf75e76b87c17185e355905 + ssa_ast: 3d5ee7adeed83d76e0031039029941025258c281eeb315b25537d9641077d087 + flattened_ast: abae11f764f8549dc1b2df79ef27549eab63cbe918337f0a05c8ce75643fd222 + inlined_ast: abae11f764f8549dc1b2df79ef27549eab63cbe918337f0a05c8ce75643fd222 + dce_ast: 0443fa2392ac8ad9612c7445255158c69d448cb1e5d5b613aa3e842a99e874fd + bytecode: 49b4c6dd96208f99a71898243601f70b0905787e0a1d4c265a781db1a20cc0d5 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.out new file mode 100644 index 0000000000..943d0cc696 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 077422b93c97f7cd8a28ff1ba7bbe58e07c4b7887304c46d35eb5ac6bf23c972 + type_checked_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + unrolled_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + initial_ast: 7373dc8e19a76dc35f58eb3743bf2a59a4ee18e246799289c46eda37aa6d5562 + unrolled_ast: 7373dc8e19a76dc35f58eb3743bf2a59a4ee18e246799289c46eda37aa6d5562 + ssa_ast: 347a1977100611a0af11bcd283b9d70af748676c64ed4b41d2439922b73701b1 + flattened_ast: 11c96f9d0f95ebbaed415447c1d7a5c62dc5f048a02aae1b27b6937af11072c9 + inlined_ast: 11c96f9d0f95ebbaed415447c1d7a5c62dc5f048a02aae1b27b6937af11072c9 + dce_ast: bce2c3ed4ce5fd01694e966701f2b3270182350b5e8f1b5635098a4d803b745d + bytecode: 363561300454f0f6b2213cdd668ddb222e6ae238cded832a3b2703d4d05394ce + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.out new file mode 100644 index 0000000000..007f0529f4 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 0b9e361a60499d11d8de9a427cd689b0904e3660092b6ff95a1c07bf09964e11 + type_checked_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + unrolled_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + initial_ast: 25b563f1ee5d58b63291a4aa81879718c640b6e695c994e9b5e45999185daaa2 + unrolled_ast: 25b563f1ee5d58b63291a4aa81879718c640b6e695c994e9b5e45999185daaa2 + ssa_ast: 3d5e91a1ecbf970e776153629844e0c0c77fd6d4aa2dd16ab7e0a0f48aed1164 + flattened_ast: d2bec17adbc0a3aaf84bf0cd4106431426b4480d5d349f369106fbaeea16f89c + inlined_ast: d2bec17adbc0a3aaf84bf0cd4106431426b4480d5d349f369106fbaeea16f89c + dce_ast: e02d8c84137b0500688a0a5ebad3aea991053feaae53bf4cee178a38c1164e0a + bytecode: 8c0aeafc028be27891412b5df88c1352b25b522936310bd38afd3334c8f21042 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.out new file mode 100644 index 0000000000..bbda666074 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 85b2afdf445a99fc5beb1bb9b7c98ddce8f4936dbdb5173447e64bfc5c73e96d + type_checked_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + unrolled_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + initial_ast: 33a88212ddcbd83cba364b39e1ea8812b081f5ec3997573a3852f138ba09ffae + unrolled_ast: 33a88212ddcbd83cba364b39e1ea8812b081f5ec3997573a3852f138ba09ffae + ssa_ast: 74c9a766f34ff9792fa2c10464ade69f13e8b2d7e7801ee7df38e4f31a36a90b + flattened_ast: 85a3e3f2ffdeec70a527e9365f81dc9322892cb11ca1196c68c6f0dccc73d53b + inlined_ast: 85a3e3f2ffdeec70a527e9365f81dc9322892cb11ca1196c68c6f0dccc73d53b + dce_ast: 729ed6af177b4b04b03373d1348ba4ebd106c77b6520f86fd022cd893602d2d3 + bytecode: a6f52a903b9de83e1cd758c63713591e8270f14276acd338000f47ea2ae40302 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.out new file mode 100644 index 0000000000..556c299ad1 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: e57034c883f65a0bf8bf21c5948e8e470938929205661f4629331145f96f457a + type_checked_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + unrolled_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + initial_ast: 147b3f622a7a5d7367faf0985d223d472ec31d91f717b01aa2690883bdbdf53f + unrolled_ast: 147b3f622a7a5d7367faf0985d223d472ec31d91f717b01aa2690883bdbdf53f + ssa_ast: 70255acab6c074700e62675cb4830513b22b9ffc30fb5d4b85db1e739754c667 + flattened_ast: d7d0d699b9635cb35d89de2ac50e8fd7b33012451c4715bc6552aef8bf512079 + inlined_ast: d7d0d699b9635cb35d89de2ac50e8fd7b33012451c4715bc6552aef8bf512079 + dce_ast: dd5a12ce165ce074b230dba9e970d430b438c10c9202217fb5a726e71b65ee6f + bytecode: 8b1f3cfaee87de68b82bbdf34cdaaac42bcec03c7a1220993034fd1251d4d4dd + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.out new file mode 100644 index 0000000000..2e41aa32fc --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 30b74ef9405be6a65d0718e893155dfab9c5a27ba6331b46674fbfe804c078c7 + type_checked_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + unrolled_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + initial_ast: c429e5fd950941c7e1f9be7927af429e0f53eec1cf30bd15ac982f2eb2bfbf88 + unrolled_ast: c429e5fd950941c7e1f9be7927af429e0f53eec1cf30bd15ac982f2eb2bfbf88 + ssa_ast: 40e37030b58cfbaa943402868844a3b9b3323b282b43640bbb30f5298c316597 + flattened_ast: 9070c238034e71299478cf8747fca012ea2baf45f6488a803cd319632c28c304 + inlined_ast: 9070c238034e71299478cf8747fca012ea2baf45f6488a803cd319632c28c304 + dce_ast: c0852890e56565413fe8026f53dc84a3e2fb6cfcf7318e95d1db666cd926e4b9 + bytecode: 638b45c57e81c04b6f17fe13aa0764399352a80bd71618b03ff4831da6855f6e + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.out new file mode 100644 index 0000000000..0a5ed53a9b --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 5a59bc205eed395ed0a857abe27790d3612aaac26fce76ec8b77b539dd85b4ad + type_checked_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + unrolled_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + initial_ast: 89bc1becd8bc60428b40702a3da4c9197e6c2510c4d1c4cafa0fd019498be110 + unrolled_ast: 89bc1becd8bc60428b40702a3da4c9197e6c2510c4d1c4cafa0fd019498be110 + ssa_ast: 4062223a8b506406edcafc3b270e07e56ce6292fcaed40f8450522f50346e7fe + flattened_ast: 9858a3d4d783e112fd18b105aa1bb210971fb7aff6b877d18ac2952183967cdd + inlined_ast: 9858a3d4d783e112fd18b105aa1bb210971fb7aff6b877d18ac2952183967cdd + dce_ast: 05a3589901d5f44c50552ad6b243bf51c9e57cb464e6b4b4add9523ced6a3289 + bytecode: bce86817893871d9d55d2a5a1dfb095822a7ec0813c029d7243200b20a401587 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.out new file mode 100644 index 0000000000..7c5438ee64 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 992dd740994079e30efead06f29f9c2df115a70d54f7649eb5fadec3120db120 + type_checked_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + unrolled_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + initial_ast: ef853400efcbd0d76e78e82d79b10527a9cc15bd28b262e77db64844b1cfba65 + unrolled_ast: ef853400efcbd0d76e78e82d79b10527a9cc15bd28b262e77db64844b1cfba65 + ssa_ast: 139ada0d7bbf4c41c71633046553f4ae16911554380446726f7834fd2de6db6f + flattened_ast: ba550caf09f8e1f570df855415f3efe98a1a132f921227faf8117927ff9bd76a + inlined_ast: ba550caf09f8e1f570df855415f3efe98a1a132f921227faf8117927ff9bd76a + dce_ast: 01218c950c720bce2fc7e73febfbba90502e1866f64a2a11eb6d5037bcfdece5 + bytecode: 66c33deb9dd42d3e8f6600d5210f16e5fec245557773b8041346f13fbca2c37d + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.out new file mode 100644 index 0000000000..4609610e5b --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 7c89248ded858c5bc52c59d418ebea9937f41f59e113313a43dce30d21780db9 + type_checked_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + unrolled_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + initial_ast: ae547e9eeea784f05ac46ef39dd3391a2b547ebe4ac4d29f7676912d4e155893 + unrolled_ast: ae547e9eeea784f05ac46ef39dd3391a2b547ebe4ac4d29f7676912d4e155893 + ssa_ast: 52f7b5287192423c63b9623d6615e0dce8991ff356fc6d659558591b16b15031 + flattened_ast: 3dc6afeaf0a82c0d2f32d9869e56879e403b75eb099918e5ba9a6152168f20f4 + inlined_ast: 3dc6afeaf0a82c0d2f32d9869e56879e403b75eb099918e5ba9a6152168f20f4 + dce_ast: 8ed76acb00c2cb05815a282987e088f98ae18339cd875495dc2140665efbb3fd + bytecode: 8b8c77b3c97fbee9405b7ee10e65b3d317e42479aa8944b3bd3f4fb6f02edbb6 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.out b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.out new file mode 100644 index 0000000000..651f6d7010 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 9de9a9614bae9e392c40cbe50c32763866d8facbe3b7b0e618c773c9c1e2452b + type_checked_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + unrolled_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + initial_ast: 8490931379bd15dac4aef5e294cf0bab0977d5f3af12179d5f983335a7053744 + unrolled_ast: 8490931379bd15dac4aef5e294cf0bab0977d5f3af12179d5f983335a7053744 + ssa_ast: 3ebf70527ed85143d4f2cbde727225569b8a0cd99dbc98d9ea74833557058173 + flattened_ast: b7c03434199657f6e7d119d218109225ef6962180587477eb33d7638f9ebda89 + inlined_ast: b7c03434199657f6e7d119d218109225ef6962180587477eb33d7638f9ebda89 + dce_ast: aa0fc18e95246a30b22cdafb4a5a8a7881c7e395071415fb6315626a979b1958 + bytecode: 29856bd31a6992636fabf8b9428115dbf7dc585688f358a617b9352c1c3a377f + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.out new file mode 100644 index 0000000000..949a32c63a --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: d61b6c9a81578cd47a707319541ce1cea3ac5e20020f2a5b8c0b0363df72ceb4 + type_checked_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + unrolled_symbol_table: 242199b3378fc1e61068a3091df5fbc413ee879c63a678cc7256ae0562d8e0f4 + initial_ast: 17c197f7153757e36de911c50cdbf2f02c2dd6afa889bb95b97e6b37d862b8d0 + unrolled_ast: 17c197f7153757e36de911c50cdbf2f02c2dd6afa889bb95b97e6b37d862b8d0 + ssa_ast: 63263e66a7683ad824c5b63bdb8a4e94ab231f6fdf0ab3d8ca3913c180a0dd3f + flattened_ast: 96ac6cec23ef1cf1725cdad165c13c39ec392cfb28f52c53f1e78d524840299f + inlined_ast: 96ac6cec23ef1cf1725cdad165c13c39ec392cfb28f52c53f1e78d524840299f + dce_ast: 11af2fbaa3909c079bb9ed55fb9da19f4819bea3e567ef4fb681a69e3cb1daf2 + bytecode: 84d2910c4f799e360581da0b0aca505e95e1c1bb187f45877c5b227e9561d936 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.out new file mode 100644 index 0000000000..732ea7ff81 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 077422b93c97f7cd8a28ff1ba7bbe58e07c4b7887304c46d35eb5ac6bf23c972 + type_checked_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + unrolled_symbol_table: 5f860d2de9a0608ecbc70179a65c645cd622701fee49e955c77387fa225b01a1 + initial_ast: 8cb1cb0ec27d4d33ca1eea5aca33ad19fb818a34193b32aa232d3439f485e085 + unrolled_ast: 8cb1cb0ec27d4d33ca1eea5aca33ad19fb818a34193b32aa232d3439f485e085 + ssa_ast: da8474f648b6ab0b1e4a2aa85a0648c3c0d9510c8e0536d2298cb4867928643e + flattened_ast: 37cf166fb1dbe1d7b4c4adf0e0badfd73ca4d8a53b45b450a5e5027fc4095cbe + inlined_ast: 37cf166fb1dbe1d7b4c4adf0e0badfd73ca4d8a53b45b450a5e5027fc4095cbe + dce_ast: 4d7654525ca67ee2f2c80a0b006f1cc0e50873e510ac48d57836f420b00e920b + bytecode: 101fe1af849e29ba44ea27ea575a3393fba2e0d2e302e43327b8547561b5a2ff + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.out new file mode 100644 index 0000000000..9f92b689ea --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 0b9e361a60499d11d8de9a427cd689b0904e3660092b6ff95a1c07bf09964e11 + type_checked_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + unrolled_symbol_table: 58b695183f390fd270d2d7b521591c524ad80192b3c1e04fc7e691ebd5fdf24e + initial_ast: b22bf0b0ff3f5c31d3cda18d190536912f222eb802f12288b6f0445e01195fca + unrolled_ast: b22bf0b0ff3f5c31d3cda18d190536912f222eb802f12288b6f0445e01195fca + ssa_ast: 7e5f25144ae9b0668e4b89b217f4da22f46252725b48e972639289be92a9eb8a + flattened_ast: 93c971474ca8216a3d95b55eaad166e63f2ed243199b1895b82c0369d02b50fc + inlined_ast: 93c971474ca8216a3d95b55eaad166e63f2ed243199b1895b82c0369d02b50fc + dce_ast: c0f4bcfca18831f2b69ebc6c288b70d7384c29c3141a8f37c758eaccb90268ad + bytecode: 6ef5805c3336e65726b72f34cc357f5f87030d017dfd525f232f912f14c3f421 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.out new file mode 100644 index 0000000000..cf913d867c --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 85b2afdf445a99fc5beb1bb9b7c98ddce8f4936dbdb5173447e64bfc5c73e96d + type_checked_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + unrolled_symbol_table: 37ed5c5410f201880eb2da82ac4ec3d3ebb21756fc697827b30a5853945bfbb7 + initial_ast: 71b2ad6cdda6b45667e162c5306329880bb7673c393c95e7fc54ad60236f82d7 + unrolled_ast: 71b2ad6cdda6b45667e162c5306329880bb7673c393c95e7fc54ad60236f82d7 + ssa_ast: be8a1e16f3f12117c54d7a003c48ff1029044f28f603989d8ec2387405983f6e + flattened_ast: 691dca2726432f9ff711b66ab5f0342b9a6aa63dcdfcbf8b9b439fc1b5ec2e90 + inlined_ast: 691dca2726432f9ff711b66ab5f0342b9a6aa63dcdfcbf8b9b439fc1b5ec2e90 + dce_ast: 7eb1de9692dfb01c4f0d395f56573333f1fb040458d98ac213ef89d33b24fd4f + bytecode: 23b8c2466fbe8fc4cabd6fb7bb3b980b10ff779efecfd8fd347d3c4b46c2dc58 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.out new file mode 100644 index 0000000000..1e3f063d03 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: e57034c883f65a0bf8bf21c5948e8e470938929205661f4629331145f96f457a + type_checked_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + unrolled_symbol_table: bfa5890e9d7766d453384d93a8a70c7513c88833460ec856a316742105dee2c8 + initial_ast: 07658babd757cfca5eff71d360f409c798ef7b6a0a0759b5669cbef3a74c4b77 + unrolled_ast: 07658babd757cfca5eff71d360f409c798ef7b6a0a0759b5669cbef3a74c4b77 + ssa_ast: 5c5b5e4fdadefcea5d25ce11ab7b56d272ab24c4f84cd18e8df014b964761325 + flattened_ast: 92baf49de8f051aa06b38926cba0ef2a7e99e9c203d423f6672b99fd982b88ad + inlined_ast: 92baf49de8f051aa06b38926cba0ef2a7e99e9c203d423f6672b99fd982b88ad + dce_ast: de6d5a2e19c1531ec8991bbb4f1cd74caa372e94c0844bece5444f20939167a2 + bytecode: aa8cfafa904c5e0d62b9bb6d271a6182830cb6cfb1bedaa78812a6e5be735597 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.out new file mode 100644 index 0000000000..82ca07244d --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 30b74ef9405be6a65d0718e893155dfab9c5a27ba6331b46674fbfe804c078c7 + type_checked_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + unrolled_symbol_table: df1b9add309c4f16c8fc410cfe1a5e081449f19662d106576ea7934ae2ec016a + initial_ast: 6d9cf43690c8317046e96a90bbfcabc90f57189466a0e1aec84454f045e563f4 + unrolled_ast: 6d9cf43690c8317046e96a90bbfcabc90f57189466a0e1aec84454f045e563f4 + ssa_ast: dbf5ec5f0c403e3ab142cf7aeff95b824dd560cc733debea01ee6b9e278a44b0 + flattened_ast: f0a151eff90f2fadfd7b465a84ed27df95142b31b51641b416382642067533b1 + inlined_ast: f0a151eff90f2fadfd7b465a84ed27df95142b31b51641b416382642067533b1 + dce_ast: 9023b328cd641a916391b9aae8504bd94fa5f7109829317dc6ff9159e1fa4e72 + bytecode: 540f46ca90fbe10a5ad8ff7b757d5d55a6e735ffd21c22116e7c65f0b9bde58d + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.out new file mode 100644 index 0000000000..c2292faa9c --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 5a59bc205eed395ed0a857abe27790d3612aaac26fce76ec8b77b539dd85b4ad + type_checked_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + unrolled_symbol_table: eec79e1688bdeb5852327404ba04f4db9b6a914d2b19fc0578a44ac097fa4149 + initial_ast: c4125098903ce61020a3de98caee424f02bf4ca67757541bacaa51d64fe74e4c + unrolled_ast: c4125098903ce61020a3de98caee424f02bf4ca67757541bacaa51d64fe74e4c + ssa_ast: 28a9c19c8c5e34ed934350509860f61563f19af84bfa79fe4ffea57955887191 + flattened_ast: b3945c103201ef2ef212dc552a51effa1f1f0b4109b8327a36831286777aba1b + inlined_ast: b3945c103201ef2ef212dc552a51effa1f1f0b4109b8327a36831286777aba1b + dce_ast: fba742190f3f65d0b2c3cb02a927eea03df515224dc85ca0d6eb7c98f2057ef1 + bytecode: a00a5d5ec5035a093b4928bdce57a4d79d9300e6f86565525e88bb670eb02957 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.out new file mode 100644 index 0000000000..25c7f236fb --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 992dd740994079e30efead06f29f9c2df115a70d54f7649eb5fadec3120db120 + type_checked_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + unrolled_symbol_table: 2271d0f496fc810a81e3edbd0303d248c348b0a732ee32e9cff64ccf24073daf + initial_ast: 7b3da5bb30d8c2e95f5f3826b09fc52a0cb68d615fbf54efebae2a0035a149ea + unrolled_ast: 7b3da5bb30d8c2e95f5f3826b09fc52a0cb68d615fbf54efebae2a0035a149ea + ssa_ast: 40c089ee90950931a203fe2b43dd0cbe4e292c896ded83825b49b686a702acba + flattened_ast: e30af9a6df7a96604ee7b755c32d0d8b6e08d7d32b30b77904a60342529672d9 + inlined_ast: e30af9a6df7a96604ee7b755c32d0d8b6e08d7d32b30b77904a60342529672d9 + dce_ast: 608dc889fc0ac03bf3ff1bf2eb402a8ca971e305820e06cb88bc504db5d0ea70 + bytecode: 0719502c2e69186b2f64fe31ce1cc6f35abad01c9a86f5f6d7dafb7c465504b7 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.out new file mode 100644 index 0000000000..35c58b28ed --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 7c89248ded858c5bc52c59d418ebea9937f41f59e113313a43dce30d21780db9 + type_checked_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + unrolled_symbol_table: 0d4884468efa4393f32b1d81aa9f1bd16687853321f65b88703dfa8ec1e9b257 + initial_ast: df5cf025f5d3f727451edb303c3dc474b8d5cb59c87dee29197b2190a0db03d4 + unrolled_ast: df5cf025f5d3f727451edb303c3dc474b8d5cb59c87dee29197b2190a0db03d4 + ssa_ast: 44ebb015003683b15d6202189003e05e3292915c5db98491b3fd1dbedce22b93 + flattened_ast: 27cda04123229fb170e7adf82a3c48a8a7aae405f388f238c790b7e5382e4022 + inlined_ast: 27cda04123229fb170e7adf82a3c48a8a7aae405f388f238c790b7e5382e4022 + dce_ast: 885cde1e290058c3f63c3ce34a45eb0a2d5c172d0e60aaab308e4935e057dc17 + bytecode: 2741bb1b69d7b32d52a4f6ae48a4b8197f73e8be7531d4d346fcce378bbda8dc + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.out b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.out new file mode 100644 index 0000000000..51e56851eb --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 9de9a9614bae9e392c40cbe50c32763866d8facbe3b7b0e618c773c9c1e2452b + type_checked_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + unrolled_symbol_table: 0c70472fb21893662b1ec36bd51f9ac064da4731817d99d9c0030cf08799d915 + initial_ast: 4e755862a311f6217021628bffa85a394a1cac5e5c74a7831d5a4b3c70701b5a + unrolled_ast: 4e755862a311f6217021628bffa85a394a1cac5e5c74a7831d5a4b3c70701b5a + ssa_ast: fb01b137c9ebc6422ea69195e5dcf503ecae9139ba7329ceaa7a5110645d00d9 + flattened_ast: c076192ec371f99bb15cfe350c521081355281bec7a6a53fb7e0640879f05be1 + inlined_ast: c076192ec371f99bb15cfe350c521081355281bec7a6a53fb7e0640879f05be1 + dce_ast: fb8292c98922e343783c429c12d7a019b20e0c8fea37335dddba0423253ecd41 + bytecode: 5c85a376013c529f75944db09bfa9ee85470aca42e5622cfee8cb8c8dec29145 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_address.out b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_address.out new file mode 100644 index 0000000000..b474a0736b --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_address.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + unrolled_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + initial_ast: 6615b4ec6a9d6bf28d78e4e19d88ea84c502122ad14693e5b31f7be00227c4df + unrolled_ast: 6615b4ec6a9d6bf28d78e4e19d88ea84c502122ad14693e5b31f7be00227c4df + ssa_ast: 1abb4c592acca674523ba017969cf697e540716cdef334341a7537c1c5d40067 + flattened_ast: 17b0cbfc645d660a717c02620e51931d39cc2907bde1b137a092d46ec0fa61ec + inlined_ast: 17b0cbfc645d660a717c02620e51931d39cc2907bde1b137a092d46ec0fa61ec + dce_ast: 1341790680c3887e4d86d90c68156f28271b788ee395d0ebdd96d1e4a0ff3011 + bytecode: 03845ec2f54d49f71640659603ead8f68ad067a15fda438e5e13524777d1559b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_field.out b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_field.out new file mode 100644 index 0000000000..576a558d6d --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_field.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + unrolled_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + initial_ast: be521330f36aefa86393848ea8ca37d4e4d69b3cb088010c23aba3f867938f1f + unrolled_ast: be521330f36aefa86393848ea8ca37d4e4d69b3cb088010c23aba3f867938f1f + ssa_ast: d913ab4a772f2c38b6a59c11763dd34f9d49ef0e5f8a498f9c8356962f33cf2b + flattened_ast: 87011f33fecd0978cc4343d6b3c3b9af3b9cb022e5cd597160a046e2b57eb227 + inlined_ast: 87011f33fecd0978cc4343d6b3c3b9af3b9cb022e5cd597160a046e2b57eb227 + dce_ast: 880f01299561c69747f2a89887b6c89a78ac6075fe144b46f394be1a9246d047 + bytecode: 690637a56c18881cf6f85a1531bb8b17cd18d901daf7c29301562c019fe495c7 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_group.out b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_group.out new file mode 100644 index 0000000000..95f63db5bd --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_group.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: fd9620b494239c2b62c2da7b951d51f08a1c0ad366a726e6b108da648ce5fb58 + type_checked_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + unrolled_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + initial_ast: 3f86f3bd791e1b19574b8e40b4e8c4644178a39527ba65b173baaa631c928da1 + unrolled_ast: 3f86f3bd791e1b19574b8e40b4e8c4644178a39527ba65b173baaa631c928da1 + ssa_ast: 1f09fa428bcaa4e710dce6b0203f8c9c086f11287435053ab098e6df240f3ee0 + flattened_ast: 4eb1bf59ef96876b790804f4270552678ddea2844724a8a4566ba0385221f7ca + inlined_ast: 4eb1bf59ef96876b790804f4270552678ddea2844724a8a4566ba0385221f7ca + dce_ast: 0159e2b21195dcdd66477a3ec3d5c58795f2c25107ee5ebc413ff4ff62e6dd48 + bytecode: 46d916910ae925bea8c55fc0887b41d05efedac9228150f59f894ff52652a290 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_scalar.out b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_scalar.out new file mode 100644 index 0000000000..458b3dfdae --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_256_hash_to_scalar.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 15549a7085ac019c35b881b7ef00f56cbfbf0a21e9ceb4d4599fa4e06359d9e5 + type_checked_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + unrolled_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + initial_ast: 1e4f418eac2af1c3658b42e56dc5524303fe6ea9505e78ad6b24d274871251c6 + unrolled_ast: 1e4f418eac2af1c3658b42e56dc5524303fe6ea9505e78ad6b24d274871251c6 + ssa_ast: c27b9e4aad64a5919ee8e5b92746d9e5ad67eda776027e61467c7c28459a2199 + flattened_ast: c5aec610708dfc2ae1e7bfdb61b0c4af7f90cea289591c1733542b1b70ce0f43 + inlined_ast: c5aec610708dfc2ae1e7bfdb61b0c4af7f90cea289591c1733542b1b70ce0f43 + dce_ast: a0f3ae6de6406100ed5df02e424c75b2c1c11a4be80c2b0d0b2ac9fd7f1c19e7 + bytecode: d6a9ad31d87c08ce7882a80a4d5067f89ce048108bd23a41487051aab4904268 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_address.out b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_address.out new file mode 100644 index 0000000000..9ccfed1e3f --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_address.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + unrolled_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + initial_ast: fc309ea521880e5cb6fa96a945358ebd253e62722ae8536e19bfa65f72106b32 + unrolled_ast: fc309ea521880e5cb6fa96a945358ebd253e62722ae8536e19bfa65f72106b32 + ssa_ast: ba7f60e072730b2a9f62e52fcaf2713430f6b38f544a79b977d7ae2a55f66197 + flattened_ast: 56e3787701cd2fe3153789284671a85a21fa7b44c7f5429d9bc1fb68353c3874 + inlined_ast: 56e3787701cd2fe3153789284671a85a21fa7b44c7f5429d9bc1fb68353c3874 + dce_ast: 1341790680c3887e4d86d90c68156f28271b788ee395d0ebdd96d1e4a0ff3011 + bytecode: 03845ec2f54d49f71640659603ead8f68ad067a15fda438e5e13524777d1559b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_field.out b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_field.out new file mode 100644 index 0000000000..1a2b532f7f --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_field.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + unrolled_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + initial_ast: 2c12bafc529399dc071d0a5541310529f9142d36b59ab04836b8df343ce71fd3 + unrolled_ast: 2c12bafc529399dc071d0a5541310529f9142d36b59ab04836b8df343ce71fd3 + ssa_ast: b2cb3dd7bdde28fbbd0169e5e9d7eff13da71e07e7e27da6ee84335ab221ce34 + flattened_ast: 8b36d1cb0630d696179b56103c363ddce63669fdf6af21e9f63252f3f347d756 + inlined_ast: 8b36d1cb0630d696179b56103c363ddce63669fdf6af21e9f63252f3f347d756 + dce_ast: aeeeceda0976185a6f1f69caaead83b1338714c1067968283fe097db8ab99fd4 + bytecode: 2e3beeb8a0f7547611c2c519e43599ac9e5b7fafc215ee921eb500d921987252 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_group.out b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_group.out new file mode 100644 index 0000000000..1bb273f8ca --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_group.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: fd9620b494239c2b62c2da7b951d51f08a1c0ad366a726e6b108da648ce5fb58 + type_checked_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + unrolled_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + initial_ast: ce6751535a7971f1ae72a7b7936e1b513eb376e3f49337ca3c729d8874736e53 + unrolled_ast: ce6751535a7971f1ae72a7b7936e1b513eb376e3f49337ca3c729d8874736e53 + ssa_ast: 14a38882ba4511b53bb737f6da2315c097f303c3d71b60a2ea76b77af5a973c0 + flattened_ast: 7df158ac36b3df0b3588789e594a51601b45bc20d5c8f9e43022b458394c66e7 + inlined_ast: 7df158ac36b3df0b3588789e594a51601b45bc20d5c8f9e43022b458394c66e7 + dce_ast: ffd6d1391873fa2f276d77fc60ac161e73a076bbdeae6d019ebafeec43733798 + bytecode: 9dddbe9729f05832d71afd33571dc4ea51212f6e4f6d6c6b27f523d38059f2a1 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_scalar.out b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_scalar.out new file mode 100644 index 0000000000..6dccad17b8 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_384_hash_to_scalar.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 15549a7085ac019c35b881b7ef00f56cbfbf0a21e9ceb4d4599fa4e06359d9e5 + type_checked_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + unrolled_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + initial_ast: aa3b6f8d74a345729764635fa7e45a8ca1564c304d4127035fa45143f7487d4f + unrolled_ast: aa3b6f8d74a345729764635fa7e45a8ca1564c304d4127035fa45143f7487d4f + ssa_ast: 14c4618962c23c46640618f75db92870484fc399992cd1f6db99947f850132b0 + flattened_ast: 33a706e93ed3995578055c96c101b0f5f0159ad5ba07b768a73f01723132313c + inlined_ast: 33a706e93ed3995578055c96c101b0f5f0159ad5ba07b768a73f01723132313c + dce_ast: c4ba8b94e9e9ca64803e437d41a24a961781d73d585dc1814a547f0f97ee70ba + bytecode: 77991d7596edcef00041488b23dfbb364c0c979217f4de3a324d42d91ea28f5a + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_address.out b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_address.out new file mode 100644 index 0000000000..009d101016 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_address.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + unrolled_symbol_table: aaaec423b2c439b4857751e7dec72e29fbe3cf863753d6f21e52c9d0f5e98558 + initial_ast: 39ae3d15dc0c9901e40f6acff45fee2b5932155cd8eafca6b7b103ce4e3f45b6 + unrolled_ast: 39ae3d15dc0c9901e40f6acff45fee2b5932155cd8eafca6b7b103ce4e3f45b6 + ssa_ast: ad7b50e773a3cf352a279722ff6b5052bb6edb425c50bc7139e3eeefc8bca13c + flattened_ast: e072c68d0717d87fc7bfd70fc89a9209645c0e4afe2bfdd83cea14ac4fd99f0b + inlined_ast: e072c68d0717d87fc7bfd70fc89a9209645c0e4afe2bfdd83cea14ac4fd99f0b + dce_ast: 1341790680c3887e4d86d90c68156f28271b788ee395d0ebdd96d1e4a0ff3011 + bytecode: 03845ec2f54d49f71640659603ead8f68ad067a15fda438e5e13524777d1559b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_field.out b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_field.out new file mode 100644 index 0000000000..da542d0728 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_field.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 1f96df1e414fd96505a23c658692de40614d28804ebeaeafc90835f4087c91cc + type_checked_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + unrolled_symbol_table: f51b6c1660b8bb5b45ca5e05c303bf2fb92e47d575ff34c69abec002486452f4 + initial_ast: 13aeccb81d6ad8d208f6a739291407934ef8d1ededb2efc27a7833d5d8262cfa + unrolled_ast: 13aeccb81d6ad8d208f6a739291407934ef8d1ededb2efc27a7833d5d8262cfa + ssa_ast: 021540bf78222096514e2b05ccc93de4ae7056d130a25953f72df6bcf3c81563 + flattened_ast: 597e1c7c97c91c48a274e162c5bdddaee9752b4825700e7db28046e06a34aacd + inlined_ast: 597e1c7c97c91c48a274e162c5bdddaee9752b4825700e7db28046e06a34aacd + dce_ast: 18afff299bde42a118e3b8f278a41093d0d7458a7a66620b4e5308ddaebcaf5b + bytecode: 5a8a82d9707b83f6fe1d6f317a88b89ec9d908cd30fde3658d4e465e4ddf88e8 + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_group.out b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_group.out new file mode 100644 index 0000000000..6af0a821d3 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_group.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: fd9620b494239c2b62c2da7b951d51f08a1c0ad366a726e6b108da648ce5fb58 + type_checked_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + unrolled_symbol_table: 392b4afe780015c412cfb5e45a1b084b40873e9eda40e05ef94ab54aaadf8a3d + initial_ast: 3e6af33f13b25c0ddfff525e3a0f9d8f9d6b32fde79754b37a7beff1ce67d2b7 + unrolled_ast: 3e6af33f13b25c0ddfff525e3a0f9d8f9d6b32fde79754b37a7beff1ce67d2b7 + ssa_ast: a0f1744da0df1c5bb35240a18948e4983e548b2e28e19b0c210ac5eebbd859c7 + flattened_ast: ff16f448d35d3fc6cfade32b26b5f5d90b1b75fde5b5da7850229547ab1f9282 + inlined_ast: ff16f448d35d3fc6cfade32b26b5f5d90b1b75fde5b5da7850229547ab1f9282 + dce_ast: 14a2d39cc9977d7c150b44187eb5edb433ca11c28993c148b22934422a54f3eb + bytecode: 02daa75965baeaaad40c59c24d161cb796a2d833b10bd189c9bb2a38e8bf747b + warnings: "" diff --git a/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_scalar.out b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_scalar.out new file mode 100644 index 0000000000..f7b13457f5 --- /dev/null +++ b/tests/expectations/compiler/core/algorithms/sha3_512_hash_to_scalar.out @@ -0,0 +1,15 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_symbol_table: 15549a7085ac019c35b881b7ef00f56cbfbf0a21e9ceb4d4599fa4e06359d9e5 + type_checked_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + unrolled_symbol_table: 3955df6eabb0bfb8f9df5a34a49c11bf3bf95325f88a0affd038b820e7541266 + initial_ast: 3b6315b46804ce7818c64aa7e259b97cbbf9cd2ab4dfac31309b251bcc43f94f + unrolled_ast: 3b6315b46804ce7818c64aa7e259b97cbbf9cd2ab4dfac31309b251bcc43f94f + ssa_ast: f1e52eb3009319dad6583dcbf2404765653e4586c3756943b9b264bcb7fc3df2 + flattened_ast: 62141a75f839703a83606b9283930cd3959145df882d61293bdb6adaea48b42d + inlined_ast: 62141a75f839703a83606b9283930cd3959145df882d61293bdb6adaea48b42d + dce_ast: cf7ac2f2886915671cef89539e176daf99c5142c60e91a203e231e9ebb10fdd5 + bytecode: ea26232ca66042daf7a856c208ce760f7355068171ed4cde5da403f375ab7d65 + warnings: "" diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.leo new file mode 100644 index 0000000000..57815744aa --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_i128 tests + let a: i128 = SHA3_256::hash_to_i128(addr_value); + let b: i128 = SHA3_256::hash_to_i128(bool_value); + let c: i128 = SHA3_256::hash_to_i128(field_value); + let d: i128 = SHA3_256::hash_to_i128(group_value); + let e: i128 = SHA3_256::hash_to_i128(i8_value); + let f: i128 = SHA3_256::hash_to_i128(i16_value); + let g: i128 = SHA3_256::hash_to_i128(i32_value); + let h: i128 = SHA3_256::hash_to_i128(i64_value); + let i: i128 = SHA3_256::hash_to_i128(i128_value); + let j: i128 = SHA3_256::hash_to_i128(u8_value); + let k: i128 = SHA3_256::hash_to_i128(u16_value); + let l: i128 = SHA3_256::hash_to_i128(u32_value); + let m: i128 = SHA3_256::hash_to_i128(u64_value); + let n: i128 = SHA3_256::hash_to_i128(u128_value); + let o: i128 = SHA3_256::hash_to_i128(scalar_value); + // let p: i128 = SHA3_256::hash_to_i128(string_value); + let q: i128 = SHA3_256::hash_to_i128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.leo new file mode 100644 index 0000000000..6dae9c57db --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_i16 tests + let a: i16 = SHA3_256::hash_to_i16(addr_value); + let b: i16 = SHA3_256::hash_to_i16(bool_value); + let c: i16 = SHA3_256::hash_to_i16(field_value); + let d: i16 = SHA3_256::hash_to_i16(group_value); + let e: i16 = SHA3_256::hash_to_i16(i8_value); + let f: i16 = SHA3_256::hash_to_i16(i16_value); + let g: i16 = SHA3_256::hash_to_i16(i32_value); + let h: i16 = SHA3_256::hash_to_i16(i64_value); + let i: i16 = SHA3_256::hash_to_i16(i128_value); + let j: i16 = SHA3_256::hash_to_i16(u8_value); + let k: i16 = SHA3_256::hash_to_i16(u16_value); + let l: i16 = SHA3_256::hash_to_i16(u32_value); + let m: i16 = SHA3_256::hash_to_i16(u64_value); + let n: i16 = SHA3_256::hash_to_i16(u128_value); + let o: i16 = SHA3_256::hash_to_i16(scalar_value); + // let p: i16 = SHA3_256::hash_to_i16(string_value); + let q: i16 = SHA3_256::hash_to_i16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.leo new file mode 100644 index 0000000000..f6e2380284 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_i32 tests + let a: i32 = SHA3_256::hash_to_i32(addr_value); + let b: i32 = SHA3_256::hash_to_i32(bool_value); + let c: i32 = SHA3_256::hash_to_i32(field_value); + let d: i32 = SHA3_256::hash_to_i32(group_value); + let e: i32 = SHA3_256::hash_to_i32(i8_value); + let f: i32 = SHA3_256::hash_to_i32(i16_value); + let g: i32 = SHA3_256::hash_to_i32(i32_value); + let h: i32 = SHA3_256::hash_to_i32(i64_value); + let i: i32 = SHA3_256::hash_to_i32(i128_value); + let j: i32 = SHA3_256::hash_to_i32(u8_value); + let k: i32 = SHA3_256::hash_to_i32(u16_value); + let l: i32 = SHA3_256::hash_to_i32(u32_value); + let m: i32 = SHA3_256::hash_to_i32(u64_value); + let n: i32 = SHA3_256::hash_to_i32(u128_value); + let o: i32 = SHA3_256::hash_to_i32(scalar_value); + // let p: i32 = SHA3_256::hash_to_i32(string_value); + let q: i32 = SHA3_256::hash_to_i32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.leo new file mode 100644 index 0000000000..1f642fcb7c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_i64 tests + let a: i64 = SHA3_256::hash_to_i64(addr_value); + let b: i64 = SHA3_256::hash_to_i64(bool_value); + let c: i64 = SHA3_256::hash_to_i64(field_value); + let d: i64 = SHA3_256::hash_to_i64(group_value); + let e: i64 = SHA3_256::hash_to_i64(i8_value); + let f: i64 = SHA3_256::hash_to_i64(i16_value); + let g: i64 = SHA3_256::hash_to_i64(i32_value); + let h: i64 = SHA3_256::hash_to_i64(i64_value); + let i: i64 = SHA3_256::hash_to_i64(i128_value); + let j: i64 = SHA3_256::hash_to_i64(u8_value); + let k: i64 = SHA3_256::hash_to_i64(u16_value); + let l: i64 = SHA3_256::hash_to_i64(u32_value); + let m: i64 = SHA3_256::hash_to_i64(u64_value); + let n: i64 = SHA3_256::hash_to_i64(u128_value); + let o: i64 = SHA3_256::hash_to_i64(scalar_value); + // let p: i64 = SHA3_256::hash_to_i64(string_value); + let q: i64 = SHA3_256::hash_to_i64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.leo new file mode 100644 index 0000000000..f80db8b397 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_i8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_i8 tests + let a: i8 = SHA3_256::hash_to_i8(addr_value); + let b: i8 = SHA3_256::hash_to_i8(bool_value); + let c: i8 = SHA3_256::hash_to_i8(field_value); + let d: i8 = SHA3_256::hash_to_i8(group_value); + let e: i8 = SHA3_256::hash_to_i8(i8_value); + let f: i8 = SHA3_256::hash_to_i8(i16_value); + let g: i8 = SHA3_256::hash_to_i8(i32_value); + let h: i8 = SHA3_256::hash_to_i8(i64_value); + let i: i8 = SHA3_256::hash_to_i8(i128_value); + let j: i8 = SHA3_256::hash_to_i8(u8_value); + let k: i8 = SHA3_256::hash_to_i8(u16_value); + let l: i8 = SHA3_256::hash_to_i8(u32_value); + let m: i8 = SHA3_256::hash_to_i8(u64_value); + let n: i8 = SHA3_256::hash_to_i8(u128_value); + let o: i8 = SHA3_256::hash_to_i8(scalar_value); + // let p: i8 = SHA3_256::hash_to_i8(string_value); + let q: i8 = SHA3_256::hash_to_i8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.leo new file mode 100644 index 0000000000..65ec73cee5 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_u128 tests + let a: u128 = SHA3_256::hash_to_u128(addr_value); + let b: u128 = SHA3_256::hash_to_u128(bool_value); + let c: u128 = SHA3_256::hash_to_u128(field_value); + let d: u128 = SHA3_256::hash_to_u128(group_value); + let e: u128 = SHA3_256::hash_to_u128(i8_value); + let f: u128 = SHA3_256::hash_to_u128(i16_value); + let g: u128 = SHA3_256::hash_to_u128(i32_value); + let h: u128 = SHA3_256::hash_to_u128(i64_value); + let i: u128 = SHA3_256::hash_to_u128(i128_value); + let j: u128 = SHA3_256::hash_to_u128(u8_value); + let k: u128 = SHA3_256::hash_to_u128(u16_value); + let l: u128 = SHA3_256::hash_to_u128(u32_value); + let m: u128 = SHA3_256::hash_to_u128(u64_value); + let n: u128 = SHA3_256::hash_to_u128(u128_value); + let o: u128 = SHA3_256::hash_to_u128(scalar_value); + // let p: u128 = SHA3_256::hash_to_u128(string_value); + let q: u128 = SHA3_256::hash_to_u128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.leo new file mode 100644 index 0000000000..33ed79d4c4 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_u16 tests + let a: u16 = SHA3_256::hash_to_u16(addr_value); + let b: u16 = SHA3_256::hash_to_u16(bool_value); + let c: u16 = SHA3_256::hash_to_u16(field_value); + let d: u16 = SHA3_256::hash_to_u16(group_value); + let e: u16 = SHA3_256::hash_to_u16(i8_value); + let f: u16 = SHA3_256::hash_to_u16(i16_value); + let g: u16 = SHA3_256::hash_to_u16(i32_value); + let h: u16 = SHA3_256::hash_to_u16(i64_value); + let i: u16 = SHA3_256::hash_to_u16(i128_value); + let j: u16 = SHA3_256::hash_to_u16(u8_value); + let k: u16 = SHA3_256::hash_to_u16(u16_value); + let l: u16 = SHA3_256::hash_to_u16(u32_value); + let m: u16 = SHA3_256::hash_to_u16(u64_value); + let n: u16 = SHA3_256::hash_to_u16(u128_value); + let o: u16 = SHA3_256::hash_to_u16(scalar_value); + // let p: u16 = SHA3_256::hash_to_u16(string_value); + let q: u16 = SHA3_256::hash_to_u16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.leo new file mode 100644 index 0000000000..85ed0736b6 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_u32 tests + let a: u32 = SHA3_256::hash_to_u32(addr_value); + let b: u32 = SHA3_256::hash_to_u32(bool_value); + let c: u32 = SHA3_256::hash_to_u32(field_value); + let d: u32 = SHA3_256::hash_to_u32(group_value); + let e: u32 = SHA3_256::hash_to_u32(i8_value); + let f: u32 = SHA3_256::hash_to_u32(i16_value); + let g: u32 = SHA3_256::hash_to_u32(i32_value); + let h: u32 = SHA3_256::hash_to_u32(i64_value); + let i: u32 = SHA3_256::hash_to_u32(i128_value); + let j: u32 = SHA3_256::hash_to_u32(u8_value); + let k: u32 = SHA3_256::hash_to_u32(u16_value); + let l: u32 = SHA3_256::hash_to_u32(u32_value); + let m: u32 = SHA3_256::hash_to_u32(u64_value); + let n: u32 = SHA3_256::hash_to_u32(u128_value); + let o: u32 = SHA3_256::hash_to_u32(scalar_value); + // let p: u32 = SHA3_256::hash_to_u32(string_value); + let q: u32 = SHA3_256::hash_to_u32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.leo new file mode 100644 index 0000000000..159df152b4 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_u64 tests + let a: u64 = SHA3_256::hash_to_u64(addr_value); + let b: u64 = SHA3_256::hash_to_u64(bool_value); + let c: u64 = SHA3_256::hash_to_u64(field_value); + let d: u64 = SHA3_256::hash_to_u64(group_value); + let e: u64 = SHA3_256::hash_to_u64(i8_value); + let f: u64 = SHA3_256::hash_to_u64(i16_value); + let g: u64 = SHA3_256::hash_to_u64(i32_value); + let h: u64 = SHA3_256::hash_to_u64(i64_value); + let i: u64 = SHA3_256::hash_to_u64(i128_value); + let j: u64 = SHA3_256::hash_to_u64(u8_value); + let k: u64 = SHA3_256::hash_to_u64(u16_value); + let l: u64 = SHA3_256::hash_to_u64(u32_value); + let m: u64 = SHA3_256::hash_to_u64(u64_value); + let n: u64 = SHA3_256::hash_to_u64(u128_value); + let o: u64 = SHA3_256::hash_to_u64(scalar_value); + // let p: u64 = SHA3_256::hash_to_u64(string_value); + let q: u64 = SHA3_256::hash_to_u64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.leo b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.leo new file mode 100644 index 0000000000..f1a66d0b2a --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_256/sha3_256_hash_to_u8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_u8 tests + let a: u8 = SHA3_256::hash_to_u8(addr_value); + let b: u8 = SHA3_256::hash_to_u8(bool_value); + let c: u8 = SHA3_256::hash_to_u8(field_value); + let d: u8 = SHA3_256::hash_to_u8(group_value); + let e: u8 = SHA3_256::hash_to_u8(i8_value); + let f: u8 = SHA3_256::hash_to_u8(i16_value); + let g: u8 = SHA3_256::hash_to_u8(i32_value); + let h: u8 = SHA3_256::hash_to_u8(i64_value); + let i: u8 = SHA3_256::hash_to_u8(i128_value); + let j: u8 = SHA3_256::hash_to_u8(u8_value); + let k: u8 = SHA3_256::hash_to_u8(u16_value); + let l: u8 = SHA3_256::hash_to_u8(u32_value); + let m: u8 = SHA3_256::hash_to_u8(u64_value); + let n: u8 = SHA3_256::hash_to_u8(u128_value); + let o: u8 = SHA3_256::hash_to_u8(scalar_value); + // let p: u8 = SHA3_256::hash_to_u8(string_value); + let q: u8 = SHA3_256::hash_to_u8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.leo new file mode 100644 index 0000000000..7ad2d494e1 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_i128 tests + let a: i128 = SHA3_384::hash_to_i128(addr_value); + let b: i128 = SHA3_384::hash_to_i128(bool_value); + let c: i128 = SHA3_384::hash_to_i128(field_value); + let d: i128 = SHA3_384::hash_to_i128(group_value); + let e: i128 = SHA3_384::hash_to_i128(i8_value); + let f: i128 = SHA3_384::hash_to_i128(i16_value); + let g: i128 = SHA3_384::hash_to_i128(i32_value); + let h: i128 = SHA3_384::hash_to_i128(i64_value); + let i: i128 = SHA3_384::hash_to_i128(i128_value); + let j: i128 = SHA3_384::hash_to_i128(u8_value); + let k: i128 = SHA3_384::hash_to_i128(u16_value); + let l: i128 = SHA3_384::hash_to_i128(u32_value); + let m: i128 = SHA3_384::hash_to_i128(u64_value); + let n: i128 = SHA3_384::hash_to_i128(u128_value); + let o: i128 = SHA3_384::hash_to_i128(scalar_value); + // let p: i128 = SHA3_384::hash_to_i128(string_value); + let q: i128 = SHA3_384::hash_to_i128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.leo new file mode 100644 index 0000000000..bc609c6e37 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_i16 tests + let a: i16 = SHA3_384::hash_to_i16(addr_value); + let b: i16 = SHA3_384::hash_to_i16(bool_value); + let c: i16 = SHA3_384::hash_to_i16(field_value); + let d: i16 = SHA3_384::hash_to_i16(group_value); + let e: i16 = SHA3_384::hash_to_i16(i8_value); + let f: i16 = SHA3_384::hash_to_i16(i16_value); + let g: i16 = SHA3_384::hash_to_i16(i32_value); + let h: i16 = SHA3_384::hash_to_i16(i64_value); + let i: i16 = SHA3_384::hash_to_i16(i128_value); + let j: i16 = SHA3_384::hash_to_i16(u8_value); + let k: i16 = SHA3_384::hash_to_i16(u16_value); + let l: i16 = SHA3_384::hash_to_i16(u32_value); + let m: i16 = SHA3_384::hash_to_i16(u64_value); + let n: i16 = SHA3_384::hash_to_i16(u128_value); + let o: i16 = SHA3_384::hash_to_i16(scalar_value); + // let p: i16 = SHA3_384::hash_to_i16(string_value); + let q: i16 = SHA3_384::hash_to_i16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.leo new file mode 100644 index 0000000000..dd73b1771b --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_i32 tests + let a: i32 = SHA3_384::hash_to_i32(addr_value); + let b: i32 = SHA3_384::hash_to_i32(bool_value); + let c: i32 = SHA3_384::hash_to_i32(field_value); + let d: i32 = SHA3_384::hash_to_i32(group_value); + let e: i32 = SHA3_384::hash_to_i32(i8_value); + let f: i32 = SHA3_384::hash_to_i32(i16_value); + let g: i32 = SHA3_384::hash_to_i32(i32_value); + let h: i32 = SHA3_384::hash_to_i32(i64_value); + let i: i32 = SHA3_384::hash_to_i32(i128_value); + let j: i32 = SHA3_384::hash_to_i32(u8_value); + let k: i32 = SHA3_384::hash_to_i32(u16_value); + let l: i32 = SHA3_384::hash_to_i32(u32_value); + let m: i32 = SHA3_384::hash_to_i32(u64_value); + let n: i32 = SHA3_384::hash_to_i32(u128_value); + let o: i32 = SHA3_384::hash_to_i32(scalar_value); + // let p: i32 = SHA3_384::hash_to_i32(string_value); + let q: i32 = SHA3_384::hash_to_i32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.leo new file mode 100644 index 0000000000..f0fc24a143 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_i64 tests + let a: i64 = SHA3_384::hash_to_i64(addr_value); + let b: i64 = SHA3_384::hash_to_i64(bool_value); + let c: i64 = SHA3_384::hash_to_i64(field_value); + let d: i64 = SHA3_384::hash_to_i64(group_value); + let e: i64 = SHA3_384::hash_to_i64(i8_value); + let f: i64 = SHA3_384::hash_to_i64(i16_value); + let g: i64 = SHA3_384::hash_to_i64(i32_value); + let h: i64 = SHA3_384::hash_to_i64(i64_value); + let i: i64 = SHA3_384::hash_to_i64(i128_value); + let j: i64 = SHA3_384::hash_to_i64(u8_value); + let k: i64 = SHA3_384::hash_to_i64(u16_value); + let l: i64 = SHA3_384::hash_to_i64(u32_value); + let m: i64 = SHA3_384::hash_to_i64(u64_value); + let n: i64 = SHA3_384::hash_to_i64(u128_value); + let o: i64 = SHA3_384::hash_to_i64(scalar_value); + // let p: i64 = SHA3_384::hash_to_i64(string_value); + let q: i64 = SHA3_384::hash_to_i64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.leo new file mode 100644 index 0000000000..1186b02594 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_i8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_i8 tests + let a: i8 = SHA3_384::hash_to_i8(addr_value); + let b: i8 = SHA3_384::hash_to_i8(bool_value); + let c: i8 = SHA3_384::hash_to_i8(field_value); + let d: i8 = SHA3_384::hash_to_i8(group_value); + let e: i8 = SHA3_384::hash_to_i8(i8_value); + let f: i8 = SHA3_384::hash_to_i8(i16_value); + let g: i8 = SHA3_384::hash_to_i8(i32_value); + let h: i8 = SHA3_384::hash_to_i8(i64_value); + let i: i8 = SHA3_384::hash_to_i8(i128_value); + let j: i8 = SHA3_384::hash_to_i8(u8_value); + let k: i8 = SHA3_384::hash_to_i8(u16_value); + let l: i8 = SHA3_384::hash_to_i8(u32_value); + let m: i8 = SHA3_384::hash_to_i8(u64_value); + let n: i8 = SHA3_384::hash_to_i8(u128_value); + let o: i8 = SHA3_384::hash_to_i8(scalar_value); + // let p: i8 = SHA3_384::hash_to_i8(string_value); + let q: i8 = SHA3_384::hash_to_i8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.leo new file mode 100644 index 0000000000..d3b03ab88a --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_u128 tests + let a: u128 = SHA3_384::hash_to_u128(addr_value); + let b: u128 = SHA3_384::hash_to_u128(bool_value); + let c: u128 = SHA3_384::hash_to_u128(field_value); + let d: u128 = SHA3_384::hash_to_u128(group_value); + let e: u128 = SHA3_384::hash_to_u128(i8_value); + let f: u128 = SHA3_384::hash_to_u128(i16_value); + let g: u128 = SHA3_384::hash_to_u128(i32_value); + let h: u128 = SHA3_384::hash_to_u128(i64_value); + let i: u128 = SHA3_384::hash_to_u128(i128_value); + let j: u128 = SHA3_384::hash_to_u128(u8_value); + let k: u128 = SHA3_384::hash_to_u128(u16_value); + let l: u128 = SHA3_384::hash_to_u128(u32_value); + let m: u128 = SHA3_384::hash_to_u128(u64_value); + let n: u128 = SHA3_384::hash_to_u128(u128_value); + let o: u128 = SHA3_384::hash_to_u128(scalar_value); + // let p: u128 = SHA3_384::hash_to_u128(string_value); + let q: u128 = SHA3_384::hash_to_u128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.leo new file mode 100644 index 0000000000..d45df86f0d --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_u16 tests + let a: u16 = SHA3_384::hash_to_u16(addr_value); + let b: u16 = SHA3_384::hash_to_u16(bool_value); + let c: u16 = SHA3_384::hash_to_u16(field_value); + let d: u16 = SHA3_384::hash_to_u16(group_value); + let e: u16 = SHA3_384::hash_to_u16(i8_value); + let f: u16 = SHA3_384::hash_to_u16(i16_value); + let g: u16 = SHA3_384::hash_to_u16(i32_value); + let h: u16 = SHA3_384::hash_to_u16(i64_value); + let i: u16 = SHA3_384::hash_to_u16(i128_value); + let j: u16 = SHA3_384::hash_to_u16(u8_value); + let k: u16 = SHA3_384::hash_to_u16(u16_value); + let l: u16 = SHA3_384::hash_to_u16(u32_value); + let m: u16 = SHA3_384::hash_to_u16(u64_value); + let n: u16 = SHA3_384::hash_to_u16(u128_value); + let o: u16 = SHA3_384::hash_to_u16(scalar_value); + // let p: u16 = SHA3_384::hash_to_u16(string_value); + let q: u16 = SHA3_384::hash_to_u16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.leo new file mode 100644 index 0000000000..6d11166106 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_u32 tests + let a: u32 = SHA3_384::hash_to_u32(addr_value); + let b: u32 = SHA3_384::hash_to_u32(bool_value); + let c: u32 = SHA3_384::hash_to_u32(field_value); + let d: u32 = SHA3_384::hash_to_u32(group_value); + let e: u32 = SHA3_384::hash_to_u32(i8_value); + let f: u32 = SHA3_384::hash_to_u32(i16_value); + let g: u32 = SHA3_384::hash_to_u32(i32_value); + let h: u32 = SHA3_384::hash_to_u32(i64_value); + let i: u32 = SHA3_384::hash_to_u32(i128_value); + let j: u32 = SHA3_384::hash_to_u32(u8_value); + let k: u32 = SHA3_384::hash_to_u32(u16_value); + let l: u32 = SHA3_384::hash_to_u32(u32_value); + let m: u32 = SHA3_384::hash_to_u32(u64_value); + let n: u32 = SHA3_384::hash_to_u32(u128_value); + let o: u32 = SHA3_384::hash_to_u32(scalar_value); + // let p: u32 = SHA3_384::hash_to_u32(string_value); + let q: u32 = SHA3_384::hash_to_u32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.leo new file mode 100644 index 0000000000..c6dac38671 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_u64 tests + let a: u64 = SHA3_384::hash_to_u64(addr_value); + let b: u64 = SHA3_384::hash_to_u64(bool_value); + let c: u64 = SHA3_384::hash_to_u64(field_value); + let d: u64 = SHA3_384::hash_to_u64(group_value); + let e: u64 = SHA3_384::hash_to_u64(i8_value); + let f: u64 = SHA3_384::hash_to_u64(i16_value); + let g: u64 = SHA3_384::hash_to_u64(i32_value); + let h: u64 = SHA3_384::hash_to_u64(i64_value); + let i: u64 = SHA3_384::hash_to_u64(i128_value); + let j: u64 = SHA3_384::hash_to_u64(u8_value); + let k: u64 = SHA3_384::hash_to_u64(u16_value); + let l: u64 = SHA3_384::hash_to_u64(u32_value); + let m: u64 = SHA3_384::hash_to_u64(u64_value); + let n: u64 = SHA3_384::hash_to_u64(u128_value); + let o: u64 = SHA3_384::hash_to_u64(scalar_value); + // let p: u64 = SHA3_384::hash_to_u64(string_value); + let q: u64 = SHA3_384::hash_to_u64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.leo b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.leo new file mode 100644 index 0000000000..b90441ed53 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_384/sha3_384_hash_to_u8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_u8 tests + let a: u8 = SHA3_384::hash_to_u8(addr_value); + let b: u8 = SHA3_384::hash_to_u8(bool_value); + let c: u8 = SHA3_384::hash_to_u8(field_value); + let d: u8 = SHA3_384::hash_to_u8(group_value); + let e: u8 = SHA3_384::hash_to_u8(i8_value); + let f: u8 = SHA3_384::hash_to_u8(i16_value); + let g: u8 = SHA3_384::hash_to_u8(i32_value); + let h: u8 = SHA3_384::hash_to_u8(i64_value); + let i: u8 = SHA3_384::hash_to_u8(i128_value); + let j: u8 = SHA3_384::hash_to_u8(u8_value); + let k: u8 = SHA3_384::hash_to_u8(u16_value); + let l: u8 = SHA3_384::hash_to_u8(u32_value); + let m: u8 = SHA3_384::hash_to_u8(u64_value); + let n: u8 = SHA3_384::hash_to_u8(u128_value); + let o: u8 = SHA3_384::hash_to_u8(scalar_value); + // let p: u8 = SHA3_384::hash_to_u8(string_value); + let q: u8 = SHA3_384::hash_to_u8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.leo new file mode 100644 index 0000000000..4451b1602b --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_i128 tests + let a: i128 = SHA3_512::hash_to_i128(addr_value); + let b: i128 = SHA3_512::hash_to_i128(bool_value); + let c: i128 = SHA3_512::hash_to_i128(field_value); + let d: i128 = SHA3_512::hash_to_i128(group_value); + let e: i128 = SHA3_512::hash_to_i128(i8_value); + let f: i128 = SHA3_512::hash_to_i128(i16_value); + let g: i128 = SHA3_512::hash_to_i128(i32_value); + let h: i128 = SHA3_512::hash_to_i128(i64_value); + let i: i128 = SHA3_512::hash_to_i128(i128_value); + let j: i128 = SHA3_512::hash_to_i128(u8_value); + let k: i128 = SHA3_512::hash_to_i128(u16_value); + let l: i128 = SHA3_512::hash_to_i128(u32_value); + let m: i128 = SHA3_512::hash_to_i128(u64_value); + let n: i128 = SHA3_512::hash_to_i128(u128_value); + let o: i128 = SHA3_512::hash_to_i128(scalar_value); + // let p: i128 = SHA3_512::hash_to_i128(string_value); + let q: i128 = SHA3_512::hash_to_i128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.leo new file mode 100644 index 0000000000..8e1523cdd7 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_i16 tests + let a: i16 = SHA3_512::hash_to_i16(addr_value); + let b: i16 = SHA3_512::hash_to_i16(bool_value); + let c: i16 = SHA3_512::hash_to_i16(field_value); + let d: i16 = SHA3_512::hash_to_i16(group_value); + let e: i16 = SHA3_512::hash_to_i16(i8_value); + let f: i16 = SHA3_512::hash_to_i16(i16_value); + let g: i16 = SHA3_512::hash_to_i16(i32_value); + let h: i16 = SHA3_512::hash_to_i16(i64_value); + let i: i16 = SHA3_512::hash_to_i16(i128_value); + let j: i16 = SHA3_512::hash_to_i16(u8_value); + let k: i16 = SHA3_512::hash_to_i16(u16_value); + let l: i16 = SHA3_512::hash_to_i16(u32_value); + let m: i16 = SHA3_512::hash_to_i16(u64_value); + let n: i16 = SHA3_512::hash_to_i16(u128_value); + let o: i16 = SHA3_512::hash_to_i16(scalar_value); + // let p: i16 = SHA3_512::hash_to_i16(string_value); + let q: i16 = SHA3_512::hash_to_i16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.leo new file mode 100644 index 0000000000..6196d8534e --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_i32 tests + let a: i32 = SHA3_512::hash_to_i32(addr_value); + let b: i32 = SHA3_512::hash_to_i32(bool_value); + let c: i32 = SHA3_512::hash_to_i32(field_value); + let d: i32 = SHA3_512::hash_to_i32(group_value); + let e: i32 = SHA3_512::hash_to_i32(i8_value); + let f: i32 = SHA3_512::hash_to_i32(i16_value); + let g: i32 = SHA3_512::hash_to_i32(i32_value); + let h: i32 = SHA3_512::hash_to_i32(i64_value); + let i: i32 = SHA3_512::hash_to_i32(i128_value); + let j: i32 = SHA3_512::hash_to_i32(u8_value); + let k: i32 = SHA3_512::hash_to_i32(u16_value); + let l: i32 = SHA3_512::hash_to_i32(u32_value); + let m: i32 = SHA3_512::hash_to_i32(u64_value); + let n: i32 = SHA3_512::hash_to_i32(u128_value); + let o: i32 = SHA3_512::hash_to_i32(scalar_value); + // let p: i32 = SHA3_512::hash_to_i32(string_value); + let q: i32 = SHA3_512::hash_to_i32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.leo new file mode 100644 index 0000000000..cc8484a87c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_i64 tests + let a: i64 = SHA3_512::hash_to_i64(addr_value); + let b: i64 = SHA3_512::hash_to_i64(bool_value); + let c: i64 = SHA3_512::hash_to_i64(field_value); + let d: i64 = SHA3_512::hash_to_i64(group_value); + let e: i64 = SHA3_512::hash_to_i64(i8_value); + let f: i64 = SHA3_512::hash_to_i64(i16_value); + let g: i64 = SHA3_512::hash_to_i64(i32_value); + let h: i64 = SHA3_512::hash_to_i64(i64_value); + let i: i64 = SHA3_512::hash_to_i64(i128_value); + let j: i64 = SHA3_512::hash_to_i64(u8_value); + let k: i64 = SHA3_512::hash_to_i64(u16_value); + let l: i64 = SHA3_512::hash_to_i64(u32_value); + let m: i64 = SHA3_512::hash_to_i64(u64_value); + let n: i64 = SHA3_512::hash_to_i64(u128_value); + let o: i64 = SHA3_512::hash_to_i64(scalar_value); + // let p: i64 = SHA3_512::hash_to_i64(string_value); + let q: i64 = SHA3_512::hash_to_i64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.leo new file mode 100644 index 0000000000..527bfc1b25 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_i8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> i8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_i8 tests + let a: i8 = SHA3_512::hash_to_i8(addr_value); + let b: i8 = SHA3_512::hash_to_i8(bool_value); + let c: i8 = SHA3_512::hash_to_i8(field_value); + let d: i8 = SHA3_512::hash_to_i8(group_value); + let e: i8 = SHA3_512::hash_to_i8(i8_value); + let f: i8 = SHA3_512::hash_to_i8(i16_value); + let g: i8 = SHA3_512::hash_to_i8(i32_value); + let h: i8 = SHA3_512::hash_to_i8(i64_value); + let i: i8 = SHA3_512::hash_to_i8(i128_value); + let j: i8 = SHA3_512::hash_to_i8(u8_value); + let k: i8 = SHA3_512::hash_to_i8(u16_value); + let l: i8 = SHA3_512::hash_to_i8(u32_value); + let m: i8 = SHA3_512::hash_to_i8(u64_value); + let n: i8 = SHA3_512::hash_to_i8(u128_value); + let o: i8 = SHA3_512::hash_to_i8(scalar_value); + // let p: i8 = SHA3_512::hash_to_i8(string_value); + let q: i8 = SHA3_512::hash_to_i8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.leo new file mode 100644 index 0000000000..d9ad3b0600 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u128.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u128 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_u128 tests + let a: u128 = SHA3_512::hash_to_u128(addr_value); + let b: u128 = SHA3_512::hash_to_u128(bool_value); + let c: u128 = SHA3_512::hash_to_u128(field_value); + let d: u128 = SHA3_512::hash_to_u128(group_value); + let e: u128 = SHA3_512::hash_to_u128(i8_value); + let f: u128 = SHA3_512::hash_to_u128(i16_value); + let g: u128 = SHA3_512::hash_to_u128(i32_value); + let h: u128 = SHA3_512::hash_to_u128(i64_value); + let i: u128 = SHA3_512::hash_to_u128(i128_value); + let j: u128 = SHA3_512::hash_to_u128(u8_value); + let k: u128 = SHA3_512::hash_to_u128(u16_value); + let l: u128 = SHA3_512::hash_to_u128(u32_value); + let m: u128 = SHA3_512::hash_to_u128(u64_value); + let n: u128 = SHA3_512::hash_to_u128(u128_value); + let o: u128 = SHA3_512::hash_to_u128(scalar_value); + // let p: u128 = SHA3_512::hash_to_u128(string_value); + let q: u128 = SHA3_512::hash_to_u128(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.leo new file mode 100644 index 0000000000..aa2f862a49 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u16.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u16 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_u16 tests + let a: u16 = SHA3_512::hash_to_u16(addr_value); + let b: u16 = SHA3_512::hash_to_u16(bool_value); + let c: u16 = SHA3_512::hash_to_u16(field_value); + let d: u16 = SHA3_512::hash_to_u16(group_value); + let e: u16 = SHA3_512::hash_to_u16(i8_value); + let f: u16 = SHA3_512::hash_to_u16(i16_value); + let g: u16 = SHA3_512::hash_to_u16(i32_value); + let h: u16 = SHA3_512::hash_to_u16(i64_value); + let i: u16 = SHA3_512::hash_to_u16(i128_value); + let j: u16 = SHA3_512::hash_to_u16(u8_value); + let k: u16 = SHA3_512::hash_to_u16(u16_value); + let l: u16 = SHA3_512::hash_to_u16(u32_value); + let m: u16 = SHA3_512::hash_to_u16(u64_value); + let n: u16 = SHA3_512::hash_to_u16(u128_value); + let o: u16 = SHA3_512::hash_to_u16(scalar_value); + // let p: u16 = SHA3_512::hash_to_u16(string_value); + let q: u16 = SHA3_512::hash_to_u16(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.leo new file mode 100644 index 0000000000..685e9cbf51 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u32.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u32 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_u32 tests + let a: u32 = SHA3_512::hash_to_u32(addr_value); + let b: u32 = SHA3_512::hash_to_u32(bool_value); + let c: u32 = SHA3_512::hash_to_u32(field_value); + let d: u32 = SHA3_512::hash_to_u32(group_value); + let e: u32 = SHA3_512::hash_to_u32(i8_value); + let f: u32 = SHA3_512::hash_to_u32(i16_value); + let g: u32 = SHA3_512::hash_to_u32(i32_value); + let h: u32 = SHA3_512::hash_to_u32(i64_value); + let i: u32 = SHA3_512::hash_to_u32(i128_value); + let j: u32 = SHA3_512::hash_to_u32(u8_value); + let k: u32 = SHA3_512::hash_to_u32(u16_value); + let l: u32 = SHA3_512::hash_to_u32(u32_value); + let m: u32 = SHA3_512::hash_to_u32(u64_value); + let n: u32 = SHA3_512::hash_to_u32(u128_value); + let o: u32 = SHA3_512::hash_to_u32(scalar_value); + // let p: u32 = SHA3_512::hash_to_u32(string_value); + let q: u32 = SHA3_512::hash_to_u32(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.leo new file mode 100644 index 0000000000..a98668db06 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u64.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u64 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_u64 tests + let a: u64 = SHA3_512::hash_to_u64(addr_value); + let b: u64 = SHA3_512::hash_to_u64(bool_value); + let c: u64 = SHA3_512::hash_to_u64(field_value); + let d: u64 = SHA3_512::hash_to_u64(group_value); + let e: u64 = SHA3_512::hash_to_u64(i8_value); + let f: u64 = SHA3_512::hash_to_u64(i16_value); + let g: u64 = SHA3_512::hash_to_u64(i32_value); + let h: u64 = SHA3_512::hash_to_u64(i64_value); + let i: u64 = SHA3_512::hash_to_u64(i128_value); + let j: u64 = SHA3_512::hash_to_u64(u8_value); + let k: u64 = SHA3_512::hash_to_u64(u16_value); + let l: u64 = SHA3_512::hash_to_u64(u32_value); + let m: u64 = SHA3_512::hash_to_u64(u64_value); + let n: u64 = SHA3_512::hash_to_u64(u128_value); + let o: u64 = SHA3_512::hash_to_u64(scalar_value); + // let p: u64 = SHA3_512::hash_to_u64(string_value); + let q: u64 = SHA3_512::hash_to_u64(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.leo b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.leo new file mode 100644 index 0000000000..de65cd6802 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/integers/sha3_512/sha3_512_hash_to_u8.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> u8 { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_u8 tests + let a: u8 = SHA3_512::hash_to_u8(addr_value); + let b: u8 = SHA3_512::hash_to_u8(bool_value); + let c: u8 = SHA3_512::hash_to_u8(field_value); + let d: u8 = SHA3_512::hash_to_u8(group_value); + let e: u8 = SHA3_512::hash_to_u8(i8_value); + let f: u8 = SHA3_512::hash_to_u8(i16_value); + let g: u8 = SHA3_512::hash_to_u8(i32_value); + let h: u8 = SHA3_512::hash_to_u8(i64_value); + let i: u8 = SHA3_512::hash_to_u8(i128_value); + let j: u8 = SHA3_512::hash_to_u8(u8_value); + let k: u8 = SHA3_512::hash_to_u8(u16_value); + let l: u8 = SHA3_512::hash_to_u8(u32_value); + let m: u8 = SHA3_512::hash_to_u8(u64_value); + let n: u8 = SHA3_512::hash_to_u8(u128_value); + let o: u8 = SHA3_512::hash_to_u8(scalar_value); + // let p: u8 = SHA3_512::hash_to_u8(string_value); + let q: u8 = SHA3_512::hash_to_u8(Foo { a: 1u128, b: 1u128 }); + + return a; + } +} diff --git a/tests/tests/compiler/core/algorithms/sha3_256_hash_to_address.leo b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_address.leo new file mode 100644 index 0000000000..a3dd846494 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_address.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_address tests + let a: address = SHA3_256::hash_to_address(addr_value); + let b: address = SHA3_256::hash_to_address(bool_value); + let c: address = SHA3_256::hash_to_address(field_value); + let d: address = SHA3_256::hash_to_address(group_value); + let e: address = SHA3_256::hash_to_address(i8_value); + let f: address = SHA3_256::hash_to_address(i16_value); + let g: address = SHA3_256::hash_to_address(i32_value); + let h: address = SHA3_256::hash_to_address(i64_value); + let i: address = SHA3_256::hash_to_address(i128_value); + let j: address = SHA3_256::hash_to_address(u8_value); + let k: address = SHA3_256::hash_to_address(u16_value); + let l: address = SHA3_256::hash_to_address(u32_value); + let m: address = SHA3_256::hash_to_address(u64_value); + let n: address = SHA3_256::hash_to_address(u128_value); + let o: address = SHA3_256::hash_to_address(scalar_value); + // let p: address = SHA3_256::hash_to_address(string_value); + let q: address = SHA3_256::hash_to_address(Foo { a: 1u128, b: 1u128 }); + + return field_value; + } +} diff --git a/tests/tests/compiler/core/algorithms/sha3_256_hash_to_field.leo b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_field.leo new file mode 100644 index 0000000000..d165218c6c --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_field.leo @@ -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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_field tests + let a: field = SHA3_256::hash_to_field(addr_value); + let b: field = SHA3_256::hash_to_field(bool_value); + let c: field = SHA3_256::hash_to_field(field_value); + let d: field = SHA3_256::hash_to_field(group_value); + let e: field = SHA3_256::hash_to_field(i8_value); + let f: field = SHA3_256::hash_to_field(i16_value); + let g: field = SHA3_256::hash_to_field(i32_value); + let h: field = SHA3_256::hash_to_field(i64_value); + let i: field = SHA3_256::hash_to_field(i128_value); + let j: field = SHA3_256::hash_to_field(u8_value); + let k: field = SHA3_256::hash_to_field(u16_value); + let l: field = SHA3_256::hash_to_field(u32_value); + let m: field = SHA3_256::hash_to_field(u64_value); + let n: field = SHA3_256::hash_to_field(u128_value); + let o: field = SHA3_256::hash_to_field(scalar_value); + // let p: field = SHA3_256::hash_to_field(string_value); + let q: field = SHA3_256::hash_to_field(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_256_hash_to_group.leo b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_group.leo new file mode 100644 index 0000000000..a91781e5e0 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_group.leo @@ -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 = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_group tests + let a: group = SHA3_256::hash_to_group(addr_value); + let b: group = SHA3_256::hash_to_group(bool_value); + let c: group = SHA3_256::hash_to_group(field_value); + let d: group = SHA3_256::hash_to_group(group_value); + let e: group = SHA3_256::hash_to_group(i8_value); + let f: group = SHA3_256::hash_to_group(i16_value); + let g: group = SHA3_256::hash_to_group(i32_value); + let h: group = SHA3_256::hash_to_group(i64_value); + let i: group = SHA3_256::hash_to_group(i128_value); + let j: group = SHA3_256::hash_to_group(u8_value); + let k: group = SHA3_256::hash_to_group(u16_value); + let l: group = SHA3_256::hash_to_group(u32_value); + let m: group = SHA3_256::hash_to_group(u64_value); + let n: group = SHA3_256::hash_to_group(u128_value); + let o: group = SHA3_256::hash_to_group(scalar_value); + // let p: group = SHA3_256::hash_to_group(string_value); + let q: group = SHA3_256::hash_to_group(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_256_hash_to_scalar.leo b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_scalar.leo new file mode 100644 index 0000000000..78038ada78 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_256_hash_to_scalar.leo @@ -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, + ) -> scalar { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_256 hash_to_scalar tests + let a: scalar = SHA3_256::hash_to_scalar(addr_value); + let b: scalar = SHA3_256::hash_to_scalar(bool_value); + let c: scalar = SHA3_256::hash_to_scalar(field_value); + let d: scalar = SHA3_256::hash_to_scalar(group_value); + let e: scalar = SHA3_256::hash_to_scalar(i8_value); + let f: scalar = SHA3_256::hash_to_scalar(i16_value); + let g: scalar = SHA3_256::hash_to_scalar(i32_value); + let h: scalar = SHA3_256::hash_to_scalar(i64_value); + let i: scalar = SHA3_256::hash_to_scalar(i128_value); + let j: scalar = SHA3_256::hash_to_scalar(u8_value); + let k: scalar = SHA3_256::hash_to_scalar(u16_value); + let l: scalar = SHA3_256::hash_to_scalar(u32_value); + let m: scalar = SHA3_256::hash_to_scalar(u64_value); + let n: scalar = SHA3_256::hash_to_scalar(u128_value); + let o: scalar = SHA3_256::hash_to_scalar(scalar_value); + // let p: scalar = SHA3_256::hash_to_scalar(string_value); + let q: scalar = SHA3_256::hash_to_scalar(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_384_hash_to_address.leo b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_address.leo new file mode 100644 index 0000000000..d7716aa77f --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_address.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_address tests + let a: address = SHA3_384::hash_to_address(addr_value); + let b: address = SHA3_384::hash_to_address(bool_value); + let c: address = SHA3_384::hash_to_address(field_value); + let d: address = SHA3_384::hash_to_address(group_value); + let e: address = SHA3_384::hash_to_address(i8_value); + let f: address = SHA3_384::hash_to_address(i16_value); + let g: address = SHA3_384::hash_to_address(i32_value); + let h: address = SHA3_384::hash_to_address(i64_value); + let i: address = SHA3_384::hash_to_address(i128_value); + let j: address = SHA3_384::hash_to_address(u8_value); + let k: address = SHA3_384::hash_to_address(u16_value); + let l: address = SHA3_384::hash_to_address(u32_value); + let m: address = SHA3_384::hash_to_address(u64_value); + let n: address = SHA3_384::hash_to_address(u128_value); + let o: address = SHA3_384::hash_to_address(scalar_value); + // let p: address = SHA3_384::hash_to_address(string_value); + let q: address = SHA3_384::hash_to_address(Foo { a: 1u128, b: 1u128 }); + + return field_value; + } +} diff --git a/tests/tests/compiler/core/algorithms/sha3_384_hash_to_field.leo b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_field.leo new file mode 100644 index 0000000000..5c49f8ec01 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_field.leo @@ -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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_field tests + let a: field = SHA3_384::hash_to_field(addr_value); + let b: field = SHA3_384::hash_to_field(bool_value); + let c: field = SHA3_384::hash_to_field(field_value); + let d: field = SHA3_384::hash_to_field(group_value); + let e: field = SHA3_384::hash_to_field(i8_value); + let f: field = SHA3_384::hash_to_field(i16_value); + let g: field = SHA3_384::hash_to_field(i32_value); + let h: field = SHA3_384::hash_to_field(i64_value); + let i: field = SHA3_384::hash_to_field(i128_value); + let j: field = SHA3_384::hash_to_field(u8_value); + let k: field = SHA3_384::hash_to_field(u16_value); + let l: field = SHA3_384::hash_to_field(u32_value); + let m: field = SHA3_384::hash_to_field(u64_value); + let n: field = SHA3_384::hash_to_field(u128_value); + let o: field = SHA3_384::hash_to_field(scalar_value); + // let p: field = SHA3_384::hash_to_field(string_value); + let q: field = SHA3_384::hash_to_field(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_384_hash_to_group.leo b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_group.leo new file mode 100644 index 0000000000..3b174dd970 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_group.leo @@ -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 = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_group tests + let a: group = SHA3_384::hash_to_group(addr_value); + let b: group = SHA3_384::hash_to_group(bool_value); + let c: group = SHA3_384::hash_to_group(field_value); + let d: group = SHA3_384::hash_to_group(group_value); + let e: group = SHA3_384::hash_to_group(i8_value); + let f: group = SHA3_384::hash_to_group(i16_value); + let g: group = SHA3_384::hash_to_group(i32_value); + let h: group = SHA3_384::hash_to_group(i64_value); + let i: group = SHA3_384::hash_to_group(i128_value); + let j: group = SHA3_384::hash_to_group(u8_value); + let k: group = SHA3_384::hash_to_group(u16_value); + let l: group = SHA3_384::hash_to_group(u32_value); + let m: group = SHA3_384::hash_to_group(u64_value); + let n: group = SHA3_384::hash_to_group(u128_value); + let o: group = SHA3_384::hash_to_group(scalar_value); + // let p: group = SHA3_384::hash_to_group(string_value); + let q: group = SHA3_384::hash_to_group(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_384_hash_to_scalar.leo b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_scalar.leo new file mode 100644 index 0000000000..c45b9a22c8 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_384_hash_to_scalar.leo @@ -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, + ) -> scalar { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_384 hash_to_scalar tests + let a: scalar = SHA3_384::hash_to_scalar(addr_value); + let b: scalar = SHA3_384::hash_to_scalar(bool_value); + let c: scalar = SHA3_384::hash_to_scalar(field_value); + let d: scalar = SHA3_384::hash_to_scalar(group_value); + let e: scalar = SHA3_384::hash_to_scalar(i8_value); + let f: scalar = SHA3_384::hash_to_scalar(i16_value); + let g: scalar = SHA3_384::hash_to_scalar(i32_value); + let h: scalar = SHA3_384::hash_to_scalar(i64_value); + let i: scalar = SHA3_384::hash_to_scalar(i128_value); + let j: scalar = SHA3_384::hash_to_scalar(u8_value); + let k: scalar = SHA3_384::hash_to_scalar(u16_value); + let l: scalar = SHA3_384::hash_to_scalar(u32_value); + let m: scalar = SHA3_384::hash_to_scalar(u64_value); + let n: scalar = SHA3_384::hash_to_scalar(u128_value); + let o: scalar = SHA3_384::hash_to_scalar(scalar_value); + // let p: scalar = SHA3_384::hash_to_scalar(string_value); + let q: scalar = SHA3_384::hash_to_scalar(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_512_hash_to_address.leo b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_address.leo new file mode 100644 index 0000000000..6c466b9f32 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_address.leo @@ -0,0 +1,52 @@ +/* +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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_address tests + let a: address = SHA3_512::hash_to_address(addr_value); + let b: address = SHA3_512::hash_to_address(bool_value); + let c: address = SHA3_512::hash_to_address(field_value); + let d: address = SHA3_512::hash_to_address(group_value); + let e: address = SHA3_512::hash_to_address(i8_value); + let f: address = SHA3_512::hash_to_address(i16_value); + let g: address = SHA3_512::hash_to_address(i32_value); + let h: address = SHA3_512::hash_to_address(i64_value); + let i: address = SHA3_512::hash_to_address(i128_value); + let j: address = SHA3_512::hash_to_address(u8_value); + let k: address = SHA3_512::hash_to_address(u16_value); + let l: address = SHA3_512::hash_to_address(u32_value); + let m: address = SHA3_512::hash_to_address(u64_value); + let n: address = SHA3_512::hash_to_address(u128_value); + let o: address = SHA3_512::hash_to_address(scalar_value); + // let p: address = SHA3_512::hash_to_address(string_value); + let q: address = SHA3_512::hash_to_address(Foo { a: 1u128, b: 1u128 }); + + return field_value; + } +} diff --git a/tests/tests/compiler/core/algorithms/sha3_512_hash_to_field.leo b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_field.leo new file mode 100644 index 0000000000..873661b315 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_field.leo @@ -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, + ) -> field { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_field tests + let a: field = SHA3_512::hash_to_field(addr_value); + let b: field = SHA3_512::hash_to_field(bool_value); + let c: field = SHA3_512::hash_to_field(field_value); + let d: field = SHA3_512::hash_to_field(group_value); + let e: field = SHA3_512::hash_to_field(i8_value); + let f: field = SHA3_512::hash_to_field(i16_value); + let g: field = SHA3_512::hash_to_field(i32_value); + let h: field = SHA3_512::hash_to_field(i64_value); + let i: field = SHA3_512::hash_to_field(i128_value); + let j: field = SHA3_512::hash_to_field(u8_value); + let k: field = SHA3_512::hash_to_field(u16_value); + let l: field = SHA3_512::hash_to_field(u32_value); + let m: field = SHA3_512::hash_to_field(u64_value); + let n: field = SHA3_512::hash_to_field(u128_value); + let o: field = SHA3_512::hash_to_field(scalar_value); + // let p: field = SHA3_512::hash_to_field(string_value); + let q: field = SHA3_512::hash_to_field(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_512_hash_to_group.leo b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_group.leo new file mode 100644 index 0000000000..93c395759f --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_group.leo @@ -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 = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_group tests + let a: group = SHA3_512::hash_to_group(addr_value); + let b: group = SHA3_512::hash_to_group(bool_value); + let c: group = SHA3_512::hash_to_group(field_value); + let d: group = SHA3_512::hash_to_group(group_value); + let e: group = SHA3_512::hash_to_group(i8_value); + let f: group = SHA3_512::hash_to_group(i16_value); + let g: group = SHA3_512::hash_to_group(i32_value); + let h: group = SHA3_512::hash_to_group(i64_value); + let i: group = SHA3_512::hash_to_group(i128_value); + let j: group = SHA3_512::hash_to_group(u8_value); + let k: group = SHA3_512::hash_to_group(u16_value); + let l: group = SHA3_512::hash_to_group(u32_value); + let m: group = SHA3_512::hash_to_group(u64_value); + let n: group = SHA3_512::hash_to_group(u128_value); + let o: group = SHA3_512::hash_to_group(scalar_value); + // let p: group = SHA3_512::hash_to_group(string_value); + let q: group = SHA3_512::hash_to_group(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }} diff --git a/tests/tests/compiler/core/algorithms/sha3_512_hash_to_scalar.leo b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_scalar.leo new file mode 100644 index 0000000000..2ac16dbd21 --- /dev/null +++ b/tests/tests/compiler/core/algorithms/sha3_512_hash_to_scalar.leo @@ -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, + ) -> scalar { + let addr_value: address = aleo10qerras5799u6k7rjtc9y3hcwxuykr45qra7x7dp6jgnc0923czqm0lgta; + let bool_value: bool = true; + let field_value: field = 1field; + let group_value: group = group::GEN; + let i128_value: i128 = 1i128; + let u128_value: u128 = 1u128; + let scalar_value: scalar = 1scalar; + // let string_value: string = "helloworld"; + + // SHA3_512 hash_to_scalar tests + let a: scalar = SHA3_512::hash_to_scalar(addr_value); + let b: scalar = SHA3_512::hash_to_scalar(bool_value); + let c: scalar = SHA3_512::hash_to_scalar(field_value); + let d: scalar = SHA3_512::hash_to_scalar(group_value); + let e: scalar = SHA3_512::hash_to_scalar(i8_value); + let f: scalar = SHA3_512::hash_to_scalar(i16_value); + let g: scalar = SHA3_512::hash_to_scalar(i32_value); + let h: scalar = SHA3_512::hash_to_scalar(i64_value); + let i: scalar = SHA3_512::hash_to_scalar(i128_value); + let j: scalar = SHA3_512::hash_to_scalar(u8_value); + let k: scalar = SHA3_512::hash_to_scalar(u16_value); + let l: scalar = SHA3_512::hash_to_scalar(u32_value); + let m: scalar = SHA3_512::hash_to_scalar(u64_value); + let n: scalar = SHA3_512::hash_to_scalar(u128_value); + let o: scalar = SHA3_512::hash_to_scalar(scalar_value); + // let p: scalar = SHA3_512::hash_to_scalar(string_value); + let q: scalar = SHA3_512::hash_to_scalar(Foo { a: 1u128, b: 1u128 }); + + return a + o; + }}