PlatformSpecific
scalus.builtin.PlatformSpecific
trait PlatformSpecific
This is the platform specific part of the builtins. This is mostly cryptographic primitives that have different implementations on different platforms.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait JVMPlatformSpecificobject JVMPlatformSpecific
Members list
Value members
Abstract methods
Verify an ECDSA signature made using the SECP256k1 curve.
Verify an ECDSA signature made using the SECP256k1 curve.
Value parameters
- msg
-
Message (32 bytes)
- pk
-
Public key (33 bytes)
- sig
-
Signature (64 bytes)
Attributes
- Note
-
There are additional well-formation requirements for the arguments beyond their length:
- The first byte of the public key must correspond to the sign of the
ycoordinate: this is0x02ifyis even, and0x03otherwise. - The remaining bytes of the public key must correspond to the
xcoordinate, as a big-endian integer. - The first 32 bytes of the signature must correspond to the big-endian integer representation of r.
- The last 32 bytes of the signature must correspond to the big-endian integer representation of s. While this primitive
acceptsa hash, any caller should only pass it hashes that they computed themselves: specifically, they should receive themessagefrom a sender and hash it, rather than receiving thehashfrom said sender. Failure to do so can be dangerous. Other than length, we make no requirements of what hash gets used.
- The first byte of the public key must correspond to the sign of the
Verify a Schnorr signature made using the SECP256k1 curve.
Verify a Schnorr signature made using the SECP256k1 curve.
Value parameters
- msg
-
Message (arbitrary length)
- pk
-
Public key (32 bytes)
- sig
-
Signature (64 bytes)
Attributes
- See also
- Note
-
There are additional well-formation requirements for the arguments beyond their length. Throughout, we refer to co-ordinates of the point
R.- The bytes of the public key must correspond to the
xcoordinate, as a big-endian integer, as specified in BIP-340. - The first 32 bytes of the signature must correspond to the
xcoordinate, as a big-endian integer, as specified in BIP-340. - The last 32 bytes of the signature must correspond to the bytes of
s, as a big-endian integer, as specified in BIP-340.
- The bytes of the public key must correspond to the
In this article