Skip to content
Snippets Groups Projects
Commit 3be0598e authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Format

parent c7abe5ad
No related branches found
No related tags found
No related merge requests found
Showing with 123 additions and 134 deletions
......@@ -9,16 +9,16 @@ package benchmark
import (
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/globals"
"gitlab.com/privategrity/server/services"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/cryptops/realtime"
"gitlab.com/privategrity/server/globals"
"gitlab.com/privategrity/server/services"
jww "github.com/spf13/jwalterweatherman"
"testing"
"strconv"
"fmt"
"strconv"
"testing"
)
var PRIME = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" +
......@@ -76,7 +76,6 @@ func GenerateRounds(nodeCount int, BatchSize uint64,
}
}
// Run the GENERATION step
generations := make([]*services.ThreadController, nodeCount)
for i := 0; i < nodeCount; i++ {
......@@ -300,8 +299,6 @@ func MultiNodePrecomp(nodeCount int, BatchSize uint64,
}
}
LNStrip := services.DispatchCryptop(group, precomputation.Strip{},
nil, nil, LastRound)
......@@ -435,7 +432,6 @@ func MultiNodeRealtime(nodeCount int, BatchSize uint64,
rtdecrypts[0].InChannel <- &in
}
// TODO: Consider doing this better and re-enabling the prints if they are
// useful
......@@ -499,7 +495,7 @@ func Precomp(nodeCount int, batchSize uint64, b *testing.B) {
}
}
func CopyRounds(nodeCount int, r []*globals.Round) ([]*globals.Round) {
func CopyRounds(nodeCount int, r []*globals.Round) []*globals.Round {
tmp := make([]*globals.Round, nodeCount)
for i := 0; i < nodeCount; i++ {
tmp[i] = globals.NewRound(r[i].BatchSize)
......@@ -633,7 +629,6 @@ func PrecompIterations(nodeCount int, batchSize uint64, iterations int) {
}
}
// Run realtime simulation for given number of of iterations
func RealtimeIterations(nodeCount int, batchSize uint64, iterations int) {
prime := cyclic.NewInt(0)
......
package cmd
import (
"gitlab.com/privategrity/server/benchmark"
"fmt"
"github.com/spf13/cobra"
"gitlab.com/privategrity/server/benchmark"
"time"
"fmt"
)
var benchBatchSize uint64
......
......@@ -14,9 +14,9 @@ import (
"github.com/spf13/cobra"
jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper"
"gitlab.com/privategrity/crypto/forward"
"gitlab.com/privategrity/server/node"
"math"
"gitlab.com/privategrity/crypto/forward"
)
var cfgFile string
......
......@@ -8,12 +8,12 @@
package cryptops
import (
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/crypto/forward"
"gitlab.com/privategrity/server/cryptops/realtime"
"gitlab.com/privategrity/server/globals"
"gitlab.com/privategrity/server/services"
"gitlab.com/privategrity/server/cryptops/realtime"
jww "github.com/spf13/jwalterweatherman"
)
//Denotes what kind of key will be
......@@ -26,7 +26,6 @@ const (
RETURN KeyType = 4
)
// Generate client key creates shared keys for the client's transmission and
// reception and creates the next recursive key for that shared key using the
// current recursive key. These keys are used to encrypt and decrypt user
......@@ -91,7 +90,6 @@ func (g GenerateClientKey) Run(group *cyclic.Group, in,
return in
}
user, _ := globals.Users.GetUser(in.CurrentID)
if user == nil {
......@@ -117,7 +115,6 @@ func (g GenerateClientKey) Run(group *cyclic.Group, in,
" Slot: %v; Received: %v", in.Slot, keys.keySelection)
}
globals.Users.UpsertUser(user)
return in
......
......@@ -86,9 +86,6 @@ func (d Decrypt) Run(g *cyclic.Group, in *RealtimeSlot,
// Create Temporary variable
tmp := cyclic.NewMaxInt()
// Eq 3.1: Modulo Multiplies the First Unpermuted Internode Message Key together
// with with Transmission key before modulo multiplying into the
// EncryptedMessage
......
package globals
import (
jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper"
"math"
jww "github.com/spf13/jwalterweatherman"
)
var nodeId = uint64(math.MaxUint64)
......
......@@ -7,9 +7,9 @@
package globals
import (
"github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"github.com/spf13/jwalterweatherman"
)
const NIL_USER uint64 = 0
......
......@@ -180,7 +180,7 @@ func (m *UserDatabase) GetNickList() (ids []uint64, nicks []string) {
ids = make([]uint64, len(model))
nicks = make([]string, len(model))
for i, user := range(model) {
for i, user := range model {
ids[i] = user.Id
nicks[i] = user.Nick
}
......
......@@ -8,14 +8,14 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/server/cryptops"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/cryptops/realtime"
"gitlab.com/privategrity/server/globals"
"gitlab.com/privategrity/server/services"
"time"
"gitlab.com/privategrity/server/cryptops"
)
// Comms method for kicking off a new round in CMIX
......
......@@ -7,8 +7,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/globals"
......
......@@ -7,8 +7,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/globals"
......
......@@ -8,8 +8,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/globals"
......
......@@ -7,8 +7,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/globals"
......
......@@ -8,8 +8,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/precomputation"
"gitlab.com/privategrity/server/globals"
......
......@@ -8,8 +8,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/realtime"
"gitlab.com/privategrity/server/globals"
......
......@@ -8,8 +8,8 @@ package io
import (
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/comms/clusterclient"
pb "gitlab.com/privategrity/comms/mixmessages"
"gitlab.com/privategrity/crypto/cyclic"
"gitlab.com/privategrity/server/cryptops/realtime"
"gitlab.com/privategrity/server/globals"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment