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
0f3f9a9f
Commit
0f3f9a9f
authored
4 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
fixed user generation, was creating e2e keys in wrong groups
added the deffintion of message IDs
parent
18199c80
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/user.go
+2
-2
2 additions, 2 deletions
api/user.go
interfaces/message/id.go
+35
-0
35 additions, 0 deletions
interfaces/message/id.go
interfaces/message/receiveMessage.go
+3
-0
3 additions, 0 deletions
interfaces/message/receiveMessage.go
with
40 additions
and
2 deletions
api/user.go
+
2
−
2
View file @
0f3f9a9f
...
@@ -62,7 +62,7 @@ func createNewUser(rng csprng.Source, cmix, e2e *cyclic.Group) user.User {
...
@@ -62,7 +62,7 @@ func createNewUser(rng csprng.Source, cmix, e2e *cyclic.Group) user.User {
RSA
:
rsaKey
,
RSA
:
rsaKey
,
Precanned
:
false
,
Precanned
:
false
,
CmixDhPrivateKey
:
cmix
.
NewIntFromBytes
(
cMixKeyBytes
),
CmixDhPrivateKey
:
cmix
.
NewIntFromBytes
(
cMixKeyBytes
),
E2eDhPrivateKey
:
cmix
.
NewIntFromBytes
(
e2eKeyBytes
),
E2eDhPrivateKey
:
e2e
.
NewIntFromBytes
(
e2eKeyBytes
),
}
}
}
}
...
@@ -89,6 +89,6 @@ func createPrecannedUser(precannedID uint, rng csprng.Source, cmix, e2e *cyclic.
...
@@ -89,6 +89,6 @@ func createPrecannedUser(precannedID uint, rng csprng.Source, cmix, e2e *cyclic.
ID
:
userID
.
DeepCopy
(),
ID
:
userID
.
DeepCopy
(),
Salt
:
salt
,
Salt
:
salt
,
Precanned
:
false
,
Precanned
:
false
,
E2eDhPrivateKey
:
cmix
.
NewIntFromBytes
(
e2eKeyBytes
),
E2eDhPrivateKey
:
e2e
.
NewIntFromBytes
(
e2eKeyBytes
),
}
}
}
}
This diff is collapsed.
Click to expand it.
interfaces/message/id.go
0 → 100644
+
35
−
0
View file @
0f3f9a9f
package
message
import
(
"encoding/binary"
"gitlab.com/elixxir/crypto/hash"
"gitlab.com/xx_network/primitives/id"
jww
"github.com/spf13/jwalterweatherman"
)
const
messageIDLen
=
32
type
ID
[
messageIDLen
]
byte
func
NewID
(
sender
,
receiver
*
id
.
ID
,
connectionSalt
[]
byte
,
internalMessageID
uint64
)
ID
{
h
,
err
:=
hash
.
NewCMixHash
()
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Failed to get hash for message ID creation"
)
}
h
.
Write
(
sender
.
Bytes
())
h
.
Write
(
receiver
.
Bytes
())
intMidBytes
:=
make
([]
byte
,
8
)
binary
.
BigEndian
.
PutUint64
(
intMidBytes
,
internalMessageID
)
h
.
Write
(
intMidBytes
)
h
.
Write
(
connectionSalt
)
midBytes
:=
h
.
Sum
(
nil
)
mid
:=
ID
{}
copy
(
mid
[
:
],
midBytes
)
return
mid
}
This diff is collapsed.
Click to expand it.
interfaces/message/receiveMessage.go
+
3
−
0
View file @
0f3f9a9f
...
@@ -11,4 +11,7 @@ type Receive struct {
...
@@ -11,4 +11,7 @@ type Receive struct {
Sender
*
id
.
ID
Sender
*
id
.
ID
Timestamp
time
.
Time
Timestamp
time
.
Time
Encryption
EncryptionType
Encryption
EncryptionType
Id
ID
}
}
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