Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
e7f4a10e
Commit
e7f4a10e
authored
3 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Remove all 256 bit key generation in client
parent
68c74a2b
No related branches found
No related tags found
4 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
,
!197
WIP: Convert API to use new restructure
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/user.go
+7
-14
7 additions, 14 deletions
api/user.go
cmix/nodes/register.go
+7
-7
7 additions, 7 deletions
cmix/nodes/register.go
with
14 additions
and
21 deletions
api/user.go
+
7
−
14
View file @
e7f4a10e
...
...
@@ -104,12 +104,7 @@ func createDhKeys(rng *fastRNG.StreamGenerator,
var
err
error
rngStream
:=
rng
.
GetStream
()
prime
:=
e2e
.
GetPBytes
()
// FIXME: Why 256 bits? -- this is spec but not
// explained, it has to do with optimizing operations
// on one side and still preserves decent security --
// cite this. Why valid for BOTH e2e and cmix?
//keyLen := len(prime)
keyLen
:=
256
keyLen
:=
len
(
prime
)
e2eKeyBytes
,
err
=
csprng
.
GenerateInGroup
(
prime
,
keyLen
,
rngStream
)
rngStream
.
Close
()
...
...
@@ -153,11 +148,10 @@ func createDhKeys(rng *fastRNG.StreamGenerator,
func
createPrecannedUser
(
precannedID
uint
,
rng
csprng
.
Source
,
cmix
,
e2e
*
cyclic
.
Group
)
user
.
Info
{
// DH Keygen
// FIXME: Why 256 bits? -- this is spec but not explained, it has
// to do with optimizing operations on one side and still preserves
// decent security -- cite this. Why valid for BOTH e2e and cmix?
prng
:=
rand
.
New
(
rand
.
NewSource
(
int64
(
precannedID
)))
e2eKeyBytes
,
err
:=
csprng
.
GenerateInGroup
(
e2e
.
GetPBytes
(),
256
,
prng
)
prime
:=
e2e
.
GetPBytes
()
keyLen
:=
len
(
prime
)
e2eKeyBytes
,
err
:=
csprng
.
GenerateInGroup
(
prime
,
keyLen
,
prng
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
err
.
Error
())
}
...
...
@@ -192,10 +186,9 @@ func createPrecannedUser(precannedID uint, rng csprng.Source, cmix,
func
createNewVanityUser
(
rng
csprng
.
Source
,
cmix
,
e2e
*
cyclic
.
Group
,
prefix
string
)
user
.
Info
{
// DH Keygen
// FIXME: Why 256 bits? -- this is spec but not explained, it has
// to do with optimizing operations on one side and still preserves
// decent security -- cite this. Why valid for BOTH e2e and cmix?
e2eKeyBytes
,
err
:=
csprng
.
GenerateInGroup
(
e2e
.
GetPBytes
(),
256
,
rng
)
prime
:=
e2e
.
GetPBytes
()
keyLen
:=
len
(
prime
)
e2eKeyBytes
,
err
:=
csprng
.
GenerateInGroup
(
prime
,
keyLen
,
rng
)
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
err
.
Error
())
}
...
...
This diff is collapsed.
Click to expand it.
cmix/nodes/register.go
+
7
−
7
View file @
e7f4a10e
...
...
@@ -10,6 +10,10 @@ package nodes
import
(
"crypto/sha256"
"encoding/hex"
"strconv"
"sync"
"time"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
jww
"github.com/spf13/jwalterweatherman"
...
...
@@ -31,9 +35,6 @@ import (
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf"
"gitlab.com/xx_network/primitives/netTime"
"strconv"
"sync"
"time"
)
func
registerNodes
(
r
*
registrar
,
s
storage
.
Session
,
stop
*
stoppable
.
Single
,
...
...
@@ -155,10 +156,9 @@ func requestKey(sender gateway.Sender, comms RegisterNodeCommsInterface,
grp
:=
r
.
session
.
GetCmixGroup
()
// FIXME: Why 256 bits? -- this is spec but not explained, it has to do with
// optimizing operations on one side and still preserves decent security --
// cite this.
dhPrivBytes
,
err
:=
csprng
.
GenerateInGroup
(
grp
.
GetPBytes
(),
256
,
rng
)
prime
:=
grp
.
GetPBytes
()
keyLen
:=
len
(
prime
)
dhPrivBytes
,
err
:=
csprng
.
GenerateInGroup
(
prime
,
keyLen
,
rng
)
if
err
!=
nil
{
return
nil
,
nil
,
0
,
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment