diff --git a/api/client.go b/api/client.go index bc460a17df20e7d5eebda5344843665ddfcb38eb..012e980a5d946c5dd632b896a9d26037d9b308bd 100644 --- a/api/client.go +++ b/api/client.go @@ -75,7 +75,7 @@ type Client struct { func NewClient(ndfJSON, storageDir string, password []byte, registrationCode string) error { jww.INFO.Printf("NewClient(dir: %s)", storageDir) // 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 def, err := parseNDF(ndfJSON) @@ -106,7 +106,7 @@ func NewClient(ndfJSON, storageDir string, password []byte, registrationCode str func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password []byte) error { jww.INFO.Printf("NewPrecannedClient()") // 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() // Parse the NDF @@ -135,7 +135,7 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [ func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCode string, userIdPrefix string) error { jww.INFO.Printf("NewVanityClient()") // 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() // Parse the NDF @@ -161,7 +161,7 @@ func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCo func OpenClient(storageDir string, password []byte, parameters params.Network) (*Client, error) { jww.INFO.Printf("OpenClient()") // 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 currentVersion, err := version.ParseVersion(SEMVER) diff --git a/api/mnemonic.go b/api/mnemonic.go index c161aea60c64b1b2079c908714560a5ac6349de0..9b262da82c81bebcc01fd185adbc5d60a196cb6b 100644 --- a/api/mnemonic.go +++ b/api/mnemonic.go @@ -24,7 +24,7 @@ const mnemonicFile = ".recovery" // This encrypted data saved in storage. func StoreSecretWithMnemonic(secret []byte, path string) (string, error) { // 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 "/" if !strings.HasSuffix(path, string(filepath.Separator)) { diff --git a/network/node/register.go b/network/node/register.go index a4424eb18b16b98f2b1766f68101fcf7c8fe11b4..276b17a5712ddeccb562e56807c58c6dd644a874 100644 --- a/network/node/register.go +++ b/network/node/register.go @@ -43,7 +43,7 @@ type RegisterNodeCommsInterface interface { } 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") @@ -52,7 +52,7 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen for i := uint(0); i < numParallel; 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) } @@ -61,7 +61,8 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen func registerNodes(sender *gateway.Sender, session *storage.Session, 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() regSignature := u.GetTransmissionRegistrationValidationSignature() // Timestamp in which user has registered with registration