Skip to main content

Aleo Opcodes Reference

The following lists show the standard and cryptographic opcodes supported by Aleo instructions.

Table of Standard Opcodes

NameDescription
absAbsolute value operation
abs.wWrapping absolute value operation
addAddition operation
add.wWrapping addition operation
andAND operation
assert.eqAssert equality
assert.neqAssert non-equality
branch.eqBranches to a position if the arguments are equal
branch.neqBranches to a position if the arguments are not equal
castCast between literals
cast.lossyCast between literals with lossy truncation
divDivision operation
div.wWrapping division operation
doubleDouble operation
gtGreater than comparison
gteGreater than or equal to comparison
invMultiplicative inverse operation
is.eqEquality comparison
is.neqNot equal comparison
ltLess than comparison
lteLess than or equal to comparison
modArithmetic modulo operation
mulMultiplication operation
mul.wWrapping multiplication operation
nandBoolean NAND operation
negAdditive inverse operation
norBoolean NOR operation
notNOT operation
orOR Operation
positionThe position command
powExponentiation operation
pow.wWrapping exponentiation operation
rand.chachaGenerates a random value within the finalize scope.
remRemainder operation
rem.wWrapping remainder operation
shlShift left operation
shl.wWrapping shift left operation
shrShift right operation
shr.wWrapping shift right operation
sqrtSquare root operation
squareSquare operation
subSubtraction operation
sub.wWrapping subtraction operation
ternaryTernary select operation
xorXOR operation
serialize.bitsSerialize value to bits array (Aleo variant bits)
serialize.bits.rawSerialize value to bits array (raw bits)
deserialize.bitsDeserialize from bits array to value (Aleo variant bits)
deserialize.bits.rawDeserialize from bits array to value (raw bits)

Table of Cryptographic Opcodes

NameDescription
commit.bhp256256-bit input BHP commitment
commit.bhp512512-bit input BHP commitment
commit.bhp768768-bit input BHP commitment
commit.bhp10241024-bit input BHP commitment
commit.ped6464-bit input Pedersen commitment
commit.ped128128-bit input Pedersen commitment
hash.bhp256256-bit input BHP hash
hash.bhp512512-bit input BHP hash
hash.bhp768768-bit input BHP hash
hash.bhp10241024-bit input BHP hash
hash.keccak256256-bit input Keccak hash
hash.keccak384384-bit input Keccak hash
hash.keccak512512-bit input Keccak hash
hash.ped6464-bit input Pedersen hash
hash.ped128128-bit input Pedersen hash
hash.psd2Poseidon hash with input rate 2
hash.psd4Poseidon hash with input rate 4
hash.psd8Poseidon hash with input rate 8
hash.sha3_256256-bit input SHA3 hash
hash.sha3_384384-bit input SHA3 hash
hash.sha3_512512-bit input SHA3 hash
hash.bhp256.raw256-bit input BHP hash (raw bits)
hash.bhp512.raw512-bit input BHP hash (raw bits)
hash.bhp768.raw768-bit input BHP hash (raw bits)
hash.bhp1024.raw1024-bit input BHP hash (raw bits)
hash.keccak256.raw256-bit input Keccak hash (raw bits)
hash.keccak384.raw384-bit input Keccak hash (raw bits)
hash.keccak512.raw512-bit input Keccak hash (raw bits)
hash.ped64.raw64-bit input Pedersen hash (raw bits)
hash.ped128.raw128-bit input Pedersen hash (raw bits)
hash.psd2.rawPoseidon hash with input rate 2 (raw bits)
hash.psd4.rawPoseidon hash with input rate 4 (raw bits)
hash.psd8.rawPoseidon hash with input rate 8 (raw bits)
hash.sha3_256.raw256-bit input SHA3 hash (raw bits)
hash.sha3_384.raw384-bit input SHA3 hash (raw bits)
hash.sha3_512.raw512-bit input SHA3 hash (raw bits)
hash.keccak256.native256-bit input Keccak hash (outputs bit array)
hash.keccak256.native.raw256-bit input Keccak hash (raw bits, outputs bit array)
hash.keccak384.native384-bit input Keccak hash (outputs bit array)
hash.keccak384.native.raw384-bit input Keccak hash (raw bits, outputs bit array)
hash.keccak512.native512-bit input Keccak hash (outputs bit array)
hash.keccak512.native.raw512-bit input Keccak hash (raw bits, outputs bit array)
hash.sha3_256.native256-bit input SHA3 hash (outputs bit array)
hash.sha3_256.native.raw256-bit input SHA3 hash (raw bits, outputs bit array)
hash.sha3_384.native384-bit input SHA3 hash (outputs bit array)
hash.sha3_384.native.raw384-bit input SHA3 hash (raw bits, outputs bit array)
hash.sha3_512.native512-bit input SHA3 hash (outputs bit array)
hash.sha3_512.native.raw512-bit input SHA3 hash (raw bits, outputs bit array)
sign.verifyVerify a Schnorr signature
ecdsa.verify.digestVerify an ECDSA signature with pre-computed digest
ecdsa.verify.digest.ethVerify an ECDSA signature with pre-computed digest (Ethereum 20-byte address)
ecdsa.verify.keccak256Verify an ECDSA signature with Keccak-256 (Aleo variant bits)
ecdsa.verify.keccak256.rawVerify an ECDSA signature with Keccak-256 (raw bits)
ecdsa.verify.keccak256.ethVerify an ECDSA signature with Keccak-256 (raw bits + Ethereum 20-byte address)
ecdsa.verify.keccak384Verify an ECDSA signature with Keccak-384 (Aleo variant bits)
ecdsa.verify.keccak384.rawVerify an ECDSA signature with Keccak-384 (raw bits)
ecdsa.verify.keccak384.ethVerify an ECDSA signature with Keccak-384 (raw bits + Ethereum 20-byte address)
ecdsa.verify.keccak512Verify an ECDSA signature with Keccak-512 (Aleo variant bits)
ecdsa.verify.keccak512.rawVerify an ECDSA signature with Keccak-512 (raw bits)
ecdsa.verify.keccak512.ethVerify an ECDSA signature with Keccak-512 (raw bits + Ethereum 20-byte address)
ecdsa.verify.sha3_256Verify an ECDSA signature with SHA3-256 (Aleo variant bits)
ecdsa.verify.sha3_256.rawVerify an ECDSA signature with SHA3-256 (raw bits)
ecdsa.verify.sha3_256.ethVerify an ECDSA signature with SHA3-256 (raw bits + Ethereum 20-byte address)
ecdsa.verify.sha3_384Verify an ECDSA signature with SHA3-384 (Aleo variant bits)
ecdsa.verify.sha3_384.rawVerify an ECDSA signature with SHA3-384 (raw bits)
ecdsa.verify.sha3_384.ethVerify an ECDSA signature with SHA3-384 (raw bits + Ethereum 20-byte address)
ecdsa.verify.sha3_512Verify an ECDSA signature with SHA3-512 (Aleo variant bits)
ecdsa.verify.sha3_512.rawVerify an ECDSA signature with SHA3-512 (raw bits)
ecdsa.verify.sha3_512.ethVerify an ECDSA signature with SHA3-512 (raw bits + Ethereum 20-byte address)

Specification

The following is the specification for each opcode in the Aleo Virtual Machine (AVM).

abs

Back to Top

Description

Computes the absolute value of the input, checking for overflow, storing the result in the destination register.

For integer types, a constraint is added to check for underflow. For cases where wrapping semantics are needed, see the abs.w instruction. This underflow happens when the input is the minimum value of a signed integer type. For example, abs -128i8 would result in underflow, since 128 cannot be represented as an i8.

Example Usage

abs r0 into r1;

Supported Types

InputDestination
I8I8
I16I16
I32I32
I64I64
I128I128

abs.w

Back to Top

Description

Compute the absolute value of the input, wrapping around at the boundary of the type, and storing the result in the destination register.

Example Usage

abs.w r0 into r1;

Supported Types

InputDestination
I8I8
I16I16
I32I32
I64I64
I128I128

add

Back to Top

Description

Adds first with second, storing the outcome in destination.

For integer types, a constraint is added to check for overflow. For cases where wrapping semantics are needed for integer types, see the add.w instruction.

Example Usage

add r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldField
GroupGroupGroup
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128
ScalarScalarScalar

add.w

Back to Top

Description

Adds first with second, wrapping around at the boundary of the type, and storing the outcome in destination.

Example Usage

add.w r0 r1 into r2;

Supported Types

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

and

Back to Top

Description

Performs an AND operation on integer (bitwise) or boolean first and second, storing the outcome in destination.

Example Usage

and r0 r1 into r2;

Supported Types

FirstSecondDestination
BooleanBooleanBoolean
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

assert.eq

Back to Top

Description

Checks whether first and second are equal, halting if they are not equal.

Example Usage

assert.eq r0 r1;

Supported Types

FirstSecond
AddressAddress
BooleanBoolean
FieldField
GroupGroup
I8I8
I16I16
I32I32
I64I64
I128I128
U8U8
U16U16
U32U32
U64U64
U128U128
ScalarScalar
SignatureSignature
StructStruct
RecordRecord

assert.neq

Back to Top

Description

Checks whether first and second are not equal, halting if they are equal.

Example Usage

assert.neq r0 r1;

Supported Types

FirstSecond
AddressAddress
BooleanBoolean
FieldField
GroupGroup
I8I8
I16I16
I32I32
I64I64
I128I128
U8U8
U16U16
U32U32
U64U64
U128U128
ScalarScalar
SignatureSignature
StructStruct
RecordRecord

branch.eq

Back to Top

Description

The command branch.eq <first> <second> to <destination> branches execution to the position indicated by destination if first and second are equal. This command is restricted to the finalize scope, and the destination must follow the command. Backward branches are not currently supported.

Example Usage

branch.eq r0 r1 to skip;
FirstSecondDestination
AddressAddressPosition
BooleanBooleanPosition
FieldFieldPosition
GroupGroupPosition
I8I8Position
I16I16Position
I32I32Position
I64I64Position
I128I128Position
U8U8Position
U16U16Position
U32U32Position
U64U64Position
U128U128Position
ScalarScalarPosition
StructStructPosition
RecordRecordPosition

branch.neq

Back to Top

Description

The command branch.neq <first> <second> to <destination> branches execution to the position indicated by destination if first and second are not equal. This command is restricted to the finalize scope, and the destination must follow the command. Backward branches are not currently supported.

Example Usage

branch.neq r0 r1 to process;
FirstSecondDestination
AddressAddressPosition
BooleanBooleanPosition
FieldFieldPosition
GroupGroupPosition
I8I8Position
I16I16Position
I32I32Position
I64I64Position
I128I128Position
U8U8Position
U16U16Position
U32U32Position
U64U64Position
U128U128Position
ScalarScalarPosition
StructStructPosition
RecordRecordPosition

cast

Back to Top

Description

Enables casting between different literals.

Example Usage

input r0 as field.private;
cast r0 into r1 as group;
cast r0 into r2 as u8;
cast r3 r4 r5 r6 into r7 as [boolean; 4u32];
cast r7 into r8 as [[boolean; 4u32]; 1u32];

Supported Types

FromTo
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ElementsTo
AddressArray, Struct
BooleanArray, Struct
FieldArray, Struct
GroupArray, Struct
I8Array, Struct
I16Array, Struct
I32Array, Struct
I64Array, Struct
I128Array, Struct
U8Array, Struct
U16Array, Struct
U32Array, Struct
U64Array, Struct
U128Array, Struct
ScalarArray, Struct

cast.lossy

Back to Top

Description

Perform casting with lossy truncation.

Example Usage

input r0 as field.private;
cast r0 into r1 as group;
cast r0 into r2 as u8;
cast.lossy r0 into r3 as u8; // The bottom 8 bits of the r0 are extracted into a u8 and placed into r3

Supported Types

FromTo
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

commit.bhp256

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 256-bit chunks in first, and some randomness in second, storing the commitment in destination. Randomness should always be a Scalar value, and the produced commitment will always be an Address, Field, or Group value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 129 bits.

Example Usage

commit.bhp256 r0 r1 into r2 as address;

Supported Types

FirstSecondDestination
AddressScalarAddress, Field, Group
BooleanScalarAddress, Field, Group
FieldScalarAddress, Field, Group
GroupScalarAddress, Field, Group
I8ScalarAddress, Field, Group
I16ScalarAddress, Field, Group
I32ScalarAddress, Field, Group
I64ScalarAddress, Field, Group
I128ScalarAddress, Field, Group
U8ScalarAddress, Field, Group
U16ScalarAddress, Field, Group
U32ScalarAddress, Field, Group
U64ScalarAddress, Field, Group
U128ScalarAddress, Field, Group
ScalarScalarAddress, Field, Group
StructScalarAddress, Field, Group
ArrayScalarAddress, Field, Group

commit.bhp512

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 512-bit chunks in first, and some randomness in second, storing the commitment in destination. Randomness should always be a Scalar value, and the produced commitment will always be an Address, Field, or Group value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 171 bits.

Example Usage

commit.bhp512 r0 r1 into r2 as field;

Supported Types

FirstSecondDestination
AddressScalarAddress, Field, Group
BooleanScalarAddress, Field, Group
FieldScalarAddress, Field, Group
GroupScalarAddress, Field, Group
I8ScalarAddress, Field, Group
I16ScalarAddress, Field, Group
I32ScalarAddress, Field, Group
I64ScalarAddress, Field, Group
I128ScalarAddress, Field, Group
U8ScalarAddress, Field, Group
U16ScalarAddress, Field, Group
U32ScalarAddress, Field, Group
U64ScalarAddress, Field, Group
U128ScalarAddress, Field, Group
ScalarScalarAddress, Field, Group
StructScalarAddress, Field, Group
ArrayScalarAddress, Field, Group

commit.bhp768

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 768-bit chunks in first, and some randomness in second, storing the commitment in destination. Randomness should always be a Scalar value, and the produced commitment will always be an Address, Field, or Group value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 129 bits.

Example Usage

commit.bhp768 r0 r1 into r2 as group;

Supported Types

FirstSecondDestination
AddressScalarAddress, Field, Group
BooleanScalarAddress, Field, Group
FieldScalarAddress, Field, Group
GroupScalarAddress, Field, Group
I8ScalarAddress, Field, Group
I16ScalarAddress, Field, Group
I32ScalarAddress, Field, Group
I64ScalarAddress, Field, Group
I128ScalarAddress, Field, Group
U8ScalarAddress, Field, Group
U16ScalarAddress, Field, Group
U32ScalarAddress, Field, Group
U64ScalarAddress, Field, Group
U128ScalarAddress, Field, Group
ScalarScalarAddress, Field, Group
StructScalarAddress, Field, Group
ArrayScalarAddress, Field, Group

commit.bhp1024

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 1024-bit chunks in first, and some randomness in second, storing the commitment in destination. Randomness should always be a Scalar value, and the produced commitment will always be an Address, Field, or Group value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 171 bits.

Example Usage

commit.bhp1024 r0 r1 into r2 as address;

Supported Types

FirstSecondDestination
AddressScalarAddress, Field, Group
BooleanScalarAddress, Field, Group
FieldScalarAddress, Field, Group
GroupScalarAddress, Field, Group
I8ScalarAddress, Field, Group
I16ScalarAddress, Field, Group
I32ScalarAddress, Field, Group
I64ScalarAddress, Field, Group
I128ScalarAddress, Field, Group
U8ScalarAddress, Field, Group
U16ScalarAddress, Field, Group
U32ScalarAddress, Field, Group
U64ScalarAddress, Field, Group
U128ScalarAddress, Field, Group
ScalarScalarAddress, Field, Group
StructScalarAddress, Field, Group
ArrayScalarAddress, Field, Group

commit.ped64

Back to Top

Description

Computes a Pedersen commitment up to a 64-bit input in first, and some randomness in second, storing the commitment in destination. Randomness should always be a Scalar value, and the produced commitment is an Address, Field, or Group value, as specified via as at the end of the instruction.

The compiler will throw an error if the given Struct value exceeds the 64-bit limit.

Example Usage

commit.ped64 r0 r1 into r2 as field;

Supported Types

FirstSecondDestination
BooleanScalarAddress, Field, Group
I8ScalarAddress, Field, Group
I16ScalarAddress, Field, Group
I32ScalarAddress, Field, Group
U8ScalarAddress, Field, Group
U16ScalarAddress, Field, Group
U32ScalarAddress, Field, Group
StructScalarAddress, Field, Group
ArrayScalarAddress, Field, Group

commit.ped128

Back to Top

Description

Computes a Pedersen commitment up to a 128-bit input in first, and some randomness in second, storing the commitment in destination. Randomness should always be a Scalar value, and the produced commitment is an Address, Field, or Group value, as specified via as at the end of the instruction.

The compiler will throw an error if the given Struct value exceeds the 128-bit limit.

Example Usage

commit.ped128 r0 r1 into r2 as group;

Supported Types

FirstSecondDestination
BooleanScalarAddress, Field, Group
I8ScalarAddress, Field, Group
I16ScalarAddress, Field, Group
I32ScalarAddress, Field, Group
I64ScalarAddress, Field, Group
U8ScalarAddress, Field, Group
U16ScalarAddress, Field, Group
U32ScalarAddress, Field, Group
U64ScalarAddress, Field, Group
StructScalarAddress, Field, Group
ArrayScalarAddress, Field, Group

div

Back to Top

Description

Divides first by second, storing the outcome in destination. Halts on division by zero.

For integer types, this operation performs truncated division. Furthermore, a constraint is added to check for underflow. This underflow happens when dividing the minimum value of a signed integer type by -1. For example, div -128i8 -1i8 would result in underflow, since 128 cannot be represented as an i8.

For cases where wrapping semantics are needed for integer types, see the div.w instruction.

Example Usage

div r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldField
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

div.w

Back to Top

Description

Divides first by second, wrapping around at the boundary of the type, and storing the outcome in destination.

Example Usage

div.w r0 r1 into r2;

Supported Types

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

double

Back to Top

Description

Doubles the input, storing the outcome in destination.

Example Usage

double r0 into r1;

Supported Types

InputDestination
FieldField
GroupGroup

gt

Back to Top

Description

Checks if first is greater than second, storing the result in destination.

Example Usage

gt r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldBoolean
I8I8Boolean
I16I16Boolean
I32I32Boolean
I64I64Boolean
I128I128Boolean
U8U8Boolean
U16U16Boolean
U32U32Boolean
U64U64Boolean
U128U128Boolean
ScalarScalarBoolean

gte

Back to Top

Description

Checks if first is greater than or equal to second, storing the result in destination.

Example Usage

gte r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldBoolean
I8I8Boolean
I16I16Boolean
I32I32Boolean
I64I64Boolean
I128I128Boolean
U8U8Boolean
U16U16Boolean
U32U32Boolean
U64U64Boolean
U128U128Boolean
ScalarScalarBoolean

hash.bhp256

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 256-bit chunks in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 129 bits.

Example Usage

hash.bhp256 r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp512

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 512-bit chunks in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 171 bits.

Example Usage

hash.bhp512 r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp768

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 768-bit chunks in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 129 bits.

Example Usage

hash.bhp768 r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp1024

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 1024-bit chunks in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 171 bits.

Example Usage

hash.bhp1024 r0 into r1 as scalar;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak256

Back to Top

Description

Performs a Keccak hash on first, storing a 256-bit digest in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.keccak256 r0 into r1 as address;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak384

Back to Top

Description

Performs a Keccak hash on first, storing a 384-bit digest in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.keccak384 r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak512

Back to Top

Description

Performs a Keccak hash on first, storing a 512-bit digest in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.keccak512 r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.ped64

Back to Top

Description

Computes a Pedersen hash up to a 64-bit input in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given Struct value exceeds the 64-bit limit.

Example Usage

hash.ped64 r0 into r1 as address;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.ped128

Back to Top

Description

Computes a Pedersen hash up to a 128-bit input in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given Struct value exceeds the 128-bit limit.

Example Usage

hash.ped128 r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.psd2

Back to Top

Description

Calculates a Poseidon hash with an input rate of 2, from an input in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.psd2 r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.psd4

Back to Top

Description

Calculates a Poseidon hash with an input rate of 4, from an input in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.psd4 r0 into r1 as scalar;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.psd8

Back to Top

Description

Calculates a Poseidon hash with an input rate of 8, from an input in first, storing the hash in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.psd8 r0 into r1 as address;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.sha3_256

Back to Top

Description

Calculates a SHA3-256 hash, from an input in first, storing the 256-bit digest in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.sha3_256 r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.sha3_384

Back to Top

Description

Calculates a SHA3-384 hash, from an input in first, storing the 384-bit digest in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.sha3_384 r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.sha3_512

Back to Top

Description

Calculates a SHA3-512 hash, from an input in first, storing the 512-bit digest in destination. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.sha3_512 r0 into r1 as scalar;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp256.raw

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 256-bit chunks in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 129 bits.

Example Usage

hash.bhp256.raw r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp512.raw

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 512-bit chunks in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 171 bits.

Example Usage

hash.bhp512.raw r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp768.raw

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 768-bit chunks in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 213 bits.

Example Usage

hash.bhp768.raw r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.bhp1024.raw

Back to Top

Description

Computes a Bowe-Hopwood-Pedersen hash on inputs of 1024-bit chunks in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given input is smaller than 255 bits.

Example Usage

hash.bhp1024.raw r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak256.raw

Back to Top

Description

Performs a Keccak hash on first, storing a 256-bit digest in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.keccak256.raw r0 into r1 as address;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak384.raw

Back to Top

Description

Performs a Keccak hash on first, storing a 384-bit digest in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.keccak384.raw r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak512.raw

Back to Top

Description

Performs a Keccak hash on first, storing a 512-bit digest in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.keccak512.raw r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.ped64.raw

Back to Top

Description

Computes a Pedersen hash up to a 64-bit input in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given Struct value exceeds the 64-bit limit.

Example Usage

hash.ped64.raw r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.ped128.raw

Back to Top

Description

Computes a Pedersen hash up to a 128-bit input in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

The compiler will throw an error if the given Struct value exceeds the 128-bit limit.

Example Usage

hash.ped128.raw r0 into r1 as address;

Supported Types

FirstDestination
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.psd2.raw

Back to Top

Description

Calculates a Poseidon hash with an input rate of 2, from an input in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.psd2.raw r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.psd4.raw

Back to Top

Description

Calculates a Poseidon hash with an input rate of 4, from an input in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.psd4.raw r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.psd8.raw

Back to Top

Description

Calculates a Poseidon hash with an input rate of 8, from an input in first, storing the hash in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.psd8.raw r0 into r1 as address;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.sha3_256.raw

Back to Top

Description

Calculates a SHA3-256 hash, from an input in first, storing the 256-bit digest in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.sha3_256.raw r0 into r1 as field;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.sha3_384.raw

Back to Top

Description

Calculates a SHA3-384 hash, from an input in first, storing the 384-bit digest in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.sha3_384.raw r0 into r1 as group;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.sha3_512.raw

Back to Top

Description

Calculates a SHA3-512 hash, from an input in first, storing the 512-bit digest in destination. This variant uses raw bit form without Aleo variant bits. The produced hash will always be an arithmetic (U8, U16, U32, U64, U128, I8, I16, I32,I64,I128, Field, Group, or Scalar) or Address value, as specified via as at the end of the instruction.

Example Usage

hash.sha3_512.raw r0 into r1 as scalar;

Supported Types

FirstDestination
ArrayAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
AddressAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
BooleanAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
FieldAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
GroupAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
I128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U8Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U16Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U32Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U64Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
U128Address, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
ScalarAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128
StructAddress, Field, Group, Scalar, I8, I16, I32,I64,I128, U8, U16, U32, U64, U128

hash.keccak256.native

Back to Top

Description

Performs a Keccak hash on first, storing a 256-bit digest as a bit array in destination. This variant performs the underlying hash returning a bit array [bool; 256].

Example Usage

hash.keccak256.native r0 into r1;

Supported Types

FirstDestination
Array[bool; 256]
Address[bool; 256]
Boolean[bool; 256]
Field[bool; 256]
Group[bool; 256]
I8[bool; 256]
I16[bool; 256]
I32[bool; 256]
I64[bool; 256]
I128[bool; 256]
U8[bool; 256]
U16[bool; 256]
U32[bool; 256]
U64[bool; 256]
U128[bool; 256]
Scalar[bool; 256]
Struct[bool; 256]

hash.keccak256.native.raw

Back to Top

Description

Performs a Keccak hash on first, storing a 256-bit digest as a bit array in destination. This variant uses raw bit form without Aleo variant bits and performs the underlying hash returning a bit array [bool; 256].

Example Usage

hash.keccak256.native.raw r0 into r1;

Supported Types

FirstDestination
Array[bool; 256]
Address[bool; 256]
Boolean[bool; 256]
Field[bool; 256]
Group[bool; 256]
I8[bool; 256]
I16[bool; 256]
I32[bool; 256]
I64[bool; 256]
I128[bool; 256]
U8[bool; 256]
U16[bool; 256]
U32[bool; 256]
U64[bool; 256]
U128[bool; 256]
Scalar[bool; 256]
Struct[bool; 256]

hash.keccak384.native

Back to Top

Description

Performs a Keccak hash on first, storing a 384-bit digest as a bit array in destination. This variant performs the underlying hash returning a bit array [bool; 384].

Example Usage

hash.keccak384.native r0 into r1;

Supported Types

FirstDestination
Array[bool; 384]
Address[bool; 384]
Boolean[bool; 384]
Field[bool; 384]
Group[bool; 384]
I8[bool; 384]
I16[bool; 384]
I32[bool; 384]
I64[bool; 384]
I128[bool; 384]
U8[bool; 384]
U16[bool; 384]
U32[bool; 384]
U64[bool; 384]
U128[bool; 384]
Scalar[bool; 384]
Struct[bool; 384]

hash.keccak384.native.raw

Back to Top

Description

Performs a Keccak hash on first, storing a 384-bit digest as a bit array in destination. This variant uses raw bit form without Aleo variant bits and performs the underlying hash returning a bit array [bool; 384].

Example Usage

hash.keccak384.native.raw r0 into r1;

Supported Types

FirstDestination
Array[bool; 384]
Address[bool; 384]
Boolean[bool; 384]
Field[bool; 384]
Group[bool; 384]
I8[bool; 384]
I16[bool; 384]
I32[bool; 384]
I64[bool; 384]
I128[bool; 384]
U8[bool; 384]
U16[bool; 384]
U32[bool; 384]
U64[bool; 384]
U128[bool; 384]
Scalar[bool; 384]
Struct[bool; 384]

hash.keccak512.native

Back to Top

Description

Performs a Keccak hash on first, storing a 512-bit digest as a bit array in destination. This variant performs the underlying hash returning a bit array [bool; 512].

Example Usage

hash.keccak512.native r0 into r1;

Supported Types

FirstDestination
Array[bool; 512]
Address[bool; 512]
Boolean[bool; 512]
Field[bool; 512]
Group[bool; 512]
I8[bool; 512]
I16[bool; 512]
I32[bool; 512]
I64[bool; 512]
I128[bool; 512]
U8[bool; 512]
U16[bool; 512]
U32[bool; 512]
U64[bool; 512]
U128[bool; 512]
Scalar[bool; 512]
Struct[bool; 512]

hash.keccak512.native.raw

Back to Top

Description

Performs a Keccak hash on first, storing a 512-bit digest as a bit array in destination. This variant uses raw bit form without Aleo variant bits and performs the underlying hash returning a bit array [bool; 512].

Example Usage

hash.keccak512.native.raw r0 into r1;

Supported Types

FirstDestination
Array[bool; 512]
Address[bool; 512]
Boolean[bool; 512]
Field[bool; 512]
Group[bool; 512]
I8[bool; 512]
I16[bool; 512]
I32[bool; 512]
I64[bool; 512]
I128[bool; 512]
U8[bool; 512]
U16[bool; 512]
U32[bool; 512]
U64[bool; 512]
U128[bool; 512]
Scalar[bool; 512]
Struct[bool; 512]

hash.sha3_256.native

Back to Top

Description

Calculates a SHA3-256 hash, from an input in first, storing the 256-bit digest as a bit array in destination. This variant performs the underlying hash returning a bit array [bool; 256].

Example Usage

hash.sha3_256.native r0 into r1;

Supported Types

FirstDestination
Array[bool; 256]
Address[bool; 256]
Boolean[bool; 256]
Field[bool; 256]
Group[bool; 256]
I8[bool; 256]
I16[bool; 256]
I32[bool; 256]
I64[bool; 256]
I128[bool; 256]
U8[bool; 256]
U16[bool; 256]
U32[bool; 256]
U64[bool; 256]
U128[bool; 256]
Scalar[bool; 256]
Struct[bool; 256]

hash.sha3_256.native.raw

Back to Top

Description

Calculates a SHA3-256 hash, from an input in first, storing the 256-bit digest as a bit array in destination. This variant uses raw bit form without Aleo variant bits and performs the underlying hash returning a bit array [bool; 256].

Example Usage

hash.sha3_256.native.raw r0 into r1;

Supported Types

FirstDestination
Array[bool; 256]
Address[bool; 256]
Boolean[bool; 256]
Field[bool; 256]
Group[bool; 256]
I8[bool; 256]
I16[bool; 256]
I32[bool; 256]
I64[bool; 256]
I128[bool; 256]
U8[bool; 256]
U16[bool; 256]
U32[bool; 256]
U64[bool; 256]
U128[bool; 256]
Scalar[bool; 256]
Struct[bool; 256]

hash.sha3_384.native

Back to Top

Description

Calculates a SHA3-384 hash, from an input in first, storing the 384-bit digest as a bit array in destination. This variant performs the underlying hash returning a bit array [bool; 384].

Example Usage

hash.sha3_384.native r0 into r1;

Supported Types

FirstDestination
Array[bool; 384]
Address[bool; 384]
Boolean[bool; 384]
Field[bool; 384]
Group[bool; 384]
I8[bool; 384]
I16[bool; 384]
I32[bool; 384]
I64[bool; 384]
I128[bool; 384]
U8[bool; 384]
U16[bool; 384]
U32[bool; 384]
U64[bool; 384]
U128[bool; 384]
Scalar[bool; 384]
Struct[bool; 384]

hash.sha3_384.native.raw

Back to Top

Description

Calculates a SHA3-384 hash, from an input in first, storing the 384-bit digest as a bit array in destination. This variant uses raw bit form without Aleo variant bits and performs the underlying hash returning a bit array [bool; 384].

Example Usage

hash.sha3_384.native.raw r0 into r1;

Supported Types

FirstDestination
Array[bool; 384]
Address[bool; 384]
Boolean[bool; 384]
Field[bool; 384]
Group[bool; 384]
I8[bool; 384]
I16[bool; 384]
I32[bool; 384]
I64[bool; 384]
I128[bool; 384]
U8[bool; 384]
U16[bool; 384]
U32[bool; 384]
U64[bool; 384]
U128[bool; 384]
Scalar[bool; 384]
Struct[bool; 384]

hash.sha3_512.native

Back to Top

Description

Calculates a SHA3-512 hash, from an input in first, storing the 512-bit digest as a bit array in destination. This variant performs the underlying hash returning a bit array [bool; 512].

Example Usage

hash.sha3_512.native r0 into r1;

Supported Types

FirstDestination
Array[bool; 512]
Address[bool; 512]
Boolean[bool; 512]
Field[bool; 512]
Group[bool; 512]
I8[bool; 512]
I16[bool; 512]
I32[bool; 512]
I64[bool; 512]
I128[bool; 512]
U8[bool; 512]
U16[bool; 512]
U32[bool; 512]
U64[bool; 512]
U128[bool; 512]
Scalar[bool; 512]
Struct[bool; 512]

hash.sha3_512.native.raw

Back to Top

Description

Calculates a SHA3-512 hash, from an input in first, storing the 512-bit digest as a bit array in destination. This variant uses raw bit form without Aleo variant bits and performs the underlying hash returning a bit array [bool; 512].

Example Usage

hash.sha3_512.native.raw r0 into r1;

Supported Types

FirstDestination
Array[bool; 512]
Address[bool; 512]
Boolean[bool; 512]
Field[bool; 512]
Group[bool; 512]
I8[bool; 512]
I16[bool; 512]
I32[bool; 512]
I64[bool; 512]
I128[bool; 512]
U8[bool; 512]
U16[bool; 512]
U32[bool; 512]
U64[bool; 512]
U128[bool; 512]
Scalar[bool; 512]
Struct[bool; 512]

inv

Back to Top

Description

Computes the multiplicative inverse of the input, storing the outcome in destination.

Example Usage

inv r0 into r1;

Supported Types

InputDestination
FieldField

is.eq

Back to Top

Description

Compares first and second, storing the result in destination.

Example Usage

is.eq r0 r1 into r2;

Supported Types

FirstSecondDestination
AddressAddressBoolean
BooleanBooleanBoolean
FieldFieldBoolean
GroupGroupBoolean
I8I8Boolean
I16I16Boolean
I32I32Boolean
I64I64Boolean
I128I128Boolean
U8U8Boolean
U16U16Boolean
U32U32Boolean
U64U64Boolean
U128U128Boolean
ScalarScalarBoolean
SignatureSignatureBoolean
StructStructBoolean
RecordRecordBoolean

is.neq

Back to Top

Description

Returns true if first is not equal to second, storing the result in destination.

Example Usage

is.neq r0 r1 into r2;

Supported Types

FirstSecondDestination
AddressAddressBoolean
BooleanBooleanBoolean
FieldFieldBoolean
GroupGroupBoolean
I8I8Boolean
I16I16Boolean
I32I32Boolean
I64I64Boolean
I128I128Boolean
U8U8Boolean
U16U16Boolean
U32U32Boolean
U64U64Boolean
U128U128Boolean
ScalarScalarBoolean
SignatureSignatureBoolean
StructStructBoolean
RecordRecordBoolean

lt

Back to Top

Description

Checks if first is less than second, storing the outcome in destination.

Example Usage

lt r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldBoolean
I8I8Boolean
I16I16Boolean
I32I32Boolean
I64I64Boolean
I128I128Boolean
U8U8Boolean
U16U16Boolean
U32U32Boolean
U64U64Boolean
U128U128Boolean
ScalarScalarBoolean

lte

Back to Top

Description

Checks if first is less than or equal to second, storing the outcome in destination.

Example Usage

