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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
5467e7b3
Commit
5467e7b3
authored
10 years ago
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
whisper: fix comment entity capitalizations
parent
f8a4cd7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
whisper/envelope.go
+2
-2
2 additions, 2 deletions
whisper/envelope.go
whisper/message.go
+5
-5
5 additions, 5 deletions
whisper/message.go
with
7 additions
and
7 deletions
whisper/envelope.go
+
2
−
2
View file @
5467e7b3
...
...
@@ -59,7 +59,7 @@ func (self *Envelope) Seal(pow time.Duration) {
}
}
//
V
alid checks whether the claimed proof of work was indeed executed.
//
v
alid checks whether the claimed proof of work was indeed executed.
// TODO: Is this really useful? Isn't this always true?
func
(
self
*
Envelope
)
valid
()
bool
{
d
:=
make
([]
byte
,
64
)
...
...
@@ -69,7 +69,7 @@ func (self *Envelope) valid() bool {
return
common
.
FirstBitSet
(
common
.
BigD
(
crypto
.
Sha3
(
d
)))
>
0
}
//
R
lpWithoutNonce returns the RLP encoded envelope contents, except the nonce.
//
r
lpWithoutNonce returns the RLP encoded envelope contents, except the nonce.
func
(
self
*
Envelope
)
rlpWithoutNonce
()
[]
byte
{
enc
,
_
:=
rlp
.
EncodeToBytes
([]
interface
{}{
self
.
Expiry
,
self
.
TTL
,
self
.
Topics
,
self
.
Data
})
return
enc
...
...
This diff is collapsed.
Click to expand it.
whisper/message.go
+
5
−
5
View file @
5467e7b3
...
...
@@ -48,7 +48,7 @@ func NewMessage(payload []byte) *Message {
// Wrap bundles the message into an Envelope to transmit over the network.
//
//
Pov
(Proof Of Work) controls how much time to spend on hashing the message,
//
pow
(Proof Of Work) controls how much time to spend on hashing the message,
// inherently controlling its priority through the network (smaller hash, bigger
// priority).
//
...
...
@@ -81,7 +81,7 @@ func (self *Message) Wrap(pow time.Duration, options Options) (*Envelope, error)
return
envelope
,
nil
}
//
S
ign calculates and sets the cryptographic signature for the message , also
//
s
ign calculates and sets the cryptographic signature for the message , also
// setting the sign flag.
func
(
self
*
Message
)
sign
(
key
*
ecdsa
.
PrivateKey
)
(
err
error
)
{
self
.
Flags
|=
1
<<
7
...
...
@@ -101,18 +101,18 @@ func (self *Message) Recover() *ecdsa.PublicKey {
return
pub
}
//
E
ncrypt encrypts a message payload with a public key.
//
e
ncrypt encrypts a message payload with a public key.
func
(
self
*
Message
)
encrypt
(
to
*
ecdsa
.
PublicKey
)
(
err
error
)
{
self
.
Payload
,
err
=
crypto
.
Encrypt
(
to
,
self
.
Payload
)
return
}
//
H
ash calculates the SHA3 checksum of the message flags and payload.
//
h
ash calculates the SHA3 checksum of the message flags and payload.
func
(
self
*
Message
)
hash
()
[]
byte
{
return
crypto
.
Sha3
(
append
([]
byte
{
self
.
Flags
},
self
.
Payload
...
))
}
//
B
ytes flattens the message contents (flags, signature and payload) into a
//
b
ytes flattens the message contents (flags, signature and payload) into a
// single binary blob.
func
(
self
*
Message
)
bytes
()
[]
byte
{
return
append
([]
byte
{
self
.
Flags
},
append
(
self
.
Signature
,
self
.
Payload
...
)
...
)
...
...
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