Tezex.Crypto.BLS.HashToField (tezex v3.2.0)

View Source

Hash-to-Field implementation for BLS12-381

Implements the IRTF standard hash-to-curve specification: https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09

Summary

Functions

Expand message using XMD (expand message XOR with MD) Implementation of expand_message_xmd from IRTF spec section 5.4.1

Hash to field FQ2 - maps a message to FQ2 elements

Complete hash-to-curve implementation for G2 following IRTF standard

Functions

expand_message_xmd(msg, dst, len_in_bytes)

@spec expand_message_xmd(binary(), binary(), non_neg_integer()) :: binary()

Expand message using XMD (expand message XOR with MD) Implementation of expand_message_xmd from IRTF spec section 5.4.1

hash_to_field_fq2(message, count, dst)

@spec hash_to_field_fq2(binary(), non_neg_integer(), binary()) :: [
  Tezex.Crypto.BLS.Fq2.t()
]

Hash to field FQ2 - maps a message to FQ2 elements

hash_to_g2(message, dst \\ "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_")

@spec hash_to_g2(binary(), binary()) :: Tezex.Crypto.BLS.G2.t()

Complete hash-to-curve implementation for G2 following IRTF standard