lte r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldBoolean
I8I8Boolean
I16I16Boolean
I32I32Boolean
I64I64Boolean
I128I128Boolean
U8U8Boolean
U16U16Boolean
U32U32Boolean
U64U64Boolean
U128U128Boolean
ScalarScalarBoolean

mod

Back to Top

Description

Takes the modulus of first with respect to second, storing the outcome in destination. Halts if second is zero.

The semantics of this operation are consistent with the mathematical definition of modulo operation.

Example Usage

mod r0 r1 into r2;

Supported Types

FirstSecondDestination
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

mul

Back to Top

Description

Multiplies first with second, storing the outcome in destination.

For integer types, a constraint is added to check for overflow/underflow. For cases where wrapping semantics are needed for integer types, see the mul.w instruction.

Example Usage

mul r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldField
GroupScalarGroup
ScalarGroupGroup
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

mul.w

Back to Top

Description

Multiplies first with second, wrapping around at the boundary of the type, and storing the outcome in destination.

Example Usage

mul.w r0 r1 into r2;

Supported Types

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

nand

Back to Top

Description

Returns false only if first and second are true, storing the outcome in destination.

Example Usage

nand r0 r1 into r2;

Supported Types

FirstSecondDestination
BooleanBooleanBoolean

neg

Back to Top

Description

Negates first, storing the outcome in destination.

For signed integer types, calling neg on the minimum value is an invalid operation. For example, the input -128i8 would not be valid since 128 cannot be represented as an i8.

Example Usage

neg r0 into r1;

Supported Types

InputDestination
FieldField
GroupGroup
I8I8
I16I16
I32I32
I64I64
I128I128

nor

Back to Top

Description

Returns true when neither first nor second is true, storing the outcome in destination.

Example Usage

nor r0 r1 into r2;

Supported Type

FirstSecondDestination
BooleanBooleanBoolean

not

Back to Top

Description

Perform a NOT operation on an integer (bitwise) or boolean input, storing the outcome in destination.

Example Usage

not r0 into r1;

Supported Types

InputDestination
BooleanBoolean
I8I8
I16I16
I32I32
I64I64
I128I128
U8U8
U16U16
U32U32
U64U64
U128U128

or

Back to Top

Description

Performs an OR operation on integer (bitwise) or boolean first and second, storing the outcome in destination.

Example Usage

or r0 r1 into r2;

Supported Types

FirstSecondDestination
BooleanBooleanBoolean
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

position

Back to Top

Description

The position declaration, e.g. position <name>, which indicates a location name in the program to branch execution to.
Positions must be a lowercase alphanumeric string.

Example Usage

position skip;

pow

Back to Top

Description

Raises first to the power of second, storing the outcome in destination.

For integer types, a constraint is added to check for overflow/underflow. For cases where wrapping semantics are needed for integer types, see the pow.w instruction.

Example Usage

pow r0 r1 into r2;

Supported Types

Magnitude can be a U8, U16, or U32.

FirstSecondDestination
FieldFieldField
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

pow.w

Back to Top

Description

Raises first to the power of second, wrapping around at the boundary of the type, storing the outcome in destination.

Example Usage

pow.w r0 r1 into r2;

Supported Types

Magnitude can be a U8, U16, or U32.

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

rand.chacha

Description

The rand.chacha opcode is used to generate random values within the finalize scope. It supports a wide range of types for the random value.

Example Usage

rand.chacha into r0 as field;
rand.chacha r0 into r1 as field;
rand.chacha r0 r1 into r2 as field;
rand.chacha 1u8 2i16 into r27 as u32;

Supported Types

Single can be any of the following types Address, Boolean, Field, Group, I8, I16, I32, I64, I128, U8, U16, U32, U64, U128, or Scalar. Composite data types such as structs and mappings are not allowed.

FirstSecondDestination
SingleSingleSingle

rem

Back to Top

Description

Computes the truncated remainder of first divided by second, storing the outcome in destination. Halts on division by zero.

A constraint is added to check for underflow. This underflow happens when the associated division operation, div, underflows.

For cases where wrapping semantics are needed for integer types, see the rem.w instruction.

Example Usage

rem r0 r1 into r2;

Supported Types

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

rem.w

Back to Top

Description

Computes the truncated remainder of first divided by second, wrapping around at the boundary of the type, and storing the outcome in destination.

Example Usage

rem.w r0 r1 into r2;

Supported Types

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

sign.verify

Back to Top

Description

Verifies the signature first against the address public key second and the message third, storing the outcome in destination.

Example Usage

sign.verify r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
SignatureAddressArray of FieldBoolean

ecdsa.verify.digest

Back to Top

Description

Verifies an ECDSA signature against a 33-byte ECDSA address and a pre-computed message digest, storing the outcome in destination. Both the address and digest are already in raw form. The digest must be a 32-byte array.

Example Usage

ecdsa.verify.digest r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][u8; 32]Boolean

ecdsa.verify.digest.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and a pre-computed message digest, storing the outcome in destination. Both the address and digest are already in raw form. The digest must be a 32-byte array.

Example Usage

ecdsa.verify.digest.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][u8; 32]Boolean

ecdsa.verify.keccak256

Back to Top

Description

Verifies an ECDSA signature against a public key and message using Keccak-256 hash, storing the outcome in destination. This is the Aleo variant bits form.

Example Usage

ecdsa.verify.keccak256 r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33]AddressBoolean
[u8; 65][u8; 33]FieldBoolean
[u8; 65][u8; 33]GroupBoolean
[u8; 65][u8; 33]ScalarBoolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.keccak256.raw

Back to Top

Description

Verifies an ECDSA signature against a public key and message using Keccak-256 hash, storing the outcome in destination. This variant uses raw bit form without metadata. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.keccak256.raw r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][Address; 8]Boolean
[u8; 65][u8; 33][Field; 8]Boolean
[u8; 65][u8; 33][Group; 8]Boolean
[u8; 65][u8; 33][Scalar; 8]Boolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.keccak256.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and message using Keccak-256 hash, storing the outcome in destination. The address is a 20-byte Ethereum address and the message is in raw form. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.keccak256.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][Address; 8]Boolean
[u8; 65][u8; 20][Field; 8]Boolean
[u8; 65][u8; 20][Group; 8]Boolean
[u8; 65][u8; 20][Scalar; 8]Boolean
[u8; 65][u8; 20]I8Boolean
[u8; 65][u8; 20]I16Boolean
[u8; 65][u8; 20]I32Boolean
[u8; 65][u8; 20]I64Boolean
[u8; 65][u8; 20]I128Boolean
[u8; 65][u8; 20]U8Boolean
[u8; 65][u8; 20]U16Boolean
[u8; 65][u8; 20]U32Boolean
[u8; 65][u8; 20]U64Boolean
[u8; 65][u8; 20]U128Boolean

ecdsa.verify.keccak384

Back to Top

Description

Verifies an ECDSA signature against a public key and message using Keccak-384 hash, storing the outcome in destination. This is the Aleo variant bits form.

Example Usage

ecdsa.verify.keccak384 r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33]AddressBoolean
[u8; 65][u8; 33]FieldBoolean
[u8; 65][u8; 33]GroupBoolean
[u8; 65][u8; 33]ScalarBoolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.keccak384.raw

Back to Top

Description

Verifies an ECDSA signature against a public key and message using Keccak-384 hash, storing the outcome in destination. This variant uses raw bit form without metadata. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.keccak384.raw r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][Address; 8]Boolean
[u8; 65][u8; 33][Field; 8]Boolean
[u8; 65][u8; 33][Group; 8]Boolean
[u8; 65][u8; 33][Scalar; 8]Boolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.keccak384.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and message using Keccak-384 hash, storing the outcome in destination. The address is a 20-byte Ethereum address and the message is in raw form. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.keccak384.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][Address; 8]Boolean
[u8; 65][u8; 20][Field; 8]Boolean
[u8; 65][u8; 20][Group; 8]Boolean
[u8; 65][u8; 20][Scalar; 8]Boolean
[u8; 65][u8; 20]I8Boolean
[u8; 65][u8; 20]I16Boolean
[u8; 65][u8; 20]I32Boolean
[u8; 65][u8; 20]I64Boolean
[u8; 65][u8; 20]I128Boolean
[u8; 65][u8; 20]U8Boolean
[u8; 65][u8; 20]U16Boolean
[u8; 65][u8; 20]U32Boolean
[u8; 65][u8; 20]U64Boolean
[u8; 65][u8; 20]U128Boolean

ecdsa.verify.keccak512

Back to Top

Description

Verifies an ECDSA signature against a public key and message using Keccak-512 hash, storing the outcome in destination. This is the Aleo variant bits form.

Example Usage

ecdsa.verify.keccak512 r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33]AddressBoolean
[u8; 65][u8; 33]FieldBoolean
[u8; 65][u8; 33]GroupBoolean
[u8; 65][u8; 33]ScalarBoolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.keccak512.raw

Back to Top

Description

Verifies an ECDSA signature against a public key and message using Keccak-512 hash, storing the outcome in destination. This variant uses raw bit form without metadata. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.keccak512.raw r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][Address; 8]Boolean
[u8; 65][u8; 33][Field; 8]Boolean
[u8; 65][u8; 33][Group; 8]Boolean
[u8; 65][u8; 33][Scalar; 8]Boolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.keccak512.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and message using Keccak-512 hash, storing the outcome in destination. The address is a 20-byte Ethereum address and the message is in raw form. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.keccak512.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][Address; 8]Boolean
[u8; 65][u8; 20][Field; 8]Boolean
[u8; 65][u8; 20][Group; 8]Boolean
[u8; 65][u8; 20][Scalar; 8]Boolean
[u8; 65][u8; 20]I8Boolean
[u8; 65][u8; 20]I16Boolean
[u8; 65][u8; 20]I32Boolean
[u8; 65][u8; 20]I64Boolean
[u8; 65][u8; 20]I128Boolean
[u8; 65][u8; 20]U8Boolean
[u8; 65][u8; 20]U16Boolean
[u8; 65][u8; 20]U32Boolean
[u8; 65][u8; 20]U64Boolean
[u8; 65][u8; 20]U128Boolean

ecdsa.verify.sha3_256

Back to Top

Description

Verifies an ECDSA signature against a public key and message using SHA3-256 hash, storing the outcome in destination. This is the Aleo variant bits form.

Example Usage

ecdsa.verify.sha3_256 r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33]AddressBoolean
[u8; 65][u8; 33]FieldBoolean
[u8; 65][u8; 33]GroupBoolean
[u8; 65][u8; 33]ScalarBoolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.sha3_256.raw

Back to Top

Description

Verifies an ECDSA signature against a public key and message using SHA3-256 hash, storing the outcome in destination. This variant uses raw bit form without metadata. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.sha3_256.raw r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][Address; 8]Boolean
[u8; 65][u8; 33][Field; 8]Boolean
[u8; 65][u8; 33][Group; 8]Boolean
[u8; 65][u8; 33][Scalar; 8]Boolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.sha3_256.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and message using SHA3-256 hash, storing the outcome in destination. The address is a 20-byte Ethereum address and the message is in raw form. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.sha3_256.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][Address; 8]Boolean
[u8; 65][u8; 20][Field; 8]Boolean
[u8; 65][u8; 20][Group; 8]Boolean
[u8; 65][u8; 20][Scalar; 8]Boolean
[u8; 65][u8; 20]I8Boolean
[u8; 65][u8; 20]I16Boolean
[u8; 65][u8; 20]I32Boolean
[u8; 65][u8; 20]I64Boolean
[u8; 65][u8; 20]I128Boolean
[u8; 65][u8; 20]U8Boolean
[u8; 65][u8; 20]U16Boolean
[u8; 65][u8; 20]U32Boolean
[u8; 65][u8; 20]U64Boolean
[u8; 65][u8; 20]U128Boolean

ecdsa.verify.sha3_384

Back to Top

Description

Verifies an ECDSA signature against a public key and message using SHA3-384 hash, storing the outcome in destination. This is the Aleo variant bits form.

Example Usage

ecdsa.verify.sha3_384 r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33]AddressBoolean
[u8; 65][u8; 33]FieldBoolean
[u8; 65][u8; 33]GroupBoolean
[u8; 65][u8; 33]ScalarBoolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.sha3_384.raw

Back to Top

Description

Verifies an ECDSA signature against a public key and message using SHA3-384 hash, storing the outcome in destination. This variant uses raw bit form without metadata. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.sha3_384.raw r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][Address; 8]Boolean
[u8; 65][u8; 33][Field; 8]Boolean
[u8; 65][u8; 33][Group; 8]Boolean
[u8; 65][u8; 33][Scalar; 8]Boolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.sha3_384.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and message using SHA3-384 hash, storing the outcome in destination. The address is a 20-byte Ethereum address and the message is in raw form. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.sha3_384.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][Address; 8]Boolean
[u8; 65][u8; 20][Field; 8]Boolean
[u8; 65][u8; 20][Group; 8]Boolean
[u8; 65][u8; 20][Scalar; 8]Boolean
[u8; 65][u8; 20]I8Boolean
[u8; 65][u8; 20]I16Boolean
[u8; 65][u8; 20]I32Boolean
[u8; 65][u8; 20]I64Boolean
[u8; 65][u8; 20]I128Boolean
[u8; 65][u8; 20]U8Boolean
[u8; 65][u8; 20]U16Boolean
[u8; 65][u8; 20]U32Boolean
[u8; 65][u8; 20]U64Boolean
[u8; 65][u8; 20]U128Boolean

ecdsa.verify.sha3_512

Back to Top

Description

Verifies an ECDSA signature against a public key and message using SHA3-512 hash, storing the outcome in destination. This is the Aleo variant bits form.

Example Usage

ecdsa.verify.sha3_512 r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33]AddressBoolean
[u8; 65][u8; 33]FieldBoolean
[u8; 65][u8; 33]GroupBoolean
[u8; 65][u8; 33]ScalarBoolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.sha3_512.raw

