Expand description
Syscalls for the SP1 zkVM.
Documentation for these syscalls can be found in the zkVM entrypoint
sp1_zkvm::syscalls
module.
Modules§
- bls12381
- bn254
- ecdsa
- An implementation of the types needed for
CurveArithmetic
. - ed25519
- io
- secp256k1
- secp256r1
- unconstrained
- utils
Macros§
- unconstrained
- Executes a block of code unconstrained by the VM. This macro is useful for running code that
helps provide information to the program but does not need to be constrained by the VM. For
example, running
ecrecover
is expensive in the VM but verifying a signature when you know the public key is not.unconstrained
can be used to provide the public key without spending VM CPU cycles.
Structs§
Functions§
- read_
vec_ ⚠raw - Reads a buffer from the input stream.
- sys_
alloc_ ⚠aligned - Allocates a buffer aligned to the given alignment.
- sys_
bigint ⚠ - Computes a big integer operation with a modulus.
- syscall_
bls12381_ ⚠add - Executes a BLS12-381 curve addition on the given points.
- syscall_
bls12381_ ⚠decompress - Decompresses a BLS12-381 point.
- syscall_
bls12381_ ⚠double - Executes a BLS12-381 curve doubling on the given point.
- syscall_
bls12381_ ⚠fp2_ addmod - Executes a BLS12-381 Fp2 addition on the given inputs.
- syscall_
bls12381_ ⚠fp2_ mulmod - Executes a BLS12-381 Fp2 multiplication on the given inputs.
- syscall_
bls12381_ ⚠fp2_ submod - Executes a BLS12-381 Fp2 subtraction on the given inputs.
- syscall_
bls12381_ ⚠fp_ addmod - Executes a BLS12-381 field addition on the given inputs.
- syscall_
bls12381_ ⚠fp_ mulmod - Executes a BLS12-381 field multiplication on the given inputs.
- syscall_
bls12381_ ⚠fp_ submod - Executes a BLS12-381 field subtraction on the given inputs.
- syscall_
bn254_ ⚠add - Executes a Bn254 curve addition on the given points.
- syscall_
bn254_ ⚠double - Executes a Bn254 curve doubling on the given point.
- syscall_
bn254_ ⚠fp2_ addmod - Executes a BN254 Fp2 addition on the given inputs.
- syscall_
bn254_ ⚠fp2_ mulmod - Executes a BN254 Fp2 multiplication on the given inputs.
- syscall_
bn254_ ⚠fp2_ submod - Executes a BN254 Fp2 subtraction on the given inputs.
- syscall_
bn254_ ⚠fp_ addmod - Executes a BN254 field addition on the given inputs.
- syscall_
bn254_ ⚠fp_ mulmod - Executes a BN254 field multiplication on the given inputs.
- syscall_
bn254_ ⚠fp_ submod - Executes a BN254 field subtraction on the given inputs.
- syscall_
ed_ ⚠add - Executes an Ed25519 curve addition on the given points.
- syscall_
ed_ ⚠decompress - Executes an Ed25519 curve decompression on the given point.
- syscall_
enter_ ⚠unconstrained - Enters unconstrained mode.
- syscall_
exit_ ⚠unconstrained - Exits unconstrained mode.
- 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 Keccak-256 permutation on the given state.
- syscall_
read ⚠ - Reads the bytes from the given file descriptor into the given buffer.
- syscall_
secp256k1_ ⚠add - Executes an Sepc256k1 curve addition on the given points.
- syscall_
secp256k1_ ⚠decompress - Executes an Secp256k1 curve decompression on the given point.
- syscall_
secp256k1_ ⚠double - Executes an Secp256k1 curve doubling on the given point.
- syscall_
secp256r1_ ⚠add - Executes an Secp256r1 curve addition on the given points.
- syscall_
secp256r1_ ⚠decompress - Executes an Secp256r1 curve decompression on the given point.
- syscall_
secp256r1_ ⚠double - Executes an Secp256r1 curve doubling on the given point.
- syscall_
sha256_ ⚠compress - Executes the SHA-256 compress operation on the given word array and a given state.
- syscall_
sha256_ ⚠extend - Executes the SHA-256 extend operation on the given word array.
- syscall_
u256x2048_ ⚠mul - Executes a 256-bit by 2048-bit multiplication on the given inputs.
- syscall_
uint256_ ⚠mulmod - Executes an uint256 multiplication on the given inputs.
- syscall_
verify_ ⚠sp1_ proof - Defers the verification of a valid SP1 zkVM proof.
- syscall_
write ⚠ - Writes the bytes in the given buffer to the given file descriptor.