multi: fix typos

This commit is contained in:
yyforyongyu 2020-03-27 16:59:18 +08:00
parent 55241b8e16
commit 4be1a4d0ec
3 changed files with 8 additions and 9 deletions

@ -47,7 +47,7 @@ const (
) )
var ( var (
// ErrMaxMessageLengthExceeded is returned a message to be written to // ErrMaxMessageLengthExceeded is returned when a message to be written to
// the cipher session exceeds the maximum allowed message payload. // the cipher session exceeds the maximum allowed message payload.
ErrMaxMessageLengthExceeded = errors.New("the generated payload exceeds " + ErrMaxMessageLengthExceeded = errors.New("the generated payload exceeds " +
"the max allowed message length of (2^16)-1") "the max allowed message length of (2^16)-1")
@ -209,7 +209,7 @@ type symmetricState struct {
handshakeDigest [32]byte handshakeDigest [32]byte
} }
// mixKey is implements a basic HKDF-based key ratchet. This method is called // mixKey implements a basic HKDF-based key ratchet. This method is called
// with the result of each DH output generated during the handshake process. // with the result of each DH output generated during the handshake process.
// The first 32 bytes extract from the HKDF reader is the next chaining key, // The first 32 bytes extract from the HKDF reader is the next chaining key,
// then latter 32 bytes become the temp secret key using within any future AEAD // then latter 32 bytes become the temp secret key using within any future AEAD
@ -315,7 +315,7 @@ func newHandshakeState(initiator bool, prologue []byte,
h.InitializeSymmetric([]byte(protocolName)) h.InitializeSymmetric([]byte(protocolName))
h.mixHash(prologue) h.mixHash(prologue)
// In Noise_XK, then initiator should know the responder's static // In Noise_XK, the initiator should know the responder's static
// public key, therefore we include the responder's static key in the // public key, therefore we include the responder's static key in the
// handshake digest. If the initiator gets this value wrong, then the // handshake digest. If the initiator gets this value wrong, then the
// handshake will fail. // handshake will fail.
@ -330,7 +330,7 @@ func newHandshakeState(initiator bool, prologue []byte,
// EphemeralGenerator is a functional option that allows callers to substitute // EphemeralGenerator is a functional option that allows callers to substitute
// a custom function for use when generating ephemeral keys for ActOne or // a custom function for use when generating ephemeral keys for ActOne or
// ActTwo. The function closure return by this function can be passed into // ActTwo. The function closure returned by this function can be passed into
// NewBrontideMachine as a function option parameter. // NewBrontideMachine as a function option parameter.
func EphemeralGenerator(gen func() (*btcec.PrivateKey, error)) func(*Machine) { func EphemeralGenerator(gen func() (*btcec.PrivateKey, error)) func(*Machine) {
return func(m *Machine) { return func(m *Machine) {
@ -437,8 +437,7 @@ const (
// ActThreeSize is the size of the packet sent from initiator to // ActThreeSize is the size of the packet sent from initiator to
// responder in ActThree. The packet consists of a handshake version, // responder in ActThree. The packet consists of a handshake version,
// the initiators static key encrypted with strong forward secrecy and // the initiators static key encrypted with strong forward secrecy and
// a 16-byte poly1035 // a 16-byte poly1035 tag.
// tag.
// //
// 1 + 33 + 16 + 16 // 1 + 33 + 16 + 16
ActThreeSize = 66 ActThreeSize = 66
@ -519,7 +518,7 @@ func (b *Machine) RecvActOne(actOne [ActOneSize]byte) error {
} }
// GenActTwo generates the second packet (act two) to be sent from the // GenActTwo generates the second packet (act two) to be sent from the
// responder to the initiator. The packet for act two is identify to that of // responder to the initiator. The packet for act two is identical to that of
// act one, but then results in a different ECDH operation between the // act one, but then results in a different ECDH operation between the
// initiator's and responder's ephemeral keys. // initiator's and responder's ephemeral keys.
// //

@ -1359,7 +1359,7 @@ func testPaymentFollowingChannelOpen(net *lntest.NetworkHarness, t *harnessTest)
t.Fatalf("unable to create pay reqs: %v", err) t.Fatalf("unable to create pay reqs: %v", err)
} }
// Send payment to Bob so there a chanel update to disk will be // Send payment to Bob so that a channel update to disk will be
// executed. // executed.
ctxt, cancel = context.WithTimeout(ctxb, defaultTimeout) ctxt, cancel = context.WithTimeout(ctxb, defaultTimeout)
defer cancel() defer cancel()

@ -123,7 +123,7 @@ type BackendConfig interface {
// ConnectMiner is called to establish a connection to the test miner. // ConnectMiner is called to establish a connection to the test miner.
ConnectMiner() error ConnectMiner() error
// DisconnectMiner is called to bitconneeeect the miner. // DisconnectMiner is called to disconnect the miner.
DisconnectMiner() error DisconnectMiner() error
// Name returns the name of the backend type. // Name returns the name of the backend type.