payload almost done

This commit is contained in:
didier.amyot committed 2014-10-17 15:46:21 -04:00
1 parent 77bfcba5b1
commit 09d0f237d5
16 files changed
+690 -118

No files matched your search

+4 -3
View File
@@ -36,11 +36,12 @@ func createRandomKey(lengthInBits int, rd io.Reader) ([]byte, error) {
}
}
func (this Block) CreateBlock(rd io.Reader) (cipher.Block, error) {
func (this Block) CreateBlock(rd io.Reader) (cipher.Block, []byte, error) {
var err error
key := make([]byte, 256/8)
if _, err = rd.Read(key); err != nil {
return nil, err
return nil, nil, err
}
return aes.NewCipher(key)
block, err := aes.NewCipher(key)
return block, key, err
}