added hopscotch cipher

This commit is contained in:
Russ Magee 2021-11-12 20:39:44 -08:00
parent db8697aa35
commit 129dce4b08
6 changed files with 16 additions and 2 deletions

View file

@ -21,6 +21,7 @@ import (
"log"
"blitter.com/go/cryptmt"
"blitter.com/go/hopscotch"
"github.com/aead/chacha20/chacha"
"golang.org/x/crypto/blowfish"
"golang.org/x/crypto/twofish"
@ -105,6 +106,9 @@ func (hc *Conn) getStream(keymat []byte) (rc cipher.Stream, mc hash.Hash, err er
case CAlgCryptMT1:
rc = cryptmt.New(nil, nil, keymat)
log.Printf("[cipher CRYPTMT1 (%d)]\n", copts)
case CAlgHopscotch:
rc = hopscotch.New(nil, nil, 4, keymat)
log.Printf("[cipher HOPSCOTCH (%d)]\n", copts)
case CAlgChaCha20_12:
keymat = expandKeyMat(keymat, chacha.KeySize)
key = keymat[0:chacha.KeySize]