Aleo 指令
操作码

操作码

以下列表展示了 Aleo 指令支持的标准操作码和密码学操作码。

标准操作码表

Name描述
abs绝对值运算
abs.w回绕绝对值运算
add加法运算
add.w回绕加法运算
and与运算
assert.eq断言相等
assert.neq断言不相等
branch.eq如果参数相等则分支到指定位置
branch.neq如果参数不相等则分支到指定位置
cast字面量之间的类型转换
cast.lossy字面量之间有损截断类型转换
div除法运算
div.w回绕除法运算
double倍乘运算
gt大于比较
gte大于等于比较
inv乘法逆元运算
is.eq相等比较
is.neq不等比较
lt小于比较
lte小于等于比较
mod算术取模运算
mul乘法运算
mul.w回绕乘法运算
nand布尔“与非”运算
neg加法逆元运算
nor布尔“或非”运算
not非运算
or或运算
position位置命令
pow幂运算
pow.w回绕幂运算
rand.chacha在 finalize 作用域内生成一个随机值
rem取余运算
rem.w回绕取余运算
shl左移运算
shl.w回绕左移运算
shr右移运算
shr.w回绕右移运算
sqrt平方根运算
square平方运算
sub减法运算
sub.w回绕减法运算
ternary三元选择运算
xor异或运算
serialize.bits将值序列化为比特数组(Aleo 变体比特)
serialize.bits.raw将值序列化为比特数组(原始比特)
deserialize.bits从比特数组反序列化为值(Aleo 变体比特)
deserialize.bits.raw从比特数组反序列化为值(原始比特)

密码学操作码表

Name描述
commit.bhp256256 位输入的 BHP 承诺
commit.bhp512512 位输入的 BHP 承诺
commit.bhp768768 位输入的 BHP 承诺
commit.bhp10241024 位输入的 BHP 承诺
commit.ped6464 位输入的 Pedersen 承诺
commit.ped128128 位输入的 Pedersen 承诺
hash.bhp256256 位输入的 BHP 哈希
hash.bhp512512 位输入的 BHP 哈希
hash.bhp768768 位输入的 BHP 哈希
hash.bhp10241024 位输入的 BHP 哈希
hash.keccak256256 位输入的 Keccak 哈希
hash.keccak384384 位输入的 Keccak 哈希
hash.keccak512512 位输入的 Keccak 哈希
hash.ped6464 位输入的 Pedersen 哈希
hash.ped128128 位输入的 Pedersen 哈希
hash.psd2输入速率为 2 的 Poseidon 哈希
hash.psd4输入速率为 4 的 Poseidon 哈希
hash.psd8输入速率为 8 的 Poseidon 哈希
hash.sha3_256256 位输入的 SHA3 哈希
hash.sha3_384384 位输入的 SHA3 哈希
hash.sha3_512512 位输入的 SHA3 哈希
hash.bhp256.raw256 位输入的 BHP 哈希(原始比特)
hash.bhp512.raw512 位输入的 BHP 哈希(原始比特)
hash.bhp768.raw768 位输入的 BHP 哈希(原始比特)
hash.bhp1024.raw1024 位输入的 BHP 哈希(原始比特)
hash.keccak256.raw256 位输入的 Keccak 哈希(原始比特)
hash.keccak384.raw384 位输入的 Keccak 哈希(原始比特)
hash.keccak512.raw512 位输入的 Keccak 哈希(原始比特)
hash.ped64.raw64 位输入的 Pedersen 哈希(原始比特)
hash.ped128.raw128 位输入的 Pedersen 哈希(原始比特)
hash.psd2.raw输入速率为 2 的 Poseidon 哈希(原始比特)
hash.psd4.raw输入速率为 4 的 Poseidon 哈希(原始比特)
hash.psd8.raw输入速率为 8 的 Poseidon 哈希(原始比特)
hash.sha3_256.raw256 位输入的 SHA3 哈希(原始比特)
hash.sha3_384.raw384 位输入的 SHA3 哈希(原始比特)
hash.sha3_512.raw512 位输入的 SHA3 哈希(原始比特)
hash.keccak256.native256 位输入的 Keccak 哈希(输出比特数组)
hash.keccak256.native.raw256 位输入的 Keccak 哈希(原始比特,输出比特数组)
hash.keccak384.native384 位输入的 Keccak 哈希(输出比特数组)
hash.keccak384.native.raw384 位输入的 Keccak 哈希(原始比特,输出比特数组)
hash.keccak512.native512 位输入的 Keccak 哈希(输出比特数组)
hash.keccak512.native.raw512 位输入的 Keccak 哈希(原始比特,输出比特数组)
hash.sha3_256.native256 位输入的 SHA3 哈希(输出比特数组)
hash.sha3_256.native.raw256 位输入的 SHA3 哈希(原始比特,输出比特数组)
hash.sha3_384.native384 位输入的 SHA3 哈希(输出比特数组)
hash.sha3_384.native.raw384 位输入的 SHA3 哈希(原始比特,输出比特数组)
hash.sha3_512.native512 位输入的 SHA3 哈希(输出比特数组)
hash.sha3_512.native.raw512 位输入的 SHA3 哈希(原始比特,输出比特数组)
sign.verify验证 Schnorr 签名
ecdsa.verify.digest使用预先计算的摘要验证 ECDSA 签名
ecdsa.verify.digest.eth使用预先计算的摘要验证 ECDSA 签名(以太坊 20 字节地址)
ecdsa.verify.keccak256使用 Keccak-256 验证 ECDSA 签名(Aleo 变体比特)
ecdsa.verify.keccak256.raw使用 Keccak-256 验证 ECDSA 签名(原始比特)
ecdsa.verify.keccak256.eth使用 Keccak-256 验证 ECDSA 签名(原始比特 + 以太坊 20 字节地址)
ecdsa.verify.keccak384使用 Keccak-384 验证 ECDSA 签名(Aleo 变体比特)
ecdsa.verify.keccak384.raw使用 Keccak-384 验证 ECDSA 签名(原始比特)
ecdsa.verify.keccak384.eth使用 Keccak-384 验证 ECDSA 签名(原始比特 + 以太坊 20 字节地址)
ecdsa.verify.keccak512使用 Keccak-512 验证 ECDSA 签名(Aleo 变体比特)
ecdsa.verify.keccak512.raw使用 Keccak-512 验证 ECDSA 签名(原始比特)
ecdsa.verify.keccak512.eth使用 Keccak-512 验证 ECDSA 签名(原始比特 + 以太坊 20 字节地址)
ecdsa.verify.sha3_256使用 SHA3-256 验证 ECDSA 签名(Aleo 变体比特)
ecdsa.verify.sha3_256.raw使用 SHA3-256 验证 ECDSA 签名(原始比特)
ecdsa.verify.sha3_256.eth使用 SHA3-256 验证 ECDSA 签名(原始比特 + 以太坊 20 字节地址)
ecdsa.verify.sha3_384使用 SHA3-384 验证 ECDSA 签名(Aleo 变体比特)
ecdsa.verify.sha3_384.raw使用 SHA3-384 验证 ECDSA 签名(原始比特)
ecdsa.verify.sha3_384.eth使用 SHA3-384 验证 ECDSA 签名(原始比特 + 以太坊 20 字节地址)
ecdsa.verify.sha3_512使用 SHA3-512 验证 ECDSA 签名(Aleo 变体比特)
ecdsa.verify.sha3_512.raw使用 SHA3-512 验证 ECDSA 签名(原始比特)
ecdsa.verify.sha3_512.eth使用 SHA3-512 验证 ECDSA 签名(原始比特 + 以太坊 20 字节地址)
snark.verify在 finalize 作用域内验证 Varuna 证明
snark.verify.batch在 finalize 作用域内批量验证多个 Varuna 证明

规范

以下是 Aleo 虚拟机 (AVM) 中每个操作码的规范。

abs

返回顶部

描述

计算输入的绝对值,检查溢出,将结果存储在目标寄存器中。

对于整数类型,添加约束以检查下溢。如果需要回绕语义,请参阅 abs.w 指令。当下溢发生在有符号整数类型的最小值时会发生此情况。例如,abs -128i8 会导致下溢,因为 128 无法表示为 i8。

示例用法

abs r0 into r1;

支持的类型

InputDestination
I8I8
I16I16
I32I32
I64I64
I128I128

abs.w

返回顶部

描述

计算输入的绝对值,在类型边界处回绕,并将结果存储在目标寄存器中。

示例用法

abs.w r0 into r1;

支持的类型

InputDestination
I8I8
I16I16
I32I32
I64I64
I128I128

add

返回顶部

描述

将 first 与 second 相加,将结果存储在 destination 中。

对于整数类型,添加约束以检查溢出。如果需要整数类型的回绕语义,请参阅 add.w 指令。

示例用法

add r0 r1 into r2;

支持的类型

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

add.w

返回顶部

描述

将 first 与 second 相加,在类型边界处回绕,并将结果存储在 destination 中。

示例用法

add.w r0 r1 into r2;

支持的类型

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

and

返回顶部

描述

对整数(按位)或布尔类型的 first 和 second 执行与运算, 将结果存储在 destination 中。

示例用法

and r0 r1 into r2;

支持的类型

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

assert.eq

返回顶部

描述

检查 first 和 second 是否相等,如果不相等则停止。

示例用法

assert.eq r0 r1;

支持的类型

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

assert.neq

返回顶部

描述

检查 first 和 second 是否不相等,如果相等则停止。

示例用法

assert.neq r0 r1;

支持的类型

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

branch.eq

返回顶部

描述

命令 branch.eq <first> <second> to <destination> 在 first 和 second 相等时将执行分支到 destination 指示的 position。此命令仅限于 finalize 作用域,目标必须跟在命令之后。目前不支持向后分支。

示例用法

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

返回顶部

描述

命令 branch.neq <first> <second> to <destination> 在 first 和 second 不相等时将执行分支到 destination 指示的 position。此命令仅限于 finalize 作用域,目标必须跟在命令之后。目前不支持向后分支。

示例用法

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

返回顶部

描述

允许在不同字面量之间进行类型转换。

示例用法

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

支持的类型

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

返回顶部

描述

执行带有有损截断的类型转换。

示例用法

input r0 as field.private;
cast r0 into r1 as group;
cast r0 into r2 as u8;
cast.lossy r0 into r3 as u8; // r0的低8位被提取到u8中并放入r3中

支持的类型

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

返回顶部

描述

对 first 中 256 位分块的输入以及 second 中的随机数计算 Bowe-Hopwood-Pedersen 承诺,将承诺存储在 destination 中。随机数应始终为 Scalar 值,生成的承诺将始终为 Address、Field 或 Group 值,通过指令末尾的 as 指定。

如果给定输入小于 129 位,编译器将抛出错误。

示例用法

commit.bhp256 r0 r1 into r2 as address;

支持的类型

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

返回顶部

描述

对 first 中 512 位分块的输入以及 second 中的随机数计算 Bowe-Hopwood-Pedersen 承诺,将承诺存储在 destination 中。随机数应始终为 Scalar 值,生成的承诺将始终为 Address、Field 或 Group 值,通过指令末尾的 as 指定。

如果给定输入小于 171 位,编译器将抛出错误。

示例用法

commit.bhp512 r0 r1 into r2 as field;

支持的类型

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

返回顶部

描述

对 first 中 768 位分块的输入以及 second 中的随机数计算 Bowe-Hopwood-Pedersen 承诺,将承诺存储在 destination 中。随机数应始终为 Scalar 值,生成的承诺将始终为 Address、Field 或 Group 值,通过指令末尾的 as 指定。

如果给定输入小于 129 位,编译器将抛出错误。

示例用法

commit.bhp768 r0 r1 into r2 as group;

支持的类型

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

返回顶部

描述

对 first 中 1024 位分块的输入以及 second 中的随机数计算 Bowe-Hopwood-Pedersen 承诺,将承诺存储在 destination 中。随机数应始终为 Scalar 值,生成的承诺将始终为 Address、Field 或 Group 值,通过指令末尾的 as 指定。

如果给定输入小于 171 位,编译器将抛出错误。

示例用法

commit.bhp1024 r0 r1 into r2 as address;

支持的类型

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

返回顶部

描述

对 first 中最大 64 位的输入以及 second 中的随机数计算 Pedersen 承诺,将承诺存储在 destination 中。随机数应始终为 Scalar 值,生成的承诺为 Address、Field 或 Group 值,通过指令末尾的 as 指定。

如果给定的 Struct 值超过 64 位限制,编译器将抛出错误。

示例用法

commit.ped64 r0 r1 into r2 as field;

支持的类型

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

返回顶部

描述

对 first 中最大 128 位的输入以及 second 中的随机数计算 Pedersen 承诺,将承诺存储在 destination 中。随机数应始终为 Scalar 值,生成的承诺为 Address、Field 或 Group 值,通过指令末尾的 as 指定。

如果给定的 Struct 值超过 128 位限制,编译器将抛出错误。

示例用法

commit.ped128 r0 r1 into r2 as group;

支持的类型

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

返回顶部

描述

将 first 除以 second,将结果存储在 destination 中。除以零时停止。

对于整数类型,此运算执行截断除法。此外,添加约束以检查下溢。当下溢发生在有符号整数类型的最小值除以 -1 时。例如,div -128i8 -1i8 会导致下溢,因为 128 无法表示为 i8。

如果需要整数类型的回绕语义,请参阅 div.w 指令。

示例用法

div r0 r1 into r2;

支持的类型

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

div.w

返回顶部

描述

将 first 除以 second,在类型边界处回绕,并将结果存储在 destination 中。

示例用法

div.w r0 r1 into r2;

支持的类型

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

double

返回顶部

描述

将输入加倍,将结果存储在 destination 中。

示例用法

double r0 into r1;

支持的类型

InputDestination
FieldField
GroupGroup

gt

返回顶部

描述

检查 first 是否大于 second,将结果存储在 destination 中。

示例用法

gt r0 r1 into r2;

支持的类型

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

gte

返回顶部

描述

检查 first 是否大于等于 second,将结果存储在 destination 中。

示例用法

gte r0 r1 into r2;

支持的类型

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

hash.bhp256

返回顶部

描述

对 first 中 256 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 129 位,编译器将抛出错误。

示例用法

hash.bhp256 r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中 512 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 171 位,编译器将抛出错误。

示例用法

hash.bhp512 r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 中 768 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 129 位,编译器将抛出错误。

示例用法

hash.bhp768 r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中 1024 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 171 位,编译器将抛出错误。

示例用法

hash.bhp1024 r0 into r1 as scalar;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 256 位摘要存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.keccak256 r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 384 位摘要存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.keccak384 r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 512 位摘要存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.keccak512 r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中最大 64 位的输入计算 Pedersen 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定的 Struct 值超过 64 位限制,编译器将抛出错误。

示例用法

hash.ped64 r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中最大 128 位的输入计算 Pedersen 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定的 Struct 值超过 128 位限制,编译器将抛出错误。

示例用法

hash.ped128 r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 中的输入计算输入速率为 2 的 Poseidon 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.psd2 r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中的输入计算输入速率为 4 的 Poseidon 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.psd4 r0 into r1 as scalar;

支持的类型

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

返回顶部

描述

对 first 中的输入计算输入速率为 8 的 Poseidon 哈希,将哈希存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.psd8 r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-256 哈希,将 256 位摘要存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.sha3_256 r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-384 哈希,将 384 位摘要存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.sha3_384 r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-512 哈希,将 512 位摘要存储在 destination 中。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.sha3_512 r0 into r1 as scalar;

支持的类型

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

返回顶部

描述

对 first 中 256 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 129 位,编译器将抛出错误。

示例用法

hash.bhp256.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中 512 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 171 位,编译器将抛出错误。

示例用法

hash.bhp512.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中 768 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 213 位,编译器将抛出错误。

示例用法

hash.bhp768.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中 1024 位分块的输入计算 Bowe-Hopwood-Pedersen 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定输入小于 255 位,编译器将抛出错误。

示例用法

hash.bhp1024.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 256 位摘要存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.keccak256.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 384 位摘要存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.keccak384.raw r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 512 位摘要存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.keccak512.raw r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 中最大 64 位的输入计算 Pedersen 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定的 Struct 值超过 64 位限制,编译器将抛出错误。

示例用法

hash.ped64.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中最大 128 位的输入计算 Pedersen 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

如果给定的 Struct 值超过 128 位限制,编译器将抛出错误。

示例用法

hash.ped128.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中的输入计算输入速率为 2 的 Poseidon 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.psd2.raw r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中的输入计算输入速率为 4 的 Poseidon 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.psd4.raw r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中的输入计算输入速率为 8 的 Poseidon 哈希,将哈希存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.psd8.raw r0 into r1 as address;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-256 哈希,将 256 位摘要存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.sha3_256.raw r0 into r1 as field;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-384 哈希,将 384 位摘要存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.sha3_384.raw r0 into r1 as group;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-512 哈希,将 512 位摘要存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特。生成的哈希将始终为算术类型(U8、U16、U32、U64、U128、I8、I16、I32、I64、I128、Field、Group 或 Scalar)或 Address 值,通过指令末尾的 as 指定。

示例用法

hash.sha3_512.raw r0 into r1 as scalar;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 256 位摘要作为比特数组存储在 destination 中。此变体执行底层哈希并返回比特数组 [bool; 256]。

示例用法

hash.keccak256.native r0 into r1;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 256 位摘要作为比特数组存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特,并执行底层哈希返回比特数组 [bool; 256]。

示例用法

hash.keccak256.native.raw r0 into r1;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 384 位摘要作为比特数组存储在 destination 中。此变体执行底层哈希并返回比特数组 [bool; 384]。

示例用法

hash.keccak384.native r0 into r1;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 384 位摘要作为比特数组存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特,并执行底层哈希返回比特数组 [bool; 384]。

示例用法

hash.keccak384.native.raw r0 into r1;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 512 位摘要作为比特数组存储在 destination 中。此变体执行底层哈希并返回比特数组 [bool; 512]。

示例用法

hash.keccak512.native r0 into r1;

支持的类型

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

返回顶部

描述

对 first 执行 Keccak 哈希,将 512 位摘要作为比特数组存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特,并执行底层哈希返回比特数组 [bool; 512]。

示例用法

hash.keccak512.native.raw r0 into r1;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-256 哈希,将 256 位摘要作为比特数组存储在 destination 中。此变体执行底层哈希并返回比特数组 [bool; 256]。

示例用法

hash.sha3_256.native r0 into r1;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-256 哈希,将 256 位摘要作为比特数组存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特,并执行底层哈希返回比特数组 [bool; 256]。

示例用法

hash.sha3_256.native.raw r0 into r1;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-384 哈希,将 384 位摘要作为比特数组存储在 destination 中。此变体执行底层哈希并返回比特数组 [bool; 384]。

示例用法

hash.sha3_384.native r0 into r1;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-384 哈希,将 384 位摘要作为比特数组存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特,并执行底层哈希返回比特数组 [bool; 384]。

示例用法

hash.sha3_384.native.raw r0 into r1;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-512 哈希,将 512 位摘要作为比特数组存储在 destination 中。此变体执行底层哈希并返回比特数组 [bool; 512]。

示例用法

hash.sha3_512.native r0 into r1;

支持的类型

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

返回顶部

描述

对 first 中的输入计算 SHA3-512 哈希,将 512 位摘要作为比特数组存储在 destination 中。此变体使用原始比特形式,不含 Aleo 变体比特,并执行底层哈希返回比特数组 [bool; 512]。

示例用法

hash.sha3_512.native.raw r0 into r1;

支持的类型

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

返回顶部

描述

计算输入的乘法逆元,将结果存储在 destination 中。

示例用法

inv r0 into r1;

支持的类型

InputDestination
FieldField

is.eq

返回顶部

描述

比较 first 和 second,将结果存储在 destination 中。

示例用法

is.eq r0 r1 into r2;

支持的类型

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

is.neq

返回顶部

描述

如果 first 不等于 second 则返回 true,将结果存储在 destination 中。

示例用法

is.neq r0 r1 into r2;

支持的类型

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

lt

返回顶部

描述

检查 first 是否小于 second,将结果存储在 destination 中。

示例用法

lt r0 r1 into r2;

支持的类型

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

lte

返回顶部

描述

检查 first 是否小于等于 second,将结果存储在 destination 中。

示例用法

lte r0 r1 into r2;

