Skip to content

Commit

Permalink
Merge pull request #70 from Zondax/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
IdaTucker committed Nov 7, 2022
2 parents 8661e71 + 1d534b8 commit 5049c24
Show file tree
Hide file tree
Showing 187 changed files with 3,021 additions and 16,499 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ledger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Build with Clang Static Analyzer
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
name: SonarQube analyze
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder@sha256:877adc3ff619222aaf03a490d546ea9001f02faa0c6ac7c06c876c99584f9cdb
env:
SONAR_SCANNER_VERSION: 4.7.0.2747
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "deps/nanosplus-secure-sdk"]
path = deps/nanosplus-secure-sdk
url = https://github.com/LedgerHQ/nanosplus-secure-sdk
[submodule "deps/ledger-zxlib"]
path = deps/ledger-zxlib
url = https://github.com/Zondax/ledger-zxlib.git
11 changes: 4 additions & 7 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ all: bin/app.elf
@echo "APPNAME=\"${APPNAME}\"" >> $(OUTPUT_INSTALLER)
@echo "APPVERSION=\"${APPVERSION}\"" >> $(OUTPUT_INSTALLER)
@echo "APPPATH=\""${APPPATH}"\"" >> $(OUTPUT_INSTALLER)
@echo "LOAD_PARAMS=\"${COMMON_LOAD_PARAMS}\"" >> $(OUTPUT_INSTALLER)
@echo "DELETE_PARAMS=\"${COMMON_DELETE_PARAMS}\"" >> $(OUTPUT_INSTALLER)
@echo "LOAD_PARAMS=($$(echo "${APP_LOAD_PARAMS}" | sed -e "s|"${APPNAME}"|\""${APPNAME}"\"|"))" >> $(OUTPUT_INSTALLER)
@echo "DELETE_PARAMS=($$(echo "${COMMON_DELETE_PARAMS}" | sed -e "s|"${APPNAME}"|\""${APPNAME}"\"|"))" >> $(OUTPUT_INSTALLER)
@echo "APPHEX=\"" >> $(OUTPUT_INSTALLER)
@cat $(CURDIR)/bin/app.hex >> $(OUTPUT_INSTALLER)
@echo "\"" >> $(OUTPUT_INSTALLER)
Expand All @@ -40,8 +40,6 @@ all: bin/app.elf

include $(BOLOS_SDK)/Makefile.defines

DEFINES += APP_SECRET_MODE_ENABLED

$(info ************ TARGET_NAME = [$(TARGET_NAME)])

ifeq ($(APP_TESTING),1)
Expand Down Expand Up @@ -73,7 +71,7 @@ endef
$(error "$(error_message)")
endif

APP_LOAD_PARAMS = --delete $(COMMON_LOAD_PARAMS) --path ${APPPATH} --path "44'/1'"
APP_LOAD_PARAMS = $(COMMON_LOAD_PARAMS) --path $(APPPATH)

ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_LOAD_PARAMS += --appFlags 0x000
Expand All @@ -85,7 +83,6 @@ endif

ifeq ($(TARGET_NAME),TARGET_NANOX)
APP_LOAD_PARAMS += --appFlags 0x200
APP_STACK_SIZE:=4096
ICONNAME:=$(CURDIR)/nanox_icon.gif
OUTPUT_ELF ?= $(CURDIR)/output/app_x.elf
OUTPUT_INSTALLER:= $(CURDIR)/pkg/installer_x.sh
Expand Down Expand Up @@ -201,7 +198,7 @@ APP_SOURCE_PATH += $(MY_DIR)/../deps/ledger-zxlib/app/common
APP_SOURCE_PATH += $(MY_DIR)/../deps/tiny-aes/src

SDK_SOURCE_PATH += lib_stusb lib_stusb_impl
SDK_SOURCE_PATH += lib_ux
SDK_SOURCE_PATH += lib_ux

.PHONY: rust
rust:
Expand Down
5 changes: 4 additions & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This is the major version of this release
APPVERSION_M=3
# This is the minor version of this release
APPVERSION_N=1
APPVERSION_P=0
# This is the patch version of this release
APPVERSION_P=1
69 changes: 41 additions & 28 deletions app/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions app/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ name = "rslib"
crate-type = ["staticlib"]

[dependencies]
jubjub = { version = "0.5.1", default-features = false }
jubjub = { version = "0.9", default-features = false }
rand = { version = "0.7", default-features = false }
subtle = { version = "2.2", default-features = false }
subtle = { version = "2.4.1", default-features = false }
blake2b_simd = { version = "0.5", default-features = false }
blake2s_simd = { version = "0.5", default-features = false }
binary-ff1 = { version = "0.1.0", default-features = false }
Expand All @@ -23,8 +23,7 @@ hex = { version = "0.4.2", default-features = false }
cstr_core = { version = "0.2.0", default-features = false }
nom = { version = "5.1.1", default-features = false }
arrayvec = { version = "0.5.1", default-features = false }
group = { version = "0.8.0", default-features = false }
typenum = "1.12.0"
group = { version = "0.12", default-features = false }

[dependencies.chacha20poly1305]
version = "0.5.1"
Expand Down
5 changes: 5 additions & 0 deletions app/rust/include/rslib.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ void get_diversifier_list_withstartindex(const uint8_t *seed_ptr, const uint32_t

void get_default_diversifier_list_withstartindex(const uint8_t *seed_ptr, const uint32_t pos, uint8_t *startindex, uint8_t *diversifier_list);

void get_default_diversifier_without_start_index(const uint8_t *see_ptr, const uint32_t pos, uint8_t *default_diversifier);

void zip32_master(const uint8_t *seed_ptr, uint8_t *sk_ptr, uint8_t *dk_ptr);

void zip32_child_ask_nsk(const uint8_t *seed_ptr, uint8_t *ask, uint8_t *nsk, const uint32_t pos);
Expand All @@ -35,6 +37,8 @@ void zip32_ivk(const uint8_t *ak_ptr, uint8_t *ivk_ptr, const uint32_t pos);

void zip32_ovk(const uint8_t *seed_ptr, uint8_t *ovk, const uint32_t pos);

void zip32_fvk(const uint8_t *seed_ptr, uint8_t *fvk, const uint32_t pos);

void zip32_child_proof_key(const uint8_t *seed_ptr, uint8_t *ak_ptr, uint8_t *nsk_ptr, const uint32_t pos);

//Rseed
Expand Down Expand Up @@ -66,6 +70,7 @@ void random_fr(uint8_t *alpha_ptr);
void randomized_secret_from_seed(uint8_t *seed_ptr, uint32_t pos, uint8_t *alpha_ptr, uint8_t *output_ptr);

void get_rk(uint8_t *ask_ptr, uint8_t *alpha_ptr, uint8_t *output_ptr);
void rsk_to_rk(const uint8_t* rsk_ptr, uint8_t* rk_ptr);

void randomize_pk(uint8_t *alpha_ptr, uint8_t *pk_ptr);

Expand Down
1 change: 0 additions & 1 deletion app/rust/src/bolos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ pub fn sdk_jubjub_scalarmult_spending_base(point: &mut [u8], scalar: &[u8]) {
c_zemu_log_stack(b"scalarmult spending base in sdk\x00".as_ref());
unsafe {
c_jubjub_spending_base_scalarmult(point.as_mut_ptr(), scalar.as_ptr());
c_zemu_log_stack(b"after scalarmult spending base\x00".as_ref());
check_app_canary();
}
}
Expand Down

0 comments on commit 5049c24

Please sign in to comment.