mirror of https://github.com/gtank/merlin
merlin: remove unconditional debug logging
This commit is contained in:
parent
eb1d60f2c0
commit
91c96d8b8d
|
@ -2,7 +2,6 @@ package merlin
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/mimoo/StrobeGo/strobe"
|
||||
)
|
||||
|
@ -21,8 +20,6 @@ func NewTranscript(appLabel string) *Transcript {
|
|||
s: strobe.InitStrobe(merlinProtocolLabel, 128),
|
||||
}
|
||||
|
||||
fmt.Printf("Initialize STROBE-128(%x)\n", merlinProtocolLabel)
|
||||
|
||||
t.AppendMessage([]byte(domainSeparatorLabel), []byte(appLabel))
|
||||
return &t
|
||||
}
|
||||
|
@ -34,15 +31,12 @@ func (t *Transcript) AppendMessage(label, message []byte) {
|
|||
sizeBuffer := make([]byte, 4)
|
||||
binary.LittleEndian.PutUint32(sizeBuffer[0:], uint32(len(message)))
|
||||
|
||||
fmt.Printf("meta-AD : %x || LE32(%d)\t# b\"%s\"\n", label, len(message), label)
|
||||
|
||||
// The StrobeGo API does not support continuation operations,
|
||||
// so we have to pass the label and length as a single buffer.
|
||||
// Otherwise it will record two meta-AD operations instead of one.
|
||||
labelSize := append(label, sizeBuffer...)
|
||||
t.s.AD(true, labelSize)
|
||||
|
||||
fmt.Printf("AD : %x\t# b\"%s\"\n", message, message)
|
||||
t.s.AD(false, message)
|
||||
}
|
||||
|
||||
|
@ -54,8 +48,6 @@ func (t *Transcript) ExtractBytes(label []byte, outLen int) []byte {
|
|||
sizeBuffer := make([]byte, 4)
|
||||
binary.LittleEndian.PutUint32(sizeBuffer[0:], uint32(outLen))
|
||||
|
||||
fmt.Printf("meta-AD : %x || LE32(%d)\t# b\"%s\"\n", label, outLen, label)
|
||||
|
||||
// The StrobeGo API does not support continuation operations,
|
||||
// so we have to pass the label and length as a single buffer.
|
||||
// Otherwise it will record two meta-AD operations instead of one.
|
||||
|
@ -64,6 +56,5 @@ func (t *Transcript) ExtractBytes(label []byte, outLen int) []byte {
|
|||
|
||||
// a PRF call directly to the output buffer would be better
|
||||
outBytes := t.s.PRF(outLen)
|
||||
fmt.Printf("PRF : %x\n", outBytes)
|
||||
return outBytes
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue