forked from External/grumble
grumble: add support for crypto mode negotiation.
This commit is contained in:
parent
12381e89c4
commit
cabe380244
4 changed files with 43 additions and 8 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue