Module syscalls

Module syscalls 

Source

Constants§

BLS12381_ADD
Executes the BLS12381_ADD precompile.
BLS12381_DECOMPRESS
Executes BLS12381_DECOMPRESS.
BLS12381_DOUBLE
Executes the BLS12381_DOUBLE precompile.
BLS12381_FP2_ADD
Executes the BLS12381_FP2_ADD precompile.
BLS12381_FP2_MUL
Executes the BLS12381_FP2_MUL precompile.
BLS12381_FP2_SUB
Executes the BLS12381_FP2_SUB precompile.
BLS12381_FP_ADD
Executes the BLS12381_FP_ADD precompile.
BLS12381_FP_MUL
Executes the BLS12381_FP_MUL precompile.
BLS12381_FP_SUB
Executes the BLS12381_FP_SUB precompile.
BN254_ADD
Executes BN254_ADD.
BN254_DOUBLE
Executes BN254_DOUBLE.
BN254_FP2_ADD
Executes the BN254_FP2_ADD precompile.
BN254_FP2_MUL
Executes the BN254_FP2_MUL precompile.
BN254_FP2_SUB
Executes the BN254_FP2_SUB precompile.
BN254_FP_ADD
Executes the BN254_FP_ADD precompile.
BN254_FP_MUL
Executes the BN254_FP_MUL precompile.
BN254_FP_SUB
Executes the BN254_FP_SUB precompile.
COMMIT
Executes the COMMIT precompile.
COMMIT_DEFERRED_PROOFS
Executes the COMMIT_DEFERRED_PROOFS precompile.
ED_ADD
Executes ED_ADD.
ED_DECOMPRESS
Executes ED_DECOMPRESS.
ENTER_UNCONSTRAINED
Enter an unconstrained execution block.
EXIT_UNCONSTRAINED
Exit an unconstrained execution block.
HALT
These codes MUST match the codes in core/src/runtime/syscall.rs. There is a derived test that checks that the enum is consistent with the syscalls.
HINT_LEN
Executes HINT_LEN.
HINT_READ
Executes HINT_READ.
KECCAK_PERMUTE
Executes KECCAK_PERMUTE.
MAX_MEMORY
SECP256K1_ADD
Executes SECP256K1_ADD.
SECP256K1_DECOMPRESS
Executes K256_DECOMPRESS.
SECP256K1_DOUBLE
Executes SECP256K1_DOUBLE.
SECP256R1_ADD
Executes SECP256R1_ADD.
SECP256R1_DECOMPRESS
Executes SECP256R1_DECOMPRESS.
SECP256R1_DOUBLE
Executes SECP256R1_DOUBLE.
SHA_COMPRESS
Executes SHA_COMPRESS.
SHA_EXTEND
Executes SHA_EXTEND.
U256XU2048_MUL
Executes U256XU2048_MUL.
UINT256_MUL
Executes the UINT256_MUL precompile.
VERIFY_MONEROCHAN_PROOF
Executes the VERIFY_MONEROCHAN_PROOF precompile.
WRITE
Writes to a file descriptor. Currently only used for STDOUT/STDERR.

Functions§

sys_alloc_words
sys_bigint
Sets result to be (x op y) % modulus.
sys_getenv
sys_panic
sys_rand
Generates random bytes.
sys_write
syscall_bls12381_add
Adds two Bls12381 points.
syscall_bls12381_decompress
Decompresses a compressed BLS12-381 point.
syscall_bls12381_double
Double a Bls12381 point.
syscall_bls12381_fp2_addmod
BLS12-381 Fp2 addition operation.
syscall_bls12381_fp2_mulmod
BLS12-381 Fp2 multiplication operation.
syscall_bls12381_fp2_submod
BLS12-381 Fp2 subtraction operation.
syscall_bls12381_fp_addmod
Fp addition operation.
syscall_bls12381_fp_mulmod
Fp multiplication operation.
syscall_bls12381_fp_submod
Fp subtraction operation.
syscall_bn254_add
Adds two Bn254 points.
syscall_bn254_double
Double a Bn254 point.
syscall_bn254_fp2_addmod
BN254 Fp2 addition operation.
syscall_bn254_fp2_mulmod
BN254 Fp2 multiplication operation.
syscall_bn254_fp2_submod
BN254 Fp2 subtraction operation.
syscall_bn254_fp_addmod
Fp addition operation.
syscall_bn254_fp_mulmod
Fp multiplication operation.
syscall_bn254_fp_submod
Fp subtraction operation.
syscall_ed_add
Adds two Edwards points.
syscall_ed_decompress
Decompresses a compressed Edwards point.
syscall_enter_unconstrained
syscall_exit_unconstrained
syscall_halt
Halts the program with the given exit code.
syscall_hint_len
Returns the length of the next element in the hint stream.
syscall_hint_read
Reads the next element in the hint stream into the given buffer.
syscall_keccak_permute
Executes the Keccak256 permutation on the given state.
syscall_secp256k1_add
Adds two Secp256k1 points.
syscall_secp256k1_decompress
Decompresses a compressed Secp256k1 point.
syscall_secp256k1_double
Double a Secp256k1 point.
syscall_secp256r1_add
Adds two Secp256k1 points.
syscall_secp256r1_decompress
Decompresses a compressed Secp256k1 point.
syscall_secp256r1_double
Double a Secp256k1 point.
syscall_sha256_compress
Executes the SHA256 compress operation on the given word array and a given state.
syscall_sha256_extend
Executes the SHA256 extend operation on the given word array.
syscall_u256x2048_mul
Multiplication operation between a 256-bit and a 2048-bit unsigned integer.
syscall_uint256_mulmod
Uint256 multiplication operation.
syscall_write
Write nbytes of data to the prover to a given file descriptor fd from write_buf.
used_memory
Used memory in bytes.