move cryptography to its own folder/files

This commit is contained in:
Sudo-Ivan
2025-01-04 18:17:13 -06:00
parent ea8daf6bb2
commit c870406244
6 changed files with 171 additions and 0 deletions

View 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)
}