package octez-proto-libs

  1. Overview
  2. Docs
Octez protocol libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V6/Make/Bls_signature/index.html

Module Make.Bls_signatureSource

type pk = Bls12_381_signature.MinPk.pk

Type of the public keys

val pk_size_in_bytes : int

The size in bytes of a serialized value pk

Build a value of type pk without performing any check on the input. It is safe to use this function when verifying a signature as the signature function verifies if the point is in the prime subgroup. Using unsafe_pk_of_bytes removes a verification performed twice when used pk_of_bytes_exn or pk_of_bytes_opt.

The expected bytes format are the compressed form of a point on G1.

val unsafe_pk_of_bytes : Bytes.t -> pk
val pk_of_bytes_opt : Bytes.t -> pk option

Build a value of type pk safely, i.e. the function checks the bytes given in parameters represents a point on the curve and in the prime subgroup. Return None if the bytes are not in the correct format or does not represent a point in the prime subgroup.

The expected bytes format are the compressed form of a point on G1.

val pk_to_bytes : pk -> Bytes.t

Returns a bytes representation of a value of type pk. The output is the compressed form a the point G1.t the pk represents.

type signature = Bls12_381_signature.MinPk.signature

Type of the signatures

val signature_size_in_bytes : int

The size in bytes of a serialized value signature

val unsafe_signature_of_bytes : Bytes.t -> signature

Build a value of type signature without performing any check on the input. It is safe to use this function when verifying a signature as the signature function verifies if the point is in the prime subgroup. Using unsafe_signature_of_bytes removes a verification performed twice when using signature_of_bytes_exn or signature_of_bytes_opt.

The expected bytes format are the compressed form of a point on G2.

val signature_of_bytes_opt : Bytes.t -> signature option

Build a value of type signature safely, i.e. the function checks the bytes given as argument represents a point on the curve and in the prime subgroup. Return None if the bytes are not in the correct format or do not represent a point in the prime subgroup.

The expected bytes format are the compressed form of a point on G2.

val signature_to_bytes : signature -> Bytes.t

Returns a bytes representation of a value of type signature. The output is the compressed form of the G2.t point the signature represents.

val aggregate_signature_opt : signature list -> signature option

aggregate_signature_opt signatures aggregates the signatures signatures, following https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-2.8. Return None if INVALID is expected in the specification

Sourceval verify : pk -> Bytes.t -> signature -> bool
Sourceval aggregate_verify : (pk * Bytes.t) list -> signature -> bool
OCaml

Innovation. Community. Security.