diff --git a/app/dns/server.go b/app/dns/server.go index da9f6cc08d..0693fa1e0b 100644 --- a/app/dns/server.go +++ b/app/dns/server.go @@ -209,7 +209,7 @@ func New(ctx context.Context, config *Config) (*Server, error) { ruleIter = 0 ruleCurr++ } - } else { // No original rule, generate one according to current domain matcher (majorly for compability with tests) + } else { // No original rule, generate one according to current domain matcher (majorly for compatibility with tests) info.domainRuleIdx = uint16(len(rules)) rules = append(rules, matcher.String()) } diff --git a/app/stats/channel_test.go b/app/stats/channel_test.go index d32c0c563c..b2a1c174cf 100644 --- a/app/stats/channel_test.go +++ b/app/stats/channel_test.go @@ -382,11 +382,11 @@ func TestStatsChannelConcurrency(t *testing.T) { errCh <- fmt.Sprint("unexpected block from receiving data: ", 1) } // Test `b` is not closed but cannot receive data 2: - // Becuase in a new round of messaging, `b` has been unsubscribed. + // Because in a new round of messaging, `b` has been unsubscribed. select { case v, ok := <-b: if ok { - errCh <- fmt.Sprint("unexpected receving: ", v) + errCh <- fmt.Sprint("unexpected receiving: ", v) } else { errCh <- fmt.Sprint("unexpected closing of channel") } diff --git a/external/github.com/cheekybits/genny/generic/generic.go b/external/github.com/cheekybits/genny/generic/generic.go index 04a2306cbf..80cc48ca9c 100644 --- a/external/github.com/cheekybits/genny/generic/generic.go +++ b/external/github.com/cheekybits/genny/generic/generic.go @@ -6,7 +6,7 @@ package generic // var GenericType generic.Type type Type interface{} -// Number is the placehoder type that indiccates a generic numerical value. +// Number is the placeholder type that indiccates a generic numerical value. // When genny is executed, variables of this type will be replaced with // references to the specific types. // var GenericType generic.Number diff --git a/external/github.com/cloudflare/sidh/internal/arith/generic.go b/external/github.com/cloudflare/sidh/internal/arith/generic.go index 223777081f..dc84892d3b 100644 --- a/external/github.com/cloudflare/sidh/internal/arith/generic.go +++ b/external/github.com/cloudflare/sidh/internal/arith/generic.go @@ -16,7 +16,7 @@ func Addc64(cin, a, b uint64) (ret, cout uint64) { return } -// Substracts 2 64bit digits in constant time. +// Subtracts 2 64bit digits in constant time. // Returns result and borrow (1 or 0) func Subc64(bIn, a, b uint64) (ret, bOut uint64) { var tmp1 = a - b diff --git a/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go b/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go index ce1ce9a530..d658d81a25 100644 --- a/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go +++ b/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go @@ -429,7 +429,7 @@ func (point *ProjectivePoint) ToAffine(c *CurveOperations) *Fp2Element { // Cleans data in fp func (fp *Fp2Element) Zeroize() { - // Zeroizing in 2 seperated loops tells compiler to + // Zeroizing in 2 separated loops tells compiler to // use fast runtime.memclr() for i := range fp.A { fp.A[i] = 0 diff --git a/external/github.com/cloudflare/sidh/p503/arith_generic.go b/external/github.com/cloudflare/sidh/p503/arith_generic.go index ee8cc6e030..2437f0e3c9 100644 --- a/external/github.com/cloudflare/sidh/p503/arith_generic.go +++ b/external/github.com/cloudflare/sidh/p503/arith_generic.go @@ -70,7 +70,7 @@ func fp503MontgomeryReduce(z *FpElement, x *FpElementX2) { var uv Uint128 var count int - count = 3 // number of 0 digits in the least significat part of p503 + 1 + count = 3 // number of 0 digits in the least significant part of p503 + 1 for i := 0; i < NumWords; i++ { for j := 0; j < i; j++ { diff --git a/external/github.com/cloudflare/sidh/p503/field_ops.go b/external/github.com/cloudflare/sidh/p503/field_ops.go index 04223d6086..45ea570c96 100644 --- a/external/github.com/cloudflare/sidh/p503/field_ops.go +++ b/external/github.com/cloudflare/sidh/p503/field_ops.go @@ -219,7 +219,7 @@ func (dest *primeFieldElement) Pow2k(x *primeFieldElement, k uint8) *primeFieldE // // Returns dest to allow chaining operations. func (dest *primeFieldElement) P34(x *primeFieldElement) *primeFieldElement { - // Sliding-window strategy computed with etc/scripts/sliding_window_strat_calc.py + // Sliding-window strategy computed with etc/scripts/sliding_window_start_calc.py // // This performs sum(powStrategy) + 1 squarings and len(lookup) + len(mulStrategy) // multiplications. diff --git a/external/github.com/cloudflare/sidh/p751/arith_generic.go b/external/github.com/cloudflare/sidh/p751/arith_generic.go index 0173011275..3fdad5a158 100644 --- a/external/github.com/cloudflare/sidh/p751/arith_generic.go +++ b/external/github.com/cloudflare/sidh/p751/arith_generic.go @@ -69,7 +69,7 @@ func fp751MontgomeryReduce(z *FpElement, x *FpElementX2) { var uv Uint128 var count int - count = 5 // number of 0 digits in the least significat part of p751 + 1 + count = 5 // number of 0 digits in the least significant part of p751 + 1 for i := 0; i < NumWords; i++ { for j := 0; j < i; j++ { diff --git a/external/github.com/cloudflare/sidh/sidh/api.go b/external/github.com/cloudflare/sidh/sidh/api.go index 500dc5bfa2..5343006e5d 100644 --- a/external/github.com/cloudflare/sidh/sidh/api.go +++ b/external/github.com/cloudflare/sidh/sidh/api.go @@ -3,6 +3,7 @@ package sidh import ( "errors" "io" + . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" ) @@ -173,7 +174,7 @@ func (prv *PrivateKey) Generate(rand io.Reader) error { // Private key generation takes advantage of the fact that keyspace for secret // key is (0, 2^x - 1), for some possitivite value of 'x' (see SIKE, 1.3.8). // It means that all bytes in the secret key, but the last one, can take any - // value between <0x00,0xFF>. Similarily for the last byte, but generation + // value between <0x00,0xFF>. Similarly for the last byte, but generation // needs to chop off some bits, to make sure generated value is an element of // a key-space. _, err = io.ReadFull(rand, prv.Scalar) @@ -182,7 +183,7 @@ func (prv *PrivateKey) Generate(rand io.Reader) error { } prv.Scalar[len(prv.Scalar)-1] &= (1 << (dp.SecretBitLen % 8)) - 1 // Make sure scalar is SecretBitLen long. SIKE spec says that key - // space starts from 0, but I'm not confortable with having low + // space starts from 0, but I'm not comfortable with having low // value scalars used for private keys. It is still secrure as per // table 5.1 in [SIKE]. prv.Scalar[len(prv.Scalar)-1] |= 1 << ((dp.SecretBitLen % 8) - 1) diff --git a/external/github.com/cloudflare/sidh/sidh/sidh.go b/external/github.com/cloudflare/sidh/sidh/sidh.go index 17177484c0..a6f0cc435f 100644 --- a/external/github.com/cloudflare/sidh/sidh/sidh.go +++ b/external/github.com/cloudflare/sidh/sidh/sidh.go @@ -18,15 +18,15 @@ func traverseTreePublicKeyA(curve *ProjectiveCurveParameters, xR, phiP, phiQ, ph cparam := op.CalcCurveParamsEquiv4(curve) phi := Newisogeny4(op.Params.Op) - strat := pub.params.A.IsogenyStrategy - stratSz := len(strat) + strategy := pub.params.A.IsogenyStrategy + stratSz := len(strategy) for j := 1; j <= stratSz; j++ { for i <= stratSz-j { points = append(points, *xR) indices = append(indices, i) - k := strat[sidx] + k := strategy[sidx] sidx++ op.Pow2k(xR, &cparam, 2*k) i += int(k) @@ -57,15 +57,15 @@ func traverseTreeSharedKeyA(curve *ProjectiveCurveParameters, xR *ProjectivePoin cparam := op.CalcCurveParamsEquiv4(curve) phi := Newisogeny4(op.Params.Op) - strat := pub.params.A.IsogenyStrategy - stratSz := len(strat) + strategy := pub.params.A.IsogenyStrategy + stratSz := len(strategy) for j := 1; j <= stratSz; j++ { for i <= stratSz-j { points = append(points, *xR) indices = append(indices, i) - k := strat[sidx] + k := strategy[sidx] sidx++ op.Pow2k(xR, &cparam, 2*k) i += int(k) @@ -92,15 +92,15 @@ func traverseTreePublicKeyB(curve *ProjectiveCurveParameters, xR, phiP, phiQ, ph cparam := op.CalcCurveParamsEquiv3(curve) phi := Newisogeny3(op.Params.Op) - strat := pub.params.B.IsogenyStrategy - stratSz := len(strat) + strategy := pub.params.B.IsogenyStrategy + stratSz := len(strategy) for j := 1; j <= stratSz; j++ { for i <= stratSz-j { points = append(points, *xR) indices = append(indices, i) - k := strat[sidx] + k := strategy[sidx] sidx++ op.Pow3k(xR, &cparam, k) i += int(k) @@ -131,15 +131,15 @@ func traverseTreeSharedKeyB(curve *ProjectiveCurveParameters, xR *ProjectivePoin cparam := op.CalcCurveParamsEquiv3(curve) phi := Newisogeny3(op.Params.Op) - strat := pub.params.B.IsogenyStrategy - stratSz := len(strat) + strategy := pub.params.B.IsogenyStrategy + stratSz := len(strategy) for j := 1; j <= stratSz; j++ { for i <= stratSz-j { points = append(points, *xR) indices = append(indices, i) - k := strat[sidx] + k := strategy[sidx] sidx++ op.Pow3k(xR, &cparam, k) i += int(k) diff --git a/external/github.com/marten-seemann/qtls/13.go b/external/github.com/marten-seemann/qtls/13.go index 8a98e2de13..bde8eec04f 100644 --- a/external/github.com/marten-seemann/qtls/13.go +++ b/external/github.com/marten-seemann/qtls/13.go @@ -1019,7 +1019,7 @@ func (hs *clientHandshakeState) doTLS13Handshake() error { serverHandshakeSecret := hs.keySchedule.deriveSecret(secretHandshakeServer) c.in.exportKey(hs.keySchedule.suite, serverHandshakeSecret) // Already the sender key yet, when using an alternative record layer. - // QUIC needs the handshake write key in order to acknowlege Handshake packets. + // QUIC needs the handshake write key in order to acknowledge Handshake packets. c.out.exportKey(hs.keySchedule.suite, clientHandshakeSecret) // Do not change the sender key yet, the server must authenticate first. c.in.setKey(c.vers, hs.keySchedule.suite, serverHandshakeSecret)