1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-02 02:41:28 +00:00

update emscripten stuff

This commit is contained in:
Pavol Rusnak 2017-03-30 17:53:09 +02:00
parent aa16b53bba
commit 36f099fe62
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 16 additions and 14 deletions

View File

@ -6,18 +6,20 @@ EMFLAGS = \
-s EXPORTED_FUNCTIONS='["_hdnode_public_ckd_address_optimized", "_ecdsa_read_pubkey"]'
SRC = ../bignum.c ../ecdsa.c ../secp256k1.c ../hmac.c ../bip32.c \
../base58.c ../ripemd160.c ../sha2.c ../rand.c
../base58.c ../ripemd160.c ../sha2.c ../rand.c ../address.c
all: trezor-crypto.js test-browserify.js
trezor-crypto.js: $(SRC)
emcc $(EMFLAGS) -o $@ $^
test-node: node_modules trezor-crypto.js test.js
node test.js
test-browserify.js: node_modules trezor-crypto.js test.js
$(shell npm bin)/browserify test.js -o $@ --noparse=`pwd`/trezor-crypto.js
@echo "open test.html in your favourite browser"
test-node: node_modules trezor-crypto.js test.js
node test.js
node_modules:
npm install
npm install browserify

View File

@ -24,7 +24,7 @@ var CHAINCODE_SIZE = 32;
var _chaincode = _malloc(CHAINCODE_SIZE);
// address string global
var ADDRESS_SIZE = 40; // maximum size
var ADDRESS_SIZE = 60; // maximum size
var _address = _malloc(ADDRESS_SIZE);
/*
@ -52,7 +52,7 @@ function serializeNode(node) {
* @return {String}
*/
function deriveAddress(index, version) {
_hdnode_public_ckd_address_optimized(_pubpoint, _pubkey, _chaincode, index, version, _address, ADDRESS_SIZE);
_hdnode_public_ckd_address_optimized(_pubpoint, _chaincode, index, version, _address, ADDRESS_SIZE);
return Pointer_stringify(_address);
}

File diff suppressed because one or more lines are too long