1
0
Fork 0
forked from External/grumble

grumble: add support for crypto mode negotiation.

This commit is contained in:
Mikkel Krautz 2012-12-08 22:10:21 +01:00
parent 12381e89c4
commit cabe380244
4 changed files with 43 additions and 8 deletions

View file

@ -36,6 +36,11 @@ type CryptState struct {
cipher cipher.Block
}
// SupportedModes returns the list of supported CryptoModes.
func SupportedModes() []string {
return []string{"OCB2-AES128"}
}
func (cs *CryptState) GenerateKey() error {
_, err := io.ReadFull(rand.Reader, cs.RawKey[0:])
if err != nil {
@ -239,4 +244,4 @@ func (cs *CryptState) Encrypt(dst, src []byte) {
dst[3] = tag[2]
return
}
}