Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
parity-signer
Commits
22a30164
Commit
22a30164
authored
Feb 20, 2017
by
Marek Kotewicz
Browse files
removed obsolete crypto functions
parent
253d5899
Changes
2
Show whitespace changes
Inline
Side-by-side
package.json
View file @
22a30164
...
...
@@ -10,8 +10,6 @@
},
"dependencies"
:
{
"
debounce
"
:
"
^1.0.0
"
,
"
elliptic
"
:
"
^6.3.2
"
,
"
js-sha3
"
:
"
^0.5.7
"
,
"
react
"
:
"
^15.4.2
"
,
"
react-native
"
:
"
0.40.0
"
,
"
react-native-camera
"
:
"
^0.5.1
"
,
...
...
src/util/crypto.js
View file @
22a30164
import
{
ec
}
from
'
elliptic
'
import
{
keccak_256
}
from
'
js-sha3
'
var
secp
=
new
ec
(
'
secp256k1
'
)
import
{
EthkeyBridge
}
from
'
NativeModules
'
export
function
keypairFromPhrase
(
phrase
)
{
var
seed
=
keccak_256
.
array
(
phrase
);
var
kp
;
for
(
var
i
=
0
;
i
<=
16384
||
!
toAddress
(
kp
=
secp
.
keyFromPrivate
(
seed
)).
startsWith
(
'
00
'
);
++
i
)
seed
=
keccak_256
.
array
(
seed
)
return
kp
}
export
function
toAddress
(
kp
)
{
return
keccak_256
(
kp
.
getPublic
(
'
buffer
'
).
slice
(
1
)).
substr
(
24
);
}
export
function
brainWalletAddress
(
seed
,
callback
)
{
EthkeyBridge
.
brainWalletAddress
(
seed
,
callback
)
}
export
const
brainWalletAddress
=
EthkeyBridge
.
brainWalletAddress
;
export
const
brainWalletSecret
=
EthkeyBridge
.
brainWalletSecret
;
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment