diff options
Diffstat (limited to 'internal/crypto')
| -rw-r--r-- | internal/crypto/crypto.go | 1 | ||||
| -rw-r--r-- | internal/crypto/format.go | 1 | ||||
| -rw-r--r-- | internal/crypto/salt.go | 28 |
3 files changed, 0 insertions, 30 deletions
diff --git a/internal/crypto/crypto.go b/internal/crypto/crypto.go deleted file mode 100644 index 5871506..0000000 --- a/internal/crypto/crypto.go +++ /dev/null @@ -1 +0,0 @@ -package crypto diff --git a/internal/crypto/format.go b/internal/crypto/format.go deleted file mode 100644 index 5871506..0000000 --- a/internal/crypto/format.go +++ /dev/null @@ -1 +0,0 @@ -package crypto 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 -} |