diff options
| author | ishaan <contact@ishaan.cc> | 2026-07-12 08:50:50 +0530 |
|---|---|---|
| committer | ishaan <contact@ishaan.cc> | 2026-07-12 08:50:50 +0530 |
| commit | d3e8c5d00d71e7d3d5186b4dc653d0c10ee35870 (patch) | |
| tree | 4edd1afb5b294fb81fcce9d092aa313a5aba0e50 /internal/crypto | |
| parent | 777497ec7972d60621dc2ec42495aa73c77dfa41 (diff) | |
move raw encrypt/decrypt to internal/crypt, drop crud/crypto pkgs, rawEncrypt/Decrypt to use bytes
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 -} |