# `Tezex.Crypto.BLS.HashToField`
[🔗](https://github.com/objkt-com/tezex/blob/v4.0.0/lib/crypto/bls/hash_to_field.ex#L1)

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

# `expand_message_xmd`

```elixir
@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`

```elixir
@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`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
