Skip to content
Snippets Groups Projects
Commit d4de7265 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

increased number of buffered streams

parent 95d50cdd
No related branches found
No related tags found
1 merge request!53Release
...@@ -75,7 +75,7 @@ type Client struct { ...@@ -75,7 +75,7 @@ type Client struct {
func NewClient(ndfJSON, storageDir string, password []byte, registrationCode string) error { func NewClient(ndfJSON, storageDir string, password []byte, registrationCode string) error {
jww.INFO.Printf("NewClient(dir: %s)", storageDir) jww.INFO.Printf("NewClient(dir: %s)", storageDir)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG) rngStreamGen := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG)
// Parse the NDF // Parse the NDF
def, err := parseNDF(ndfJSON) def, err := parseNDF(ndfJSON)
...@@ -106,7 +106,7 @@ func NewClient(ndfJSON, storageDir string, password []byte, registrationCode str ...@@ -106,7 +106,7 @@ func NewClient(ndfJSON, storageDir string, password []byte, registrationCode str
func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password []byte) error { func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password []byte) error {
jww.INFO.Printf("NewPrecannedClient()") jww.INFO.Printf("NewPrecannedClient()")
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG) rngStreamGen := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG)
rngStream := rngStreamGen.GetStream() rngStream := rngStreamGen.GetStream()
// Parse the NDF // Parse the NDF
...@@ -135,7 +135,7 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [ ...@@ -135,7 +135,7 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [
func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCode string, userIdPrefix string) error { func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCode string, userIdPrefix string) error {
jww.INFO.Printf("NewVanityClient()") jww.INFO.Printf("NewVanityClient()")
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG) rngStreamGen := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG)
rngStream := rngStreamGen.GetStream() rngStream := rngStreamGen.GetStream()
// Parse the NDF // Parse the NDF
...@@ -161,7 +161,7 @@ func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCo ...@@ -161,7 +161,7 @@ func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCo
func OpenClient(storageDir string, password []byte, parameters params.Network) (*Client, error) { func OpenClient(storageDir string, password []byte, parameters params.Network) (*Client, error) {
jww.INFO.Printf("OpenClient()") jww.INFO.Printf("OpenClient()")
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG) rngStreamGen := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG)
// Get current client version // Get current client version
currentVersion, err := version.ParseVersion(SEMVER) currentVersion, err := version.ParseVersion(SEMVER)
......
...@@ -24,7 +24,7 @@ const mnemonicFile = ".recovery" ...@@ -24,7 +24,7 @@ const mnemonicFile = ".recovery"
// This encrypted data saved in storage. // This encrypted data saved in storage.
func StoreSecretWithMnemonic(secret []byte, path string) (string, error) { func StoreSecretWithMnemonic(secret []byte, path string) (string, error) {
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rng := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG).GetStream() rng := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG).GetStream()
// Ensure path is appended by filepath separator "/" // Ensure path is appended by filepath separator "/"
if !strings.HasSuffix(path, string(filepath.Separator)) { if !strings.HasSuffix(path, string(filepath.Separator)) {
......
...@@ -43,7 +43,7 @@ type RegisterNodeCommsInterface interface { ...@@ -43,7 +43,7 @@ type RegisterNodeCommsInterface interface {
} }
func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen *fastRNG.StreamGenerator, comms RegisterNodeCommsInterface, func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen *fastRNG.StreamGenerator, comms RegisterNodeCommsInterface,
c chan network.NodeGateway, numParallel uint) stoppable.Stoppable { c chan network.NodeGateway, numParallel uint, networkInstance *network.Instance) stoppable.Stoppable {
multi := stoppable.NewMulti("NodeRegistrations") multi := stoppable.NewMulti("NodeRegistrations")
...@@ -52,7 +52,7 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen ...@@ -52,7 +52,7 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen
for i := uint(0); i < numParallel; i++ { for i := uint(0); i < numParallel; i++ {
stop := stoppable.NewSingle(fmt.Sprintf("NodeRegistration %d", i)) stop := stoppable.NewSingle(fmt.Sprintf("NodeRegistration %d", i))
go registerNodes(sender, session, rngGen, comms, stop, c, inProgess) go registerNodes(sender, session, rngGen, comms, stop, c, inProgess, networkInstance)
multi.Add(stop) multi.Add(stop)
} }
...@@ -61,7 +61,8 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen ...@@ -61,7 +61,8 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen
func registerNodes(sender *gateway.Sender, session *storage.Session, func registerNodes(sender *gateway.Sender, session *storage.Session,
rngGen *fastRNG.StreamGenerator, comms RegisterNodeCommsInterface, rngGen *fastRNG.StreamGenerator, comms RegisterNodeCommsInterface,
stop *stoppable.Single, c chan network.NodeGateway, inProgress *sync.Map) { stop *stoppable.Single, c chan network.NodeGateway, inProgress *sync.Map,
networkInstance *network.Instance) {
u := session.User() u := session.User()
regSignature := u.GetTransmissionRegistrationValidationSignature() regSignature := u.GetTransmissionRegistrationValidationSignature()
// Timestamp in which user has registered with registration // Timestamp in which user has registered with registration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment