good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
f8061fcb
Commit
f8061fcb
authored
Dec 12, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
fixed tests
parent
4c84db85
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
crypto/encrypt_decrypt_test.go
+1
-1
1 addition, 1 deletion
crypto/encrypt_decrypt_test.go
ui/qt/qwhisper/whisper.go
+9
-9
9 additions, 9 deletions
ui/qt/qwhisper/whisper.go
with
10 additions
and
10 deletions
crypto/encrypt_decrypt_test.go
+
1
−
1
View file @
f8061fcb
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
func
TestBox
(
t
*
testing
.
T
)
{
func
TestBox
(
t
*
testing
.
T
)
{
prv1
:=
ToECDSA
(
ethutil
.
Hex2Bytes
(
"4b50fa71f5c3eeb8fdc452224b2395af2fcc3d125e06c32c82e048c0559db03f"
))
prv1
:=
ToECDSA
(
ethutil
.
Hex2Bytes
(
"4b50fa71f5c3eeb8fdc452224b2395af2fcc3d125e06c32c82e048c0559db03f"
))
prv2
:=
ToECDSA
(
ethutil
.
Hex2Bytes
(
"d0b043b4c5d657670778242d82d68a29d25d7d711127d17b8e299f156dad361a"
))
prv2
:=
ToECDSA
(
ethutil
.
Hex2Bytes
(
"d0b043b4c5d657670778242d82d68a29d25d7d711127d17b8e299f156dad361a"
))
pub2
:=
Pub
ToECDSA
(
ethutil
.
Hex2Bytes
(
"04bd27a63c91fe3233c5777e6d3d7b39204d398c8f92655947eb5a373d46e1688f022a1632d264725cbc7dc43ee1cfebde42fa0a86d08b55d2acfbb5e9b3b48dc5"
))
pub2
:=
ToECDSA
Pub
(
ethutil
.
Hex2Bytes
(
"04bd27a63c91fe3233c5777e6d3d7b39204d398c8f92655947eb5a373d46e1688f022a1632d264725cbc7dc43ee1cfebde42fa0a86d08b55d2acfbb5e9b3b48dc5"
))
message
:=
[]
byte
(
"Hello, world."
)
message
:=
[]
byte
(
"Hello, world."
)
ct
,
err
:=
Encrypt
(
pub2
,
message
)
ct
,
err
:=
Encrypt
(
pub2
,
message
)
...
...
This diff is collapsed.
Click to expand it.
ui/qt/qwhisper/whisper.go
+
9
−
9
View file @
f8061fcb
...
@@ -3,6 +3,7 @@ package qwhisper
...
@@ -3,6 +3,7 @@ package qwhisper
import
(
import
(
"time"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/whisper"
"github.com/ethereum/go-ethereum/whisper"
)
)
...
@@ -27,7 +28,7 @@ func (self *Whisper) Post(data string, pow, ttl uint32, to, from string) {
...
@@ -27,7 +28,7 @@ func (self *Whisper) Post(data string, pow, ttl uint32, to, from string) {
msg
:=
whisper
.
NewMessage
(
fromHex
(
data
))
msg
:=
whisper
.
NewMessage
(
fromHex
(
data
))
envelope
,
err
:=
msg
.
Seal
(
time
.
Duration
(
pow
),
whisper
.
Opts
{
envelope
,
err
:=
msg
.
Seal
(
time
.
Duration
(
pow
),
whisper
.
Opts
{
Ttl
:
time
.
Duration
(
ttl
),
Ttl
:
time
.
Duration
(
ttl
),
To
:
crypto
.
Pub
TECDSA
(
fromHex
(
to
)),
To
:
crypto
.
T
o
ECDSA
Pub
(
fromHex
(
to
)),
From
:
crypto
.
ToECDSA
(
fromHex
(
from
)),
From
:
crypto
.
ToECDSA
(
fromHex
(
from
)),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -35,7 +36,7 @@ func (self *Whisper) Post(data string, pow, ttl uint32, to, from string) {
...
@@ -35,7 +36,7 @@ func (self *Whisper) Post(data string, pow, ttl uint32, to, from string) {
return
return
}
}
if
err
:=
self
.
Whisper
.
Send
(
envo
l
pe
);
err
!=
nil
{
if
err
:=
self
.
Whisper
.
Send
(
env
el
ope
);
err
!=
nil
{
// handle error
// handle error
return
return
}
}
...
@@ -51,20 +52,19 @@ func (self *Whisper) HasIdentify(key string) bool {
...
@@ -51,20 +52,19 @@ func (self *Whisper) HasIdentify(key string) bool {
func
(
self
*
Whisper
)
Watch
(
opts
map
[
string
]
interface
{})
{
func
(
self
*
Whisper
)
Watch
(
opts
map
[
string
]
interface
{})
{
filter
:=
filterFromMap
(
opts
)
filter
:=
filterFromMap
(
opts
)
filter
.
Fn
=
func
(
msg
*
Message
)
{
filter
.
Fn
=
func
(
msg
*
whisper
.
Message
)
{
// TODO POST TO QT WINDOW
// TODO POST TO QT WINDOW
}
}
self
.
Watch
(
filter
)
self
.
Whisper
.
Watch
(
filter
)
}
}
func
filterFromMap
(
opts
map
[
string
]
interface
{})
whisper
.
Filter
{
func
filterFromMap
(
opts
map
[
string
]
interface
{})
(
f
whisper
.
Filter
)
{
var
f
Filter
if
to
,
ok
:=
opts
[
"to"
]
.
(
string
);
ok
{
if
to
,
ok
:=
opts
[
"to"
]
.
(
string
);
ok
{
f
.
To
=
ToECDSA
(
fromHex
(
to
))
f
.
To
=
crypto
.
ToECDSA
(
fromHex
(
to
))
}
}
if
from
,
ok
:=
opts
[
"from"
]
.
(
string
);
ok
{
if
from
,
ok
:=
opts
[
"from"
]
.
(
string
);
ok
{
f
.
From
=
ToECDSAPub
(
fromHex
(
from
))
f
.
From
=
crypto
.
ToECDSAPub
(
fromHex
(
from
))
}
}
return
f
return
}
}
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