aboutsummaryrefslogtreecommitdiff
path: root/internal/crypto/salt.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/crypto/salt.go')
-rw-r--r--internal/crypto/salt.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/internal/crypto/salt.go b/internal/crypto/salt.go
deleted file mode 100644
index a3dbcc2..0000000
--- a/internal/crypto/salt.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package crypto
-
-import (
- "crypto/rand"
- "io"
- "log/slog"
- "os"
-)
-
-func NewSalt() [16]byte {
- salt := [16]byte{}
- if _, err := io.ReadFull(rand.Reader, salt[:]); err != nil {
- slog.Error("crypto: failed to read salt", "error", err)
- os.Exit(1)
- }
-
- return salt
-}
-
-func NewNonce() [12]byte {
- nonce := [12]byte{}
- if _, err := io.ReadFull(rand.Reader, nonce[:]); err != nil {
- slog.Error("crypto: failed to read nonce", "error", err)
- os.Exit(1)
- }
-
- return nonce
-}