支持的类型

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

mod

返回顶部

描述

计算 first 对 second 的模,将结果存储在 destination 中。如果 second 为零则停止。

此运算的语义与模运算的数学定义一致。

示例用法

mod r0 r1 into r2;

支持的类型

FirstSecondDestination
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

mul

返回顶部

描述

将 first 与 second 相乘,将结果存储在 destination 中。

对于整数类型,添加约束以检查溢出/下溢。如果需要整数类型的回绕语义,请参阅 mul.w 指令。

示例用法

mul r0 r1 into r2;

支持的类型

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

mul.w

返回顶部

描述

将 first 与 second 相乘,在类型边界处回绕,并将结果存储在 destination 中。

示例用法

mul.w r0 r1 into r2;

支持的类型

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

nand

返回顶部

描述

仅当 first 和 second 均为 true 时返回 false,将结果存储在 destination 中。

示例用法

nand r0 r1 into r2;

支持的类型

FirstSecondDestination
BooleanBooleanBoolean

neg

返回顶部

描述

对 first 取反,将结果存储在 destination 中。

对于有符号整数类型,对最小值调用 neg 是无效操作。例如,输入 -128i8 无效,因为 128 无法表示为 i8。

示例用法

neg r0 into r1;

支持的类型

InputDestination
FieldField
GroupGroup
I8I8
I16I16
I32I32
I64I64
I128I128

nor

返回顶部

描述

当 first 和 second 均不为 true 时返回 true,将结果存储在 destination 中。

示例用法

nor r0 r1 into r2;

支持的类型

FirstSecondDestination
BooleanBooleanBoolean

not

返回顶部

描述

对整数(按位)或布尔输入执行非运算,将结果存储在 destination 中。

示例用法

not r0 into r1;

支持的类型

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

or

返回顶部

描述

对整数(按位)或布尔类型的 first 和 second 执行或运算,将结果存储在 destination 中。

示例用法

or r0 r1 into r2;

支持的类型

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

position

返回顶部

描述

位置声明,例如 position <name>,表示程序中要分支执行到的位置 name。
位置必须是小写字母数字字符串。

示例用法

position skip;

pow

返回顶部

描述

计算 first 的 second 次幂,将结果存储在 destination 中。

对于整数类型,添加约束以检查溢出/下溢。如果需要整数类型的回绕语义,请参阅 pow.w 指令。

示例用法

pow r0 r1 into r2;

支持的类型

Magnitude 可以是 U8、U16 或 U32。

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

pow.w

返回顶部

描述

计算 first 的 second 次幂,在类型边界处回绕,将结果存储在 destination 中。

示例用法

pow.w r0 r1 into r2;

支持的类型

Magnitude 可以是 U8、U16 或 U32。

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

rand.chacha

返回顶部

描述

rand.chacha 操作码用于在 finalize 作用域内生成随机值。它支持多种类型的随机值。

示例用法

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;

支持的类型

Single 可以是以下任意类型:Address、Boolean、Field、Group、I8、I16、I32、I64、I128、U8、U16、U32、U64、U128 或 Scalar。不允许使用结构体和映射等复合数据类型。

FirstSecondDestination
SingleSingleSingle

rem

返回顶部

描述

计算 first 除以 second 的截断余数,将结果存储在 destination 中。除以零时停止。

添加约束以检查下溢。当下溢发生在关联的除法运算 div 下溢时会发生此情况。

如果需要整数类型的回绕语义,请参阅 rem.w 指令。

示例用法

rem r0 r1 into r2;

支持的类型

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

rem.w

返回顶部

描述

计算 first 除以 second 的截断余数,在类型边界处回绕,并将结果存储在 destination 中。

示例用法

rem.w r0 r1 into r2;

支持的类型

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

sign.verify

返回顶部

描述

验证签名 first 针对地址公钥 second 和消息 third,将结果存储在 destination 中。

示例用法

sign.verify r0 r1 r2 into r3;

支持的类型

FirstSecondThirdDestination
SignatureAddressArray of FieldBoolean

ecdsa.verify.digest

返回顶部

描述

验证 ECDSA 签名针对 33 字节 ECDSA 地址和预计算消息摘要,将结果存储在 destination 中。地址和摘要均为原始形式。摘要必须是 32 字节数组。

示例用法

ecdsa.verify.digest r0 r1 r2 into r3;

支持的类型

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

ecdsa.verify.digest.eth

返回顶部

描述

验证 ECDSA 签名针对 20 字节以太坊地址和预计算消息摘要,将结果存储在 destination 中。地址和摘要均为原始形式。摘要必须是 32 字节数组。

示例用法

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

支持的类型

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

ecdsa.verify.keccak256

返回顶部

描述

使用 Keccak-256 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。这是 Aleo 变体比特形式。

示例用法

ecdsa.verify.keccak256 r0 r1 r2 into r3;

支持的类型

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

返回顶部

描述

使用 Keccak-256 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。此变体使用原始比特形式,不含元数据。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 Keccak-256 哈希验证 ECDSA 签名针对 20 字节以太坊地址和消息,将结果存储在 destination 中。地址为 20 字节以太坊地址,消息为原始形式。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 Keccak-384 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。这是 Aleo 变体比特形式。

示例用法

ecdsa.verify.keccak384 r0 r1 r2 into r3;

支持的类型

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

返回顶部

描述

使用 Keccak-384 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。此变体使用原始比特形式,不含元数据。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 Keccak-384 哈希验证 ECDSA 签名针对 20 字节以太坊地址和消息,将结果存储在 destination 中。地址为 20 字节以太坊地址,消息为原始形式。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 Keccak-512 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。这是 Aleo 变体比特形式。

示例用法

ecdsa.verify.keccak512 r0 r1 r2 into r3;

支持的类型

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

返回顶部

描述

使用 Keccak-512 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。此变体使用原始比特形式,不含元数据。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 Keccak-512 哈希验证 ECDSA 签名针对 20 字节以太坊地址和消息,将结果存储在 destination 中。地址为 20 字节以太坊地址,消息为原始形式。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 SHA3-256 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。这是 Aleo 变体比特形式。

示例用法

ecdsa.verify.sha3_256 r0 r1 r2 into r3;

支持的类型

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

返回顶部

描述

使用 SHA3-256 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。此变体使用原始比特形式,不含元数据。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 SHA3-256 哈希验证 ECDSA 签名针对 20 字节以太坊地址和消息,将结果存储在 destination 中。地址为 20 字节以太坊地址,消息为原始形式。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 SHA3-384 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。这是 Aleo 变体比特形式。

示例用法

ecdsa.verify.sha3_384 r0 r1 r2 into r3;

支持的类型

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

返回顶部

描述

使用 SHA3-384 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。此变体使用原始比特形式,不含元数据。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 SHA3-384 哈希验证 ECDSA 签名针对 20 字节以太坊地址和消息,将结果存储在 destination 中。地址为 20 字节以太坊地址,消息为原始形式。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 SHA3-512 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。这是 Aleo 变体比特形式。

示例用法

ecdsa.verify.sha3_512 r0 r1 r2 into r3;

支持的类型

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

返回顶部

描述

使用 SHA3-512 哈希验证 ECDSA 签名针对公钥和消息,将结果存储在 destination 中。此变体使用原始比特形式,不含元数据。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

使用 SHA3-512 哈希验证 ECDSA 签名针对 20 字节以太坊地址和消息,将结果存储在 destination 中。地址为 20 字节以太坊地址,消息为原始形式。消息必须字节对齐(比特长度必须是 8 的倍数)。

示例用法

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

支持的类型

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

返回顶部

描述

将 first 左移 second 位,将结果存储在 destination 中。

示例用法

shl r0 r1 into r2;

支持的类型

Magnitude 可以是 U8、U16 或 U32。

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

shl.w

返回顶部

描述

将 first 左移 second 位,在类型边界处回绕,将结果存储在 destination 中。

示例用法

shl.w r0 r1 into r2;

支持的类型

Magnitude 可以是 U8、U16 或 U32。

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

shr

返回顶部

描述

将 first 右移 second 位,将结果存储在 destination 中。

示例用法

shr r0 r1 into r2;

支持的类型

Magnitude 可以是 U8、U16 或 U32。

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

shr.w

返回顶部

描述

