Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
3d971c5a
Commit
3d971c5a
authored
Feb 21, 2016
by
Ricardo Catalinas Jiménez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypto: Remove dead code
parent
0c666555
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
11 deletions
+0
-11
crypto.go
crypto/crypto.go
+0
-1
rand_entropy.go
crypto/randentropy/rand_entropy.go
+0
-10
No files found.
crypto/crypto.go
View file @
3d971c5a
...
@@ -68,7 +68,6 @@ func Sha3Hash(data ...[]byte) common.Hash { return Keccak256Hash(data...) }
...
@@ -68,7 +68,6 @@ func Sha3Hash(data ...[]byte) common.Hash { return Keccak256Hash(data...) }
func
CreateAddress
(
b
common
.
Address
,
nonce
uint64
)
common
.
Address
{
func
CreateAddress
(
b
common
.
Address
,
nonce
uint64
)
common
.
Address
{
data
,
_
:=
rlp
.
EncodeToBytes
([]
interface
{}{
b
,
nonce
})
data
,
_
:=
rlp
.
EncodeToBytes
([]
interface
{}{
b
,
nonce
})
return
common
.
BytesToAddress
(
Keccak256
(
data
)[
12
:
])
return
common
.
BytesToAddress
(
Keccak256
(
data
)[
12
:
])
//return Sha3(common.NewValue([]interface{}{b, nonce}).Encode())[12:]
}
}
func
Sha256
(
data
[]
byte
)
[]
byte
{
func
Sha256
(
data
[]
byte
)
[]
byte
{
...
...
crypto/randentropy/rand_entropy.go
View file @
3d971c5a
...
@@ -19,8 +19,6 @@ package randentropy
...
@@ -19,8 +19,6 @@ package randentropy
import
(
import
(
crand
"crypto/rand"
crand
"crypto/rand"
"io"
"io"
"github.com/ethereum/go-ethereum/crypto/sha3"
)
)
var
Reader
io
.
Reader
=
&
randEntropy
{}
var
Reader
io
.
Reader
=
&
randEntropy
{}
...
@@ -34,14 +32,6 @@ func (*randEntropy) Read(bytes []byte) (n int, err error) {
...
@@ -34,14 +32,6 @@ func (*randEntropy) Read(bytes []byte) (n int, err error) {
return
len
(
bytes
),
nil
return
len
(
bytes
),
nil
}
}
// TODO: copied from crypto.go , move to sha3 package?
func
Sha3
(
data
[]
byte
)
[]
byte
{
d
:=
sha3
.
NewKeccak256
()
d
.
Write
(
data
)
return
d
.
Sum
(
nil
)
}
func
GetEntropyCSPRNG
(
n
int
)
[]
byte
{
func
GetEntropyCSPRNG
(
n
int
)
[]
byte
{
mainBuff
:=
make
([]
byte
,
n
)
mainBuff
:=
make
([]
byte
,
n
)
_
,
err
:=
io
.
ReadFull
(
crand
.
Reader
,
mainBuff
)
_
,
err
:=
io
.
ReadFull
(
crand
.
Reader
,
mainBuff
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment