expand

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package expand implements message expansion according to RFC9380.

This package implements the expand_message_xmd function from RFC9380 Section 5.3.1. The package uses hard-coded hash function SHA2-256.

Please open issue in gnark repository in case there is a need for using other hash functions beyond SHA2-256 or expand_message_xof using extendable-output function (SHAKE3 family etc.). We currently have implemented only specific instance for compatibility with gnark-crypto, which is available at github.com/consensys/gnark-crypto/field/hash.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandMsgXmd

func ExpandMsgXmd(api frontend.API, msg []uints.U8, dst []byte, lenInBytes int) ([]uints.U8, error)

ExpandMsgXmd implements the expand_message_xmd function from RFC9380 Section 5.3.1. It is hardcoded to use SHA2-256 as the hash function (but can be made optionally configurable in the future).

It expand a message `msg` with a fixed domain separation tag `dst` to a slice of length `lenInBytes`.

For gnark-crypto implementation see gnark-crypto.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL