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
3b81ffe5
Commit
3b81ffe5
authored
3 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
playing with interfaces
parent
ef61cb65
No related branches found
No related tags found
3 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interfaces/networkManager.go
+75
-2
75 additions, 2 deletions
interfaces/networkManager.go
with
75 additions
and
2 deletions
interfaces/networkManager.go
+
75
−
2
View file @
3b81ffe5
...
@@ -8,11 +8,14 @@
...
@@ -8,11 +8,14 @@
package
interfaces
package
interfaces
import
(
import
(
"github.com/cloudflare/circl/dh/sidh"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/elixxir/client/network/gateway"
"gitlab.com/elixxir/client/network/gateway"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/comms/network"
"gitlab.com/elixxir/comms/network"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/e2e"
"gitlab.com/elixxir/crypto/e2e"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id"
...
@@ -22,8 +25,6 @@ import (
...
@@ -22,8 +25,6 @@ import (
type
NetworkManager
interface
{
type
NetworkManager
interface
{
// The stoppable can be nil.
// The stoppable can be nil.
SendE2E
(
m
message
.
Send
,
p
params
.
E2E
,
stop
*
stoppable
.
Single
)
([]
id
.
Round
,
e2e
.
MessageID
,
time
.
Time
,
error
)
SendUnsafe
(
m
message
.
Send
,
p
params
.
Unsafe
)
([]
id
.
Round
,
error
)
SendCMIX
(
message
format
.
Message
,
recipient
*
id
.
ID
,
p
params
.
CMIX
)
(
id
.
Round
,
ephemeral
.
Id
,
error
)
SendCMIX
(
message
format
.
Message
,
recipient
*
id
.
ID
,
p
params
.
CMIX
)
(
id
.
Round
,
ephemeral
.
Id
,
error
)
SendManyCMIX
(
messages
[]
message
.
TargetedCmixMessage
,
p
params
.
CMIX
)
(
id
.
Round
,
[]
ephemeral
.
Id
,
error
)
SendManyCMIX
(
messages
[]
message
.
TargetedCmixMessage
,
p
params
.
CMIX
)
(
id
.
Round
,
[]
ephemeral
.
Id
,
error
)
GetInstance
()
*
network
.
Instance
GetInstance
()
*
network
.
Instance
...
@@ -52,6 +53,78 @@ type NetworkManager interface {
...
@@ -52,6 +53,78 @@ type NetworkManager interface {
// SetPoolFilter sets the filter used to filter gateway IDs.
// SetPoolFilter sets the filter used to filter gateway IDs.
SetPoolFilter
(
f
gateway
.
Filter
)
SetPoolFilter
(
f
gateway
.
Filter
)
/* Identities are all network identites which the client is currently
trying to pick up message on. Each identity has a defult edge
pickup that it will receive on, but this default is generally
low privacy and an alternative should be used in most cases
all identities imply a default edge. An identity must be added,
fake ones will be used to poll the network if none are present */
// AddIdentity adds an identity to be tracked
AddIdentity
(
identity
Identity
)
// RemoveIdentity removes a currently tracked identity.
RemoveIdentity
(
ephID
ephemeral
.
Id
)
//fingerprints
AddFingerprint
(
fingerprint
format
.
Fingerprint
,
response
FingerprintResponse
)
CheckFingerprint
(
fingerprint
format
.
Fingerprint
)
bool
RemoveFingerprint
(
fingerprint
format
.
Fingerprint
)
bool
/* trigger - predefined hash based tags appended to all cmix messages
which, though trial hashing, are used to determine if a message
is for a specific identity, can can contain metadata about
the sending party
These can be processed by the notifications system, or can be used to*/
AddEdge
(
preimage
EdgePreimage
,
identity
*
id
.
ID
)
RemoveEdge
(
preimage
EdgePreimage
,
identity
*
id
.
ID
)
error
}
type
EdgePreimage
struct
{
Data
[]
byte
Type
string
Source
[]
byte
}
type
Identity
struct
{
// Identity
EphId
ephemeral
.
Id
Source
*
id
.
ID
AddressSize
uint8
// Usage variables
End
time
.
Time
// Timestamp when active polling will stop
ExtraChecks
uint
// Number of extra checks executed as active after the
// ID exits active
// Polling parameters
StartValid
time
.
Time
// Timestamp when the ephID begins being valid
EndValid
time
.
Time
// Timestamp when the ephID stops being valid
// Makes the identity not store on disk
Ephemeral
bool
}
type
FingerprintResponse
func
(
format
.
Message
)
type
Ratchet
interface
{
SendE2E
(
m
message
.
Send
,
p
params
.
E2E
,
stop
*
stoppable
.
Single
)
([]
id
.
Round
,
e2e
.
MessageID
,
time
.
Time
,
error
)
SendUnsafe
(
m
message
.
Send
,
p
params
.
Unsafe
)
([]
id
.
Round
,
error
)
AddPartner
(
partnerID
*
id
.
ID
,
partnerPubKey
,
myPrivKey
*
cyclic
.
Int
,
partnerSIDHPubKey
*
sidh
.
PublicKey
,
mySIDHPrivKey
*
sidh
.
PrivateKey
,
sendParams
,
receiveParams
params
.
E2ESessionParams
)
GetPartner
(
partnerID
*
id
.
ID
)
(
*
Manager
,
error
)
DeletePartner
(
partnerId
*
id
.
ID
)
GetAllPartnerIDs
()
[]
*
id
.
ID
}
}
//for use in key exchange which needs to be callable inside of network
//for use in key exchange which needs to be callable inside of network
...
...
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