GoReporter recommended cleanup

This commit is contained in:
Russ Magee 2018-12-12 00:34:23 -08:00
parent 4b059242d9
commit ea01123b87
2 changed files with 7 additions and 7 deletions

View File

@ -285,7 +285,7 @@ func (r randReader) Read(b []byte) (n int, e error) {
return return
} }
func KyberDialSetup(c net.Conn, hc *Conn) (err error) { func KyberDialSetup(c io.ReadWriter /*net.Conn*/, hc *Conn) (err error) {
// Send hkexnet.Conn parameters to remote side // Send hkexnet.Conn parameters to remote side
// Alice, step 1: Generate a key pair. // Alice, step 1: Generate a key pair.
@ -335,7 +335,7 @@ func KyberDialSetup(c net.Conn, hc *Conn) (err error) {
return return
} }
func HKExDialSetup(c net.Conn, hc *Conn) (err error) { func HKExDialSetup(c io.ReadWriter /*net.Conn*/, hc *Conn) (err error) {
var h *hkex.HerraduraKEx var h *hkex.HerraduraKEx
switch hc.kex { switch hc.kex {
case KEX_HERRADURA256: case KEX_HERRADURA256:

View File

@ -43,7 +43,7 @@ var (
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
const Bob = string("\r\n\r\n" + const bob = string("\r\n\r\n" +
"@@@@@@@^^~~~~~~~~~~~~~~~~~~~~^@@@@@@@@@\r\n" + "@@@@@@@^^~~~~~~~~~~~~~~~~~~~~^@@@@@@@@@\r\n" +
"@@@@@@^ ~^ @ @@ @ @ @ I ~^@@@@@@\r\n" + "@@@@@@^ ~^ @ @@ @ @ @ I ~^@@@@@@\r\n" +
"@@@@@ ~ ~~ ~I @@@@@\r\n" + "@@@@@ ~ ~~ ~I @@@@@\r\n" +
@ -70,8 +70,8 @@ const Bob = string("\r\n\r\n" +
"\r\n") "\r\n")
type ( type (
EscHandler func(io.Writer) escHandler func(io.Writer)
EscSeqs map[byte]EscHandler escSeqs map[byte]escHandler
) )
// Copy copies from src to dst until either EOF is reached // Copy copies from src to dst until either EOF is reached
@ -117,10 +117,10 @@ func copyBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err er
// outlive individual copyBuffer calls). // outlive individual copyBuffer calls).
// (Note that since this custom copyBuffer func is used only by // (Note that since this custom copyBuffer func is used only by
// the hkexsh client, it should eventually be moved to client.) // the hkexsh client, it should eventually be moved to client.)
escs := EscSeqs{ escs := escSeqs{
'i': func(io.Writer) { os.Stdout.Write([]byte("\x1b[s\x1b[2;1H\x1b[1;31m[HKEXSH]\x1b[39;49m\x1b[u")) }, 'i': func(io.Writer) { os.Stdout.Write([]byte("\x1b[s\x1b[2;1H\x1b[1;31m[HKEXSH]\x1b[39;49m\x1b[u")) },
't': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m[HKEXSH]\x1b[39;49m")) }, 't': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m[HKEXSH]\x1b[39;49m")) },
'B': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m" + Bob + "\x1b[39;49m")) }, 'B': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m" + bob + "\x1b[39;49m")) },
} }
/* /*