summaryrefslogtreecommitdiff
path: root/backend.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-03 18:57:28 +0200
committerJakob Unterwurzacher2015-09-03 19:09:11 +0200
commitf8fddff7694b2cb9487fd4b5cbe9f97a136600b0 (patch)
treec592e59683165d9af1116e65fa16ffddff1bb7c5 /backend.go
parent4e93fdf820695c6afb38d525b5cf1dcc64080305 (diff)
Split into FS and File
Diffstat (limited to 'backend.go')
-rw-r--r--backend.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/backend.go b/backend.go
deleted file mode 100644
index ad80b9a..0000000
--- a/backend.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package gocryptfs
-
-import (
- "crypto/cipher"
- "crypto/aes"
-)
-
-const (
- NONCE_LEN = 12
- AUTH_TAG_LEN = 16
- DEFAULT_PLAINBS = 4096
-
- ENCRYPT = true
- DECRYPT = false
-)
-
-type Backend struct {
- blockCipher cipher.Block
- gcm cipher.AEAD
- plainBS int64
- cipherBS int64
-}
-
-func New(key [16]byte) *Backend {
-
- b, err := aes.NewCipher(key[:])
- if err != nil {
- panic(err)
- }
-
- g, err := cipher.NewGCM(b)
- if err != nil {
- panic(err)
- }
-
- return &Backend{
- blockCipher: b,
- gcm: g,
- plainBS: DEFAULT_PLAINBS,
- cipherBS: DEFAULT_PLAINBS + NONCE_LEN + AUTH_TAG_LEN,
- }
-}