Back to Top

Description

Verifies an ECDSA signature against a public key and message using SHA3-512 hash, storing the outcome in destination. This variant uses raw bit form without metadata. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.sha3_512.raw r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 33][Address; 8]Boolean
[u8; 65][u8; 33][Field; 8]Boolean
[u8; 65][u8; 33][Group; 8]Boolean
[u8; 65][u8; 33][Scalar; 8]Boolean
[u8; 65][u8; 33]I8Boolean
[u8; 65][u8; 33]I16Boolean
[u8; 65][u8; 33]I32Boolean
[u8; 65][u8; 33]I64Boolean
[u8; 65][u8; 33]I128Boolean
[u8; 65][u8; 33]U8Boolean
[u8; 65][u8; 33]U16Boolean
[u8; 65][u8; 33]U32Boolean
[u8; 65][u8; 33]U64Boolean
[u8; 65][u8; 33]U128Boolean

ecdsa.verify.sha3_512.eth

Back to Top

Description

Verifies an ECDSA signature against a 20-byte Ethereum address and message using SHA3-512 hash, storing the outcome in destination. The address is a 20-byte Ethereum address and the message is in raw form. The message must be byte-aligned (bit length must be a multiple of 8).

Example Usage

ecdsa.verify.sha3_512.eth r0 r1 r2 into r3;

Supported Types

FirstSecondThirdDestination
[u8; 65][u8; 20][Address; 8]Boolean
[u8; 65][u8; 20][Field; 8]Boolean
[u8; 65][u8; 20][Group; 8]Boolean
[u8; 65][u8; 20][Scalar; 8]Boolean
[u8; 65][u8; 20]I8Boolean
[u8; 65][u8; 20]I16Boolean
[u8; 65][u8; 20]I32Boolean
[u8; 65][u8; 20]I64Boolean
[u8; 65][u8; 20]I128Boolean
[u8; 65][u8; 20]U8Boolean
[u8; 65][u8; 20]U16Boolean
[u8; 65][u8; 20]U32Boolean
[u8; 65][u8; 20]U64Boolean
[u8; 65][u8; 20]U128Boolean

shl

Back to Top

Description

Shifts first left by second bits, storing the outcome in destination.

Example Usage

shl r0 r1 into r2;

Supported Types

Magnitude can be a U8, U16, or U32.

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

shl.w

Back to Top

Description

Shifts first left by second bits, wrapping around at the boundary of the type, storing the outcome in destination.

Example Usage

shl.w r0 r1 into r2;

Supported Types

Magnitude can be a U8, U16, or U32.

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

shr

Back to Top

Description

Shifts first right by second bits, storing the outcome in destination.

Example Usage

shr r0 r1 into r2;

Supported Types

Magnitude can be a U8, U16, or U32.

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

shr.w

Back to Top

Description

Shifts first right by second bits, wrapping around at the boundary of the type, storing the outcome in destination.

Example Usage

shr.w r0 r1 into r2;

Supported Types

Magnitude can be a U8, U16, or U32.

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

square

Back to Top

Description

Squares the input, storing the outcome in destination.

Supported Types

InputDestination
FieldField

Example Usage

square r0 into r1;

sqrt

Back to Top

Description

Computes the square root of the input, storing the outcome in destination.

Supported Types

InputDestination
FieldField

Example Usage

sqrt r0 into r1;

sub

Back to Top

Description

Computes first - second, storing the outcome in destination.

Example Usage

sub r0 r1 into r2;

Supported Types

FirstSecondDestination
FieldFieldField
GroupGroupGroup
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

sub.w

Back to Top

Description

Computes first - second, wrapping around at the boundary of the type, and storing the outcome in destination.

Example Usage

sub.w r0 r1 into r2;

Supported Types

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

ternary

Back to Top

Description

Selects first, if condition is true, otherwise selects second, storing the result in destination.

Example: ternary r0 r1 r2 into r3, where r0 is the condition, r1 is first, r2 is second, and r3 is the destination.

Example Usage

ternary r0 r1 r2 into r3;

Supported Types

ConditionFirstSecondDestination
BooleanBooleanBooleanBoolean
BooleanFieldFieldField
BooleanGroupGroupGroup
BooleanI8I8I8
BooleanI16I16I16
BooleanI32I32I32
BooleanI64I64I64
BooleanI128I128I128
BooleanU8U8U8
BooleanU16U16U16
BooleanU32U32U32
BooleanU64U64U64
BooleanU128U128U128
BooleanScalarScalarScalar
BooleanSignatureSignatureSignature

xor

Back to Top

Description

Performs a XOR operation on integer (bitwise) or boolean first and second, storing the outcome in destination.

Example Usage

xor r0 r1 into r2;

Supported Types

FirstSecondDestination
BooleanBooleanBoolean
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

serialize.bits

Back to Top

Description

Serializes a value into a bits array (boolean array), using Aleo variant bits. The input can be various types, and the output must be a boolean array.

Example Usage

serialize.bits r0 (u32) into r1 ([boolean; 32u32]);

Supported Types

InputDestination
Address, Field, Group, Scalar, I8, I16, I32, I64, I128, U8, U16, U32, U64, U128, [U8; N], [U16; N], [U32; N], [U64; N], [U128; N], [I8; N], [I16; N], [I32; N], [I64; N], [I128; N][bool; M]

serialize.bits.raw

Back to Top

Description

Serializes a value into a bits array (boolean array), using raw bits without Aleo variant bits. The input can be various types, and the output must be a boolean array.

Example Usage

serialize.bits.raw r0 (u32) into r1 ([boolean; 32u32]);

Supported Types

InputDestination
Address, Field, Group, Scalar, I8, I16, I32, I64, I128, U8, U16, U32, U64, U128, [U8; N], [U16; N], [U32; N], [U64; N], [U128; N], [I8; N], [I16; N], [I32; N], [I64; N], [I128; N][bool; M]

deserialize.bits

Back to Top

Description

Deserializes a bits array (boolean array) into a value, using Aleo variant bits. The input must be a boolean array, and the output can be various types.

Example Usage

deserialize.bits r0 ([boolean; 256u32]) into r1 as u8;

Supported Types

InputDestination
[bool; N]Address, Field, Group, Scalar, I8, I16, I32, I64, I128, U8, U16, U32, U64, U128, [U8; M], [U16; M], [U32; M], [U64; M], [U128; M], [I8; M], [I16; M], [I32; M], [I64; M], [I128; M]

deserialize.bits.raw

Back to Top

Description

Deserializes a bits array (boolean array) into a value, using raw bits without Aleo variant bits. The input must be a boolean array, and the output can be various types.

Example Usage

deserialize.bits.raw r5 ([boolean; 256u32]) into r6 ([u8; 32u32]);

Supported Types

InputDestination
[bool; N]Address, Field, Group, Scalar, I8, I16, I32, I64, I128, U8, U16, U32, U64, U128, [U8; M], [U16; M], [U32; M], [U64; M], [U128; M], [I8; M], [I16; M], [I32; M], [I64; M], [I128; M]