将 first 右移 second 位,在类型边界处回绕,将结果存储在 destination 中。

示例用法

shr.w r0 r1 into r2;

支持的类型

Magnitude 可以是 U8、U16 或 U32。

FirstSecondDestination
I8MagnitudeI8
I16MagnitudeI16
I32MagnitudeI32
I64MagnitudeI64
I128MagnitudeI128
U8MagnitudeU8
U16MagnitudeU16
U32MagnitudeU32
U64MagnitudeU64
U128MagnitudeU128

square

返回顶部

描述

对输入求平方,将结果存储在 destination 中。

支持的类型

InputDestination
FieldField

示例用法

square r0 into r1;

sqrt

返回顶部

描述

计算输入的平方根,将结果存储在 destination 中。

支持的类型

InputDestination
FieldField

示例用法

sqrt r0 into r1;

sub

返回顶部

描述

计算 first - second,将结果存储在 destination 中。

示例用法

sub r0 r1 into r2;

支持的类型

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

sub.w

返回顶部

描述

计算 first - second,在类型边界处回绕,并将结果存储在 destination 中。

示例用法

sub.w r0 r1 into r2;

支持的类型

FirstSecondDestination
I8I8I8
I16I16I16
I32I32I32
I64I64I64
I128I128I128
U8U8U8
U16U16U16
U32U32U32
U64U64U64
U128U128U128

ternary

返回顶部

描述

如果 condition 为 true 则选择 first,否则选择 second,将结果存储在 destination 中。

示例:ternary r0 r1 r2 into r3,其中 r0 是条件,r1 是 first,r2 是 second,r3 是目标。

示例用法

ternary r0 r1 r2 into r3;

支持的类型

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

xor

返回顶部

描述

对整数(按位)或布尔类型的 first 和 second 执行异或运算,将结果存储在 destination 中。

示例用法

xor r0 r1 into r2;

支持的类型

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

serialize.bits

返回顶部

描述

将值序列化为比特数组(布尔数组),使用 Aleo 变体比特。输入可以是多种类型,输出必须是布尔数组。

示例用法

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

支持的类型

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

返回顶部

描述

将值序列化为比特数组(布尔数组),使用不含 Aleo 变体比特的原始比特。输入可以是多种类型,输出必须是布尔数组。

示例用法

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

支持的类型

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

返回顶部

描述

将比特数组(布尔数组)反序列化为值,使用 Aleo 变体比特。输入必须是布尔数组,输出可以是多种类型。

示例用法

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

支持的类型

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

返回顶部

描述

将比特数组(布尔数组)反序列化为值,使用不含 Aleo 变体比特的原始比特。输入必须是布尔数组,输出可以是多种类型。

示例用法

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

支持的类型

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]

snark.verify

返回顶部

描述

验证 Varuna 证明 third 针对验证密钥 first 和公开输入 second,将布尔结果存储在 destination 中。此操作码仅限 finalize 使用,必须在 finalize 块内调用。在 Aleo Stack v4.6.0 中引入,作为 ARC-0008 (opens in a new tab) 的一部分。

示例用法

snark.verify r0 r1 r2 into r3;

支持的类型

First (verifying key)Second (public inputs)Third (proof)Destination
[U8; N][Field; M][U8; P]Boolean

:::note snark.verify 仅在 finalize 块内有效。 :::


snark.verify.batch

返回顶部

描述

批量验证多个 Varuna 证明,针对验证密钥数组 first、嵌套的公开输入数组 second 和单个批量证明 third,将布尔结果存储在 destination 中。此操作码仅限 finalize 使用,必须在 finalize 块内调用。在 Aleo Stack v4.6.0 中引入,作为 ARC-0008 (opens in a new tab) 的一部分。

编译时限制适用:最多 32 个电路,所有电路最多 128 个实例。

示例用法

snark.verify.batch r0 r1 r2 into r3;

操作数

操作数类型描述
r0[[U8; N]; num_keys]验证密钥数组
r1[[[Field; M]; num_instances]; num_keys]每个电路每个密钥的嵌套公开输入数组
r2[U8; P]批量证明
r3Boolean批量验证结果

:::note snark.verify.batch 仅在 finalize 块内有效。 :::