import ( "bytes" "crypto/des" "crypto/rand" "io" "github.com/cloudfoundry-incubator/bbs/encryption" "github.com/cloudfoundry-incubator/bbs/encryption/fakes" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Crypt", func() { var cryptor encryption.Cryptor var keyManager encryption.KeyManager var prng io.Reader BeforeEach(func() { key, err := encryption.NewKey("label", "pass phrase") Expect(err).NotTo(HaveOccurred()) keyManager, err = encryption.NewKeyManager(key, nil) Expect(err).NotTo(HaveOccurred()) prng = rand.Reader }) JustBeforeEach(func() { cryptor = encryption.NewCryptor(keyManager, prng) })
"encoding/base64" "errors" "io" "github.com/cloudfoundry-incubator/bbs/encryption" encryption_fakes "github.com/cloudfoundry-incubator/bbs/encryption/fakes" "github.com/cloudfoundry-incubator/bbs/format" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Encoding", func() { var encoder format.Encoder var prng io.Reader var cryptor encryption.Cryptor BeforeEach(func() { key, err := encryption.NewKey("label", "some pass phrase") Expect(err).NotTo(HaveOccurred()) keyManager, err := encryption.NewKeyManager(key, nil) Expect(err).NotTo(HaveOccurred()) prng = &zeroReader{} cryptor = encryption.NewCryptor(keyManager, prng) }) JustBeforeEach(func() { encoder = format.NewEncoder(cryptor) })