Documentation
¶
Overview ¶
Package h2c implements Hashing to Elliptic Curves as specified in RFC 9380.
Index ¶
- func Curve25519_XMD_ELL2_NU(hFunc crypto.Hash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
- func Curve25519_XMD_ELL2_RO(hFunc crypto.Hash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
- func Curve25519_XMD_SHA512_ELL2_NU(domainSeparator, message []byte) (*field.Element, *field.Element, error)
- func Curve25519_XMD_SHA512_ELL2_RO(domainSeparator, message []byte) (*field.Element, *field.Element, error)
- func Curve25519_XOF_ELL2_NU(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
- func Curve25519_XOF_ELL2_RO(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
- func Edwards25519_XMD_ELL2_NU(hFunc crypto.Hash, domainSeparator, message []byte) (*edwards25519.Point, error)
- func Edwards25519_XMD_ELL2_RO(hFunc crypto.Hash, domainSeparator, message []byte) (*edwards25519.Point, error)
- func Edwards25519_XMD_SHA512_ELL2_NU(domainSeparator, message []byte) (*edwards25519.Point, error)
- func Edwards25519_XMD_SHA512_ELL2_RO(domainSeparator, message []byte) (*edwards25519.Point, error)
- func Edwards25519_XOF_ELL2_NU(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*edwards25519.Point, error)
- func Edwards25519_XOF_ELL2_RO(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*edwards25519.Point, error)
- func ExpandMessageXMD(out []byte, hFunc crypto.Hash, domainSeparator, message []byte) error
- func ExpandMessageXOF(out []byte, xofFunc sha3.ShakeHash, domainSeparator, message []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Curve25519_XMD_ELL2_NU ¶
func Curve25519_XMD_ELL2_NU(hFunc crypto.Hash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
Curve25519_XMD_ELL2_NU implements a generic curve25519 nonuniform suite using `expand_messsage_xmd`, returning the u and v-coordiantes.
func Curve25519_XMD_ELL2_RO ¶
func Curve25519_XMD_ELL2_RO(hFunc crypto.Hash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
Curve25519_XMD_ELL2_RO implements a generic curve25519 random oracle suite using `expand_message_xmd`, returning the u and v-coordinates.
func Curve25519_XMD_SHA512_ELL2_NU ¶
func Curve25519_XMD_SHA512_ELL2_NU(domainSeparator, message []byte) (*field.Element, *field.Element, error)
Curve25519_XMD_SHA512_ELL2_NU implements the curve25519_XMD:SHA-512_ELL2_NU_ suite.
func Curve25519_XMD_SHA512_ELL2_RO ¶
func Curve25519_XMD_SHA512_ELL2_RO(domainSeparator, message []byte) (*field.Element, *field.Element, error)
Curve25519_XMD_SHA512_ELL2_RO implements the curve25519_XMD:SHA-512_ELL2_RO_ suite.
func Curve25519_XOF_ELL2_NU ¶
func Curve25519_XOF_ELL2_NU(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
Curve5519_XOF_ELL2_NU implements a generic curve25519 nonuniform suite using `expand_messsage_xof`, returning the u and v-coordinates.
func Curve25519_XOF_ELL2_RO ¶
func Curve25519_XOF_ELL2_RO(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*field.Element, *field.Element, error)
Curve25519_XOF_ELL2_RO implements a generic curve25519 random oracle suite using `expand_message_xof`, returning the u and v-coordinates.
func Edwards25519_XMD_ELL2_NU ¶
func Edwards25519_XMD_ELL2_NU(hFunc crypto.Hash, domainSeparator, message []byte) (*edwards25519.Point, error)
Edwards25519_XMD_ELL2_NU implements a generic edwards25519 nonuniform suite using `expand_messsage_xmd`.
func Edwards25519_XMD_ELL2_RO ¶
func Edwards25519_XMD_ELL2_RO(hFunc crypto.Hash, domainSeparator, message []byte) (*edwards25519.Point, error)
Edwards25519_XMD_ELL2_RO implements a generic edwards25519 random oracle suite using `expand_message_xmd`.
func Edwards25519_XMD_SHA512_ELL2_NU ¶
func Edwards25519_XMD_SHA512_ELL2_NU(domainSeparator, message []byte) (*edwards25519.Point, error)
Edwards25519_XMD_SHA512_ELL2_NU implements the edwards25519_XMD:SHA-512_ELL2_NU_ suite.
func Edwards25519_XMD_SHA512_ELL2_RO ¶
func Edwards25519_XMD_SHA512_ELL2_RO(domainSeparator, message []byte) (*edwards25519.Point, error)
Edwards25519_XMD_SHA512_ELL2_RO implements the edwards25519_XMD:SHA-512_ELL2_RO_ suite.
func Edwards25519_XOF_ELL2_NU ¶
func Edwards25519_XOF_ELL2_NU(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*edwards25519.Point, error)
Edwards25519_XOF_ELL2_NU implements a generic edwards25519 nonuniform suite using `expand_messsage_xof`.
func Edwards25519_XOF_ELL2_RO ¶
func Edwards25519_XOF_ELL2_RO(xofFunc sha3.ShakeHash, domainSeparator, message []byte) (*edwards25519.Point, error)
Edwards25519_XOF_ELL2_RO implements a generic edwards25519 random oracle suite using `expand_message_xof`.
func ExpandMessageXMD ¶
ExpandMessageXMD implements expand_message_xmd, overwriting out with uniformly random data generated by the provided hash function, domain separation tag, and message.
func ExpandMessageXOF ¶
ExpandMessageXOF implements expand_message_xof, overwriting out with uniformly random data generated by the provided extensible-output function, domain separation tag, and message.
Note: This needs to use the Clone() method of the XOF to instantiate a new instance of the XOF. At present there are 3 different XOF interfaces in the x/crypto package, all mutually incompatible due to the return type of Clone(). Complain to the x/crypto developers, not me.
Types ¶
This section is empty.