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] 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; + }}