(data []byte, key NyPrivateKey)
| 13 | ) |
| 14 | |
| 15 | func SignBundle(data []byte, key NyPrivateKey) ([]byte, error) { |
| 16 | privKey := x25519.PrivateKey(key[:]) |
| 17 | sig, err := privKey.Sign(rand.Reader, data, crypto.Hash(0)) |
| 18 | if err != nil { |
| 19 | return nil, err |
| 20 | } |
| 21 | return append(sig, data...), nil |
| 22 | } |
| 23 | |
| 24 | func VerifyBundle(data []byte, key NyPublicKey) ([]byte, error) { |
| 25 | if len(data) < x25519.SignatureSize { |
no outgoing calls