move cryptography to its own folder/files
This commit is contained in:
18
pkg/cryptography/ed25519.go
Normal file
18
pkg/cryptography/ed25519.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package cryptography
|
||||
|
||||
import (
|
||||
"crypto/ed25519"
|
||||
"crypto/rand"
|
||||
)
|
||||
|
||||
func GenerateSigningKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error) {
|
||||
return ed25519.GenerateKey(rand.Reader)
|
||||
}
|
||||
|
||||
func Sign(privateKey ed25519.PrivateKey, message []byte) []byte {
|
||||
return ed25519.Sign(privateKey, message)
|
||||
}
|
||||
|
||||
func Verify(publicKey ed25519.PublicKey, message, signature []byte) bool {
|
||||
return ed25519.Verify(publicKey, message, signature)
|
||||
}
|
||||
Reference in New Issue
Block a user