listening to "garoche ta sacoche"

This commit is contained in:
didier.amyot committed 2014-11-01 12:46:45 -07:00
1 parent 0095eb7159
commit d863dc3bd1
7 files changed
+158 -37

No files matched your search

-22
View File
@@ -13,19 +13,6 @@ import (
"github.com/didiercrunch/filou/payload"
)
type mockEncryptor struct{}
func (this *mockEncryptor) Encrypt(data []byte) ([]byte, error) {
// cesar encryption!
ret := make([]byte, len(data))
for i, d := range data {
ret[i] = d + 3 // modulo is implicit
}
return ret, nil
}
type mockSigner struct{}
var random = helper.NewMockRandomReader()
func generateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey) {
@@ -42,15 +29,6 @@ func getEncryterAndSigner() *asymetric.RsaOaepPss {
return &asymetric.RsaOaepPss{alicePrivateKey, bobPubKey, crypto.SHA512, random}
}
func (this *mockSigner) Sign(data []byte) ([]byte, error) {
// a slice with the sum of the data plus a "secret" value
var sum byte = 36
for _, d := range data {
sum += d
}
return []byte{sum}, nil
}
func TestPayloadCanBeUseInEnvelop(t *testing.T) {
encryterAndSigner := getEncryterAndSigner()
payload_ := payload.GetDefaultPayload(bytes.NewBufferString("some data to encrypt"))