move cryptography to its own folder/files
This commit is contained in:
22
pkg/cryptography/constants.go
Normal file
22
pkg/cryptography/constants.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package cryptography
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
|
||||
"golang.org/x/crypto/curve25519"
|
||||
)
|
||||
|
||||
const (
|
||||
SHA256Size = 32
|
||||
)
|
||||
|
||||
// GetBasepoint returns the standard Curve25519 basepoint
|
||||
func GetBasepoint() []byte {
|
||||
return curve25519.Basepoint
|
||||
}
|
||||
|
||||
func Hash(data []byte) []byte {
|
||||
h := sha256.New()
|
||||
h.Write(data)
|
||||
return h.Sum(nil)
|
||||
}
|
||||
Reference in New Issue
Block a user