Skip to content

Commit

Permalink
Update Makefile paths
Browse files Browse the repository at this point in the history
Also update Wasm output
  • Loading branch information
lrettig committed May 5, 2023
1 parent 8ac3d09 commit 45f1e8a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ build:
.PHONY: wasm
wasm:
cargo install wasm-pack
rm -rf ./lib/gen
wasm-pack build --target nodejs -d ./lib/gen --out-name bip32
rm -rf ./lib/*/.gitignore
rm -rf ./lib/*/package.json
rm -rf ./ed25519-bip32/lib/gen
cd ed25519-bip32 && wasm-pack build --target nodejs -d ./lib/gen --out-name bip32
rm -rf ./ed25519-bip32/lib/*/.gitignore
rm -rf ./ed25519-bip32/lib/*/package.json

.PHONY: cheader
cheader:
cargo install cbindgen
cbindgen -c cbindgen.toml -o $(HEADERFN)
cd ed25519-bip32 && cbindgen -c ../cbindgen.toml -o $(HEADERFN)

# Regenerate the C Header and complain if it's changed
.PHONY: diff
diff: cheader
@git diff --name-only --diff-filter=AM --exit-code $(HEADERFN) \
@cd ed25519-bip32 && git diff --name-only --diff-filter=AM --exit-code $(HEADERFN) \
|| { echo "C header has changed"; exit 1; }

.PHONY: clean
clean:
rm -rf ./lib/gen
rm -rf ./ed25519-bip32/lib/gen
rm -rf ./target
5 changes: 3 additions & 2 deletions ed25519-bip32/lib/gen/bip32.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* tslint:disable */
/* eslint-disable */
/**
* derive_key generates keypair from seed and bip32 hierarchical derivation path.
* it returns 64 bytes. first 32 bytes are secret key, and the second 32 bytes are public key.
* derive_key generates a keypair from a 64-byte BIP39-compatible seed and BIP32 hierarchical
* derivation path. it returns 64 bytes. the first 32 bytes are the secret key and the second 32
* bytes are the public key.
* @param {Uint8Array} seed
* @param {string} path
* @returns {Uint8Array}
Expand Down
5 changes: 3 additions & 2 deletions ed25519-bip32/lib/gen/bip32.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ function getArrayU8FromWasm0(ptr, len) {
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
}
/**
* derive_key generates keypair from seed and bip32 hierarchical derivation path.
* it returns 64 bytes. first 32 bytes are secret key, and the second 32 bytes are public key.
* derive_key generates a keypair from a 64-byte BIP39-compatible seed and BIP32 hierarchical
* derivation path. it returns 64 bytes. the first 32 bytes are the secret key and the second 32
* bytes are the public key.
* @param {Uint8Array} seed
* @param {string} path
* @returns {Uint8Array}
Expand Down
Binary file modified ed25519-bip32/lib/gen/bip32_bg.wasm
Binary file not shown.
3 changes: 2 additions & 1 deletion ed25519-bip32/lib/gen/bip32_bg.wasm.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function derive_key_c(a: number, b: number, c: number, d: number): number;
export function derive_c(a: number, b: number, c: number, d: number): number;
export function derive_free_c(a: number): void;
export function derive_key(a: number, b: number, c: number, d: number, e: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_malloc(a: number): number;
Expand Down

0 comments on commit 45f1e8a

Please sign in to comment.