canton-network-docs
DA.Crypto.Text
DA.Crypto.Text - Canton Network Docs
Skip to main content
A DER formatted public key to be used for ECDSA signature verification
A DER formatted SECP256K1 signature
Methods:
Methods:
Computes the SHA256 hash of the decoded UTF8 bytes of the
Computes the KECCAK256 hash of the UTF8 bytes of the
Validate the SECP256K1 signature given a hex encoded message and a hex encoded DER formatted public key.
Validate the SECP256K1 signature given a SHA256 hash of a hex encoded message and a hex encoded DER formatted public key.
Number of bytes present in a byte encoded string.
Minimum Bytes32 hex value
Maximum Bytes32 hex value
Validate that the byte encoded string is Bytes32Hex
Minimum UInt32 hex value
Maximum UInt32 hex value
Validate that the byte encoded string is UInt32Hex
Minimum UInt64 hex value
Maximum UInt64 hex value
Validate that the byte encoded string is UInt64Hex
Minimum UInt256 hex value
Maximum UInt256 hex value
Validate that the byte encoded string is UInt256Hex
Pack a byte encoded string to a given byte count size. If the byte string is shorter than the pad
size, then prefix with 00 byte strings. If the byte string is larger, then truncate the byte string.
Extract the byte string starting at startByte up to, but excluding, endByte. Byte indexing starts at 1.
Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
DA.Crypto.Text
Functions for working with Crypto builtins. For example, as used to implement CCTP functionality.Module Snapshot
Lifecycle
Alpha (experimental).
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 2
Deprecations: 0
Deprecated since: -All warnings (2)
All warnings (2)
- DA.Crypto.Text is an alpha feature. It can change without notice.
- use -Wno-crypto-text-is-alpha in build-options to disable this warning
Data Types
type BytesHex = Text
type PublicKeyHex = Text
A DER formatted public key to be used for ECDSA signature verification
type SignatureHex = Text
A DER formatted SECP256K1 signature
Typeclasses
class HasToHex a
Methods:
toHex : a -> BytesHexConverts a typed data value into a hex encoded string.
instance HasToHex Partyinstance HasToHex Intinstance HasToHex Text
class HasFromHex a
Methods:
fromHex : BytesHex -> aConverts a hex encoded string into a typed data value.
instance HasFromHex (Optional Party)instance HasFromHex (Optional Int)instance HasFromHex (Optional Text)
Functions
isHex
isHex is True if t is not empty and consists only of
hex or hexadecimal characters.
sha256
Text, and returns it in its hex-encoded
form. The hex encoding uses lowercase letters.
keccak256
Text, and returns it in its hex-encoded
form. The hex encoding uses lowercase letters.