Skip to content

Commit

Permalink
Fix misspelling according to goreportcard result (v2ray#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loyalsoldier committed Oct 8, 2020
1 parent 425b4b4 commit 4545283
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/dns/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
4 changes: 2 additions & 2 deletions app/stats/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion external/github.com/cheekybits/genny/generic/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion external/github.com/cloudflare/sidh/p503/arith_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down
2 changes: 1 addition & 1 deletion external/github.com/cloudflare/sidh/p503/field_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion external/github.com/cloudflare/sidh/p751/arith_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down
5 changes: 3 additions & 2 deletions external/github.com/cloudflare/sidh/sidh/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sidh
import (
"errors"
"io"

. "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny"
)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions external/github.com/cloudflare/sidh/sidh/sidh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion external/github.com/marten-seemann/qtls/13.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4545283

Please sign in to comment.