mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-02 10:51:06 +00:00
update emscripten stuff
This commit is contained in:
parent
aa16b53bba
commit
36f099fe62
@ -6,18 +6,20 @@ EMFLAGS = \
|
|||||||
-s EXPORTED_FUNCTIONS='["_hdnode_public_ckd_address_optimized", "_ecdsa_read_pubkey"]'
|
-s EXPORTED_FUNCTIONS='["_hdnode_public_ckd_address_optimized", "_ecdsa_read_pubkey"]'
|
||||||
|
|
||||||
SRC = ../bignum.c ../ecdsa.c ../secp256k1.c ../hmac.c ../bip32.c \
|
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)
|
trezor-crypto.js: $(SRC)
|
||||||
emcc $(EMFLAGS) -o $@ $^
|
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
|
test-browserify.js: node_modules trezor-crypto.js test.js
|
||||||
$(shell npm bin)/browserify test.js -o $@ --noparse=`pwd`/trezor-crypto.js
|
$(shell npm bin)/browserify test.js -o $@ --noparse=`pwd`/trezor-crypto.js
|
||||||
@echo "open test.html in your favourite browser"
|
@echo "open test.html in your favourite browser"
|
||||||
|
|
||||||
|
test-node: node_modules trezor-crypto.js test.js
|
||||||
|
node test.js
|
||||||
|
|
||||||
node_modules:
|
node_modules:
|
||||||
npm install
|
npm install
|
||||||
npm install browserify
|
npm install browserify
|
||||||
|
@ -24,7 +24,7 @@ var CHAINCODE_SIZE = 32;
|
|||||||
var _chaincode = _malloc(CHAINCODE_SIZE);
|
var _chaincode = _malloc(CHAINCODE_SIZE);
|
||||||
|
|
||||||
// address string global
|
// address string global
|
||||||
var ADDRESS_SIZE = 40; // maximum size
|
var ADDRESS_SIZE = 60; // maximum size
|
||||||
var _address = _malloc(ADDRESS_SIZE);
|
var _address = _malloc(ADDRESS_SIZE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -52,7 +52,7 @@ function serializeNode(node) {
|
|||||||
* @return {String}
|
* @return {String}
|
||||||
*/
|
*/
|
||||||
function deriveAddress(index, version) {
|
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);
|
return Pointer_stringify(_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user