forked from Qortal/qortal
Browse Source
Added mass (x1000) testing of key conversion and shared secret calculations. Fix incorrect proxy private key test that has expected result from previous algorithm. Added another test HTML/JS file.split-DB
catbref
5 years ago
3 changed files with 70 additions and 1 deletions
@ -0,0 +1,22 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<script src="Base58.js"></script> |
||||||
|
<script src="nacl_factory.js"></script> |
||||||
|
<script> |
||||||
|
nacl_factory.instantiate(function (nacl) { |
||||||
|
var ed25519PrivateKey = Base58.decode('GQjr1enbi7R4tbRYAbrcwWRWjH9avuC3nRhdGB3pR2DF'); |
||||||
|
var ed25519KeyPair = nacl.crypto_sign_seed_keypair(ed25519PrivateKey); |
||||||
|
|
||||||
|
var x25519KeyPair = nacl.crypto_box_keypair_from_sign_sk(ed25519KeyPair.signSk); |
||||||
|
var x25519PublicKeyFromPrivate = x25519KeyPair.boxPk; |
||||||
|
console.log("X25519 public key from private: " + Base58.encode(x25519PublicKeyFromPrivate)); |
||||||
|
|
||||||
|
var x25519PublicKeyFromEd25519 = nacl.crypto_box_pk_from_sign_pk(ed25519KeyPair.signPk); |
||||||
|
console.log("X25519 public key from Ed25519: " + Base58.encode(x25519PublicKeyFromEd25519)); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
</body> |
||||||
|
</html> |
Loading…
Reference in new issue