Skip to main content
Version: Next

crypto

Cryptographic primitives

blake2b: (_: bytes) => bytes

Compute the cryptographic hash of the top of the stack using the Blake2b-256 cryptographic hash function.

sha256: (_: bytes) => bytes

Compute the cryptographic hash of the top of the stack using the SHA-256 cryptographic hash function.

sha512: (_: bytes) => bytes

Compute the cryptographic hash of the top of the stack using the SHA-512 cryptographic hash function.

sha3: (_: bytes) => bytes

Compute the cryptographic hash of the top of the stack using the SHA3-256 cryptographic hash function.

keccak: (_: bytes) => bytes

Compute the cryptographic hash of the top of the stack using the Keccak-256 cryptographic hash function.

hash_key: (_: key) => key_hash

The call hash_key(k) computes the Base58Check of the public key k.

check: (key: key, sig: signature, bytes: bytes) => bool

The call Crypto.check(k, s, b) verifies that the byte sequence b has been signed with the key k: it is true if, and only if, the signature s is a valid signature of the byte sequence created with k.