Documentation
¶
Overview ¶
Package sign implements the signature creation and verification used in bendybutt powered metafeeds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(input []byte, key ed25519.PrivateKey, hmacSec *[32]byte) []byte
Create creates the signature over the passed input bytes using the passed secret key. The resulting signature is prefixed with the two bytes 0x0400, which are bendybutt bencode extension to denote it being a signature. If hmacSec is not nil, the prefixed input is hashed using nacl's auth.Sum() before the signature is created.
func Verify ¶
Verify checks if the passed signature was indeed created over the passed data, using the same domain seperation as the Create() function in this package. It also checks if the signature has the right BFE data prefix (0x0400). If hmacSec is not nil, the prefixed input is hashed using nacl's auth.Sum() before the signature is verified.
Types ¶
This section is empty.