criptolib¶
- class CryptoLib¶
Bases:
object
A class used to represent the CryptoLib native contract
- classmethod murmur32(data: bytes, seed: int) → bytes¶
Computes the hash value for the specified byte array using the murmur32 algorithm.
- classmethod sha256(key: Any) → bytes¶
Encrypts a key using SHA-256.
- Parameters
key (Any) – the key to be encrypted
- Returns
a byte value that represents the encrypted key
- Return type
- classmethod ripemd160(key: Any) → bytes¶
Encrypts a key using RIPEMD-160.
- Parameters
key (Any) – the key to be encrypted
- Returns
a byte value that represents the encrypted key
- Return type
- classmethod verify_with_ecdsa(message: bytes, pubkey: boa3.builtin.type.ECPoint, signature: bytes, curve: boa3.internal.neo3.contracts.namedcurve.NamedCurve) → bool¶
Using the elliptic curve, it checks if the signature of the message was originally produced by the public key.
- Parameters
message (bytes) – the encrypted message
pubkey (ECPoint) – the public key that might have created the item
signature (bytes) – the signature of the item
curve (NamedCurve) – the curve that will be used by the ecdsa
- Returns
a boolean value that represents whether the signature is valid
- Return type
- class NamedCurve(value)¶
Bases:
enum.IntFlag
Represents the named curve used in ECDSA.
- SECP256K1¶
The secp256k1 curve.
- SECP256R1¶
The secp256r1 curve, which known as prime256v1 or nistP-256.