diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..8601742c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,40 @@ +--- +name: Bug report +about: Create a report to help us improve +title: 'Fix [Subject of the issue]' +labels: 'bug' +assignees: '' + +--- + +## Description + +Describe your issue in as much detail as possible here. + +## Your environment + +* OS and version +* branch that causes this issue +* Device (Nano S, Nano X, Nano S+) + +## Steps to reproduce + +* Tell us how to reproduce this issue
+* Where the issue is, if you know
+* Which commands triggered the issue, if any + +## Expected behaviour + +Tell us what should happen + +## Actual behaviour + +Tell us what happens instead + +## Logs + +Please paste any logs here that demonstrate the issue, if they exist + +## Proposed solution + +If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..ab5534d66 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature report +about: Suggest an idea for this project +title: 'Add [Subject of the issue]' +labels: 'enhancement' +assignees: '' + +--- + +## Description + +Describe your issue in as much detail as possible here. + +## Your environment + +* OS and version +* branch that causes this issue +* Device (Nano S, Nano X, Nano S+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..9a66cf1e0 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,21 @@ +## Description + +Please provide a detailed description of what was done in this PR. +(And mention any links to an issue [docs](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)) + +## Changes include + +- [ ] Bugfix (non-breaking change that solves an issue) +- [ ] New feature (non-breaking change that adds functionality) +- [ ] Breaking change (change that is not backwards-compatible and/or changes current functionality) +- [ ] Tests +- [ ] Documentation +- [ ] Other (for changes that might not fit in any category) + +## Breaking changes + +Please complete this section if any breaking changes have been made, otherwise delete it. + +## Additional comments + +Please post additional comments in this section if you have them, otherwise delete it. diff --git a/.github/workflows/build_all_apps.yml b/.github/workflows/build_all_apps.yml new file mode 100644 index 000000000..6abddb7bb --- /dev/null +++ b/.github/workflows/build_all_apps.yml @@ -0,0 +1,115 @@ +name: Build all apps on latest SDK + +on: + workflow_dispatch: + inputs: + sdk_branch: + type: string + required: false + default: '' + pull_request: + +jobs: + prepare-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install tomlq + run: | + python -m pip install tomlq + + - name: Get C apps repos + run: | + page=1 + result=() + while true; do + repos=$(curl -s "https://api.github.com/orgs/LedgerHQ/repos?page=$page&per_page=200&type=public") + + if ! echo "$repos" | jq -e '.[].name' >/dev/null; then + # all repos have been listed + echo "all repos have been listed" + break + fi + + # add filtered repos to the list + for repo in $(echo "$repos" | jq -r '.[] | select((.name | startswith("app-")) and (.archived == false)) | .name'); do + default_branch=$(echo "$repos" | jq -r --arg repo "$repo" '.[] | select(.name == $repo) | .default_branch') + result+=("$repo,$default_branch") + done + + ((page++)) + done + + echo "repo_list=${result[@]}" >> $GITHUB_ENV + + - name: Extract metadata + id: set-matrix + run: | + repo_info="[" + for repo in ${{ env.repo_list }}; do + repo_name=$(echo "$repo" | cut -d ',' -f 1) + default_branch=$(echo "$repo" | cut -d ',' -f 2) + toml_content=$(curl -s "https://raw.githubusercontent.com/LedgerHQ/$repo_name/$default_branch/ledger_app.toml") + # check if the toml file is present in the repo and if the repo is not for a rust app + if [[ ! $toml_content =~ "404: Not Found" ]]; then + + # read toml file attributes + build_directory=$(echo "$toml_content" | tomlq -r '.app.build_directory') + sdk=$(echo "$toml_content" | tomlq -r '.app.sdk') + devices=$(echo "$toml_content" | tomlq -r '.app.devices | join(", ")') + + # select only C apps + if [[ $sdk == "C" ]]; then + repo_info+="{\"repo_name\": \"$repo_name\",\"default_branch\": \"$default_branch\", \"build_directory\": \"$build_directory\", \"sdk\": \"$sdk\", \"devices\": \"$devices\"}," + fi + else + echo "$repo does not contain ledger_app.toml" + fi + done + # remove the last "," in json + repo_info_json="${repo_info%,}" + repo_info_json+="]" + echo "matrix=$repo_info_json" >> $GITHUB_OUTPUT + + print-matrix: + needs: [prepare-matrix] + runs-on: ubuntu-latest + steps: + - name: Print matrix + run: | + echo "Matrix content: ${{ needs.prepare-matrix.outputs.matrix }}" + + test-build: + name: Build for all targets + needs: [prepare-matrix] + strategy: + fail-fast: false + matrix: + repo_info: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }} + runs-on: ubuntu-latest + container: + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + + steps: + - name: Clone App + uses: actions/checkout@v3 + with: + repository: LedgerHQ/${{ matrix.repo_info.repo_name }} + ref: ${{ matrix.repo_info.default_branch }} + submodules: true + + - name: Clone SDK + uses: actions/checkout@v3 + with: + path: sdk + ref: ${{ inputs.sdk_branch }} + + - name: Build NanoS + if: "startsWith(matrix.repo_info.devices, 'nanos,')" + run: | + [ -n '${{ matrix.repo_info.build_directory }}' ] && cd ${{ matrix.repo_info.build_directory }} + TARGET=nanos BOLOS_SDK=$GITHUB_WORKSPACE/sdk make diff --git a/.github/workflows/check_clang_static_analyzer.yml b/.github/workflows/check_clang_static_analyzer.yml new file mode 100644 index 000000000..27f9dc66c --- /dev/null +++ b/.github/workflows/check_clang_static_analyzer.yml @@ -0,0 +1,45 @@ +name: Run Clang Static Analyzer + +on: + workflow_dispatch: + push: + branches: + - master + pull_request: + +jobs: + scan_build: + name: Clang Static Analyzer for all devices + strategy: + fail-fast: false + matrix: + target: [nanos] + debug: [0, 1] + runs-on: ubuntu-latest + container: + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest + + steps: + - name: Clone Boilerplate + uses: actions/checkout@v3 + with: + repository: LedgerHQ/app-boilerplate + ref: master + + - name: Clone SDK + uses: actions/checkout@v3 + with: + path: sdk + + - name: Build with Clang Static Analyzer + run: | + TARGET=${{ matrix.target }} \ + BOLOS_SDK=sdk \ + make scan-build -j ENABLE_SDK_WERROR=1 DEBUG=${{ matrix.debug }} + + - name: Upload scan result + uses: actions/upload-artifact@v3 + if: failure() + with: + name: scan-build + path: scan-build diff --git a/.github/workflows/force-rebase.yml b/.github/workflows/force-rebase.yml new file mode 100644 index 000000000..9337156eb --- /dev/null +++ b/.github/workflows/force-rebase.yml @@ -0,0 +1,31 @@ +name: Force rebased + +on: [pull_request] + +jobs: + force-rebase: + runs-on: ubuntu-latest + steps: + + - name: 'PR commits + 1' + id: pr_commits + run: echo "pr_fetch_depth=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_OUTPUT}" + + - name: 'Checkout PR branch and all PR commits' + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ steps.pr_commits.outputs.pr_fetch_depth }} + + - name: Check if PR branch is rebased on target branch + shell: bash + run: | + git merge-base --is-ancestor ${{ github.event.pull_request.base.sha }} HEAD + + - name: Check if PR branch contains merge commits + shell: bash + run: | + merges=$(git log --oneline HEAD~${{ github.event.pull_request.commits }}...HEAD --merges ); \ + echo "--- Merges ---"; \ + echo ${merges}; \ + [[ -z "${merges}" ]] diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..a19076b13 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,13 @@ +name: pre-commit + +on: [push, pull_request] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0df81f7d..23b0ee09b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,8 +8,17 @@ exclude: | lib_stusb/.*| lib_nbgl/include/.*.json| lib_bagl/include/.*.json| + lib_cxng/src/.*.c| )$ repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/pre-commit/mirrors-clang-format rev: v16.0.6 hooks: diff --git a/Makefile.glyphs b/Makefile.glyphs index 62c393da5..224229518 100644 --- a/Makefile.glyphs +++ b/Makefile.glyphs @@ -40,4 +40,4 @@ $(GLYPH_DESTH): $(GLYPH_FILES) $(ICON_SCRIPT) $(L)if [ ! -z "$(GLYPH_FILES)" ] ; then python3 $(ICON_SCRIPT) --glyphcheader $(GLYPH_FILES) > $(GLYPH_DESTH) ; fi $(L)if [ ! -z "$(GLYPH_FILES)" ] ; then python3 $(ICON_SCRIPT) --glyphcfile $(GLYPH_FILES) > $(GLYPH_DESTC) ; fi #add dependency for generation -$(GLYPH_DESTC): $(GLYPH_DESTH) \ No newline at end of file +$(GLYPH_DESTC): $(GLYPH_DESTH) diff --git a/icon.py b/icon.py index 35614d994..de1da31c9 100644 --- a/icon.py +++ b/icon.py @@ -69,7 +69,7 @@ sys.stderr.write("Error: " + filename + " does not exists !\n") sys.exit(2) widthmax = int(sys.argv[1]) - heightmax = int(sys.argv[2]) + heightmax = int(sys.argv[2]) else: forcedBPP = int(sys.argv[2]) if (sys.argv[3] == "hexbitmaponly"): @@ -90,7 +90,7 @@ sys.stderr.write("Error: " + filename + " does not exists !\n") sys.exit(2) widthmax = int(sys.argv[1]) - heightmax = int(sys.argv[2]) + heightmax = int(sys.argv[2]) if (sys.argv[4] == "hexbitmaponly"): hexbitmaponly = True @@ -109,7 +109,7 @@ sys.stderr.write("Error: " + filename + " does not exists !\n") sys.exit(2) widthmax = int(sys.argv[1]) - heightmax = int(sys.argv[2]) + heightmax = int(sys.argv[2]) forcedBPP = int(sys.argv[4]) if (sys.argv[5] == "hexbitmaponly"): hexbitmaponly = True @@ -185,7 +185,7 @@ def hexbyte(b): i = 0 palette_remapping = {} new_palette = [] - for lum, values in opalette.items(): + for lum, values in opalette.items(): # old index to new index for v in values: palette_remapping[v[0]] = i @@ -221,7 +221,7 @@ def hexbyte(b): """) if glyphcheader: sys.stdout.write("""extern -""") +""") sys.stdout.write("""unsigned int const C_""" + bname + """_colors[] """); if glyphcheader: @@ -237,8 +237,8 @@ def hexbyte(b): sys.stdout.write("""}; """) if glyphcheader: - sys.stdout.write("""extern""") - sys.stdout.write(""" + sys.stdout.write("""extern""") + sys.stdout.write(""" unsigned char const C_""" + bname + """_bitmap[]"""); if glyphcheader: sys.stdout.write("""; @@ -291,7 +291,7 @@ def hexbyte(b): sys.stdout.write(hexbyte(current_byte)) current_bit = 0 current_byte = 0 - + # print last byte if any if (current_bit > 0): if not hexbitmaponly: @@ -317,13 +317,13 @@ def hexbyte(b): else: sys.stdout.write("""#ifdef OS_IO_SEPROXYHAL #include \"os_io_seproxyhal.h\" -""") +""") if glyphcheader: sys.stdout.write("""extern -""") +""") sys.stdout.write("""const bagl_icon_details_t C_""" + bname) - if glyphcheader: + if glyphcheader: sys.stdout.write("""; """) sys.stdout.write("""#endif // GLYPH_""" + bname + """_BPP diff --git a/include/cx_errors.h b/include/cx_errors.h index 92be6fb4c..2326c29fd 100644 --- a/include/cx_errors.h +++ b/include/cx_errors.h @@ -42,7 +42,6 @@ LEDGER_ASSERT(!_assert_err, "err 0x%X <%s>", _assert_err, #call); \ } while (0) - /** Success. */ #define CX_OK 0x00000000 diff --git a/include/os_helpers.h b/include/os_helpers.h index c0bdcc004..f4f92fd90 100644 --- a/include/os_helpers.h +++ b/include/os_helpers.h @@ -17,4 +17,4 @@ unsigned int os_parse_bertlv(unsigned char *mem, #ifndef UNUSED #define UNUSED(x) (void) x -#endif \ No newline at end of file +#endif diff --git a/lib_bagl/src/bagl_font_comic_sans_ms_20px.inc b/lib_bagl/src/bagl_font_comic_sans_ms_20px.inc index b755ae7f5..26c8836db 100644 --- a/lib_bagl/src/bagl_font_comic_sans_ms_20px.inc +++ b/lib_bagl/src/bagl_font_comic_sans_ms_20px.inc @@ -886,6 +886,6 @@ const bagl_font_t fontCOMIC_SANS_MS_20PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersCOMIC_SANS_MS_20PX + charactersCOMIC_SANS_MS_20PX ,bitmapCOMIC_SANS_MS_20PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_bold_13px.inc b/lib_bagl/src/bagl_font_open_sans_bold_13px.inc index 7b8fface4..559dddaf5 100644 --- a/lib_bagl/src/bagl_font_open_sans_bold_13px.inc +++ b/lib_bagl/src/bagl_font_open_sans_bold_13px.inc @@ -706,6 +706,6 @@ const bagl_font_t fontOPEN_SANS_BOLD_13PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_BOLD_13PX + charactersOPEN_SANS_BOLD_13PX ,bitmapOPEN_SANS_BOLD_13PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_bold_21px.inc b/lib_bagl/src/bagl_font_open_sans_bold_21px.inc index 44baac1d6..ff24f5406 100644 --- a/lib_bagl/src/bagl_font_open_sans_bold_21px.inc +++ b/lib_bagl/src/bagl_font_open_sans_bold_21px.inc @@ -876,6 +876,6 @@ const bagl_font_t fontOPEN_SANS_BOLD_21PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_BOLD_21PX + charactersOPEN_SANS_BOLD_21PX ,bitmapOPEN_SANS_BOLD_21PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_extrabold_11px.inc b/lib_bagl/src/bagl_font_open_sans_extrabold_11px.inc index 4b4b774a1..597b1ecd0 100644 --- a/lib_bagl/src/bagl_font_open_sans_extrabold_11px.inc +++ b/lib_bagl/src/bagl_font_open_sans_extrabold_11px.inc @@ -679,6 +679,6 @@ const bagl_font_t fontOPEN_SANS_EXTRABOLD_11PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_EXTRABOLD_11PX + charactersOPEN_SANS_EXTRABOLD_11PX ,bitmapOPEN_SANS_EXTRABOLD_11PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_13.inc b/lib_bagl/src/bagl_font_open_sans_light_13.inc index c05108657..7e42c288e 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_13.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_13.inc @@ -1117,6 +1117,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_13 = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_13 + charactersOPEN_SANS_LIGHT_13 ,bitmapOPEN_SANS_LIGHT_13 }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_13px.inc b/lib_bagl/src/bagl_font_open_sans_light_13px.inc index a86f38b30..a5f1a9bee 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_13px.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_13px.inc @@ -1056,6 +1056,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_13PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_13PX + charactersOPEN_SANS_LIGHT_13PX ,bitmapOPEN_SANS_LIGHT_13PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_14px.inc b/lib_bagl/src/bagl_font_open_sans_light_14px.inc index 2a035f2f2..d16674e57 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_14px.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_14px.inc @@ -743,6 +743,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_14PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_14PX + charactersOPEN_SANS_LIGHT_14PX ,bitmapOPEN_SANS_LIGHT_14PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_16_22px.inc b/lib_bagl/src/bagl_font_open_sans_light_16_22px.inc index ae4eaf053..af150f80b 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_16_22px.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_16_22px.inc @@ -1984,6 +1984,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_16_22PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_16_22PX + charactersOPEN_SANS_LIGHT_16_22PX ,bitmapOPEN_SANS_LIGHT_16_22PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_16px.inc b/lib_bagl/src/bagl_font_open_sans_light_16px.inc index 90003ebe8..7ed73f489 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_16px.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_16px.inc @@ -778,6 +778,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_16PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_16PX + charactersOPEN_SANS_LIGHT_16PX ,bitmapOPEN_SANS_LIGHT_16PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_21px.inc b/lib_bagl/src/bagl_font_open_sans_light_21px.inc index 3cd8c3832..a46c209bf 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_21px.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_21px.inc @@ -878,6 +878,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_21PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_21PX + charactersOPEN_SANS_LIGHT_21PX ,bitmapOPEN_SANS_LIGHT_21PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_light_23_30px.inc b/lib_bagl/src/bagl_font_open_sans_light_23_30px.inc index 33604bdd9..98644ccd2 100644 --- a/lib_bagl/src/bagl_font_open_sans_light_23_30px.inc +++ b/lib_bagl/src/bagl_font_open_sans_light_23_30px.inc @@ -3260,6 +3260,6 @@ const bagl_font_t fontOPEN_SANS_LIGHT_23_30PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_LIGHT_23_30PX + charactersOPEN_SANS_LIGHT_23_30PX ,bitmapOPEN_SANS_LIGHT_23_30PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_regular_10_13px.inc b/lib_bagl/src/bagl_font_open_sans_regular_10_13px.inc index 14eb77820..fc08344c8 100644 --- a/lib_bagl/src/bagl_font_open_sans_regular_10_13px.inc +++ b/lib_bagl/src/bagl_font_open_sans_regular_10_13px.inc @@ -1135,6 +1135,6 @@ const bagl_font_t fontOPEN_SANS_REGULAR_10_13PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_REGULAR_10_13PX + charactersOPEN_SANS_REGULAR_10_13PX ,bitmapOPEN_SANS_REGULAR_10_13PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_regular_11_14px.inc b/lib_bagl/src/bagl_font_open_sans_regular_11_14px.inc index e23846473..0a42f1099 100644 --- a/lib_bagl/src/bagl_font_open_sans_regular_11_14px.inc +++ b/lib_bagl/src/bagl_font_open_sans_regular_11_14px.inc @@ -1286,6 +1286,6 @@ const bagl_font_t fontOPEN_SANS_REGULAR_11_14PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_REGULAR_11_14PX + charactersOPEN_SANS_REGULAR_11_14PX ,bitmapOPEN_SANS_REGULAR_11_14PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_regular_11px.inc b/lib_bagl/src/bagl_font_open_sans_regular_11px.inc index ad0cc715b..ba2f044e6 100644 --- a/lib_bagl/src/bagl_font_open_sans_regular_11px.inc +++ b/lib_bagl/src/bagl_font_open_sans_regular_11px.inc @@ -672,6 +672,6 @@ const bagl_font_t fontOPEN_SANS_REGULAR_11PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_REGULAR_11PX + charactersOPEN_SANS_REGULAR_11PX ,bitmapOPEN_SANS_REGULAR_11PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_regular_13_18px.inc b/lib_bagl/src/bagl_font_open_sans_regular_13_18px.inc index 9e7fcf30c..f3da58739 100644 --- a/lib_bagl/src/bagl_font_open_sans_regular_13_18px.inc +++ b/lib_bagl/src/bagl_font_open_sans_regular_13_18px.inc @@ -212,6 +212,6 @@ const bagl_font_t fontOPEN_SANS_REGULAR_13_18PX = { 0, /* kerning */ 0x002E, /* first character */ 0x0039, /* last character */ - charactersOPEN_SANS_REGULAR_13_18PX + charactersOPEN_SANS_REGULAR_13_18PX ,bitmapOPEN_SANS_REGULAR_13_18PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_regular_22_30px.inc b/lib_bagl/src/bagl_font_open_sans_regular_22_30px.inc index 3f3859524..fc1d5dba8 100644 --- a/lib_bagl/src/bagl_font_open_sans_regular_22_30px.inc +++ b/lib_bagl/src/bagl_font_open_sans_regular_22_30px.inc @@ -421,6 +421,6 @@ const bagl_font_t fontOPEN_SANS_REGULAR_22_30PX = { 0, /* kerning */ 0x002E, /* first character */ 0x0039, /* last character */ - charactersOPEN_SANS_REGULAR_22_30PX + charactersOPEN_SANS_REGULAR_22_30PX ,bitmapOPEN_SANS_REGULAR_22_30PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_regular_8_11px.inc b/lib_bagl/src/bagl_font_open_sans_regular_8_11px.inc index a37354c45..c0c303827 100644 --- a/lib_bagl/src/bagl_font_open_sans_regular_8_11px.inc +++ b/lib_bagl/src/bagl_font_open_sans_regular_8_11px.inc @@ -957,6 +957,6 @@ const bagl_font_t fontOPEN_SANS_REGULAR_8_11PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_REGULAR_8_11PX + charactersOPEN_SANS_REGULAR_8_11PX ,bitmapOPEN_SANS_REGULAR_8_11PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_semibold_10_13px.inc b/lib_bagl/src/bagl_font_open_sans_semibold_10_13px.inc index fa33843b4..99131a85d 100644 --- a/lib_bagl/src/bagl_font_open_sans_semibold_10_13px.inc +++ b/lib_bagl/src/bagl_font_open_sans_semibold_10_13px.inc @@ -1149,6 +1149,6 @@ const bagl_font_t fontOPEN_SANS_SEMIBOLD_10_13PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_SEMIBOLD_10_13PX + charactersOPEN_SANS_SEMIBOLD_10_13PX ,bitmapOPEN_SANS_SEMIBOLD_10_13PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_semibold_11_16px.inc b/lib_bagl/src/bagl_font_open_sans_semibold_11_16px.inc index dcefa4995..e149480c5 100644 --- a/lib_bagl/src/bagl_font_open_sans_semibold_11_16px.inc +++ b/lib_bagl/src/bagl_font_open_sans_semibold_11_16px.inc @@ -1304,6 +1304,6 @@ const bagl_font_t fontOPEN_SANS_SEMIBOLD_11_16PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_SEMIBOLD_11_16PX + charactersOPEN_SANS_SEMIBOLD_11_16PX ,bitmapOPEN_SANS_SEMIBOLD_11_16PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_semibold_13_18px.inc b/lib_bagl/src/bagl_font_open_sans_semibold_13_18px.inc index aa48612f4..6c7308227 100644 --- a/lib_bagl/src/bagl_font_open_sans_semibold_13_18px.inc +++ b/lib_bagl/src/bagl_font_open_sans_semibold_13_18px.inc @@ -212,6 +212,6 @@ const bagl_font_t fontOPEN_SANS_SEMIBOLD_13_18PX = { 0, /* kerning */ 0x002E, /* first character */ 0x0039, /* last character */ - charactersOPEN_SANS_SEMIBOLD_13_18PX + charactersOPEN_SANS_SEMIBOLD_13_18PX ,bitmapOPEN_SANS_SEMIBOLD_13_18PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_semibold_13px.inc b/lib_bagl/src/bagl_font_open_sans_semibold_13px.inc index 2ec85c97c..c15327343 100644 --- a/lib_bagl/src/bagl_font_open_sans_semibold_13px.inc +++ b/lib_bagl/src/bagl_font_open_sans_semibold_13px.inc @@ -1149,6 +1149,6 @@ const bagl_font_t fontOPEN_SANS_SEMIBOLD_13PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_SEMIBOLD_13PX + charactersOPEN_SANS_SEMIBOLD_13PX ,bitmapOPEN_SANS_SEMIBOLD_13PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_semibold_18px.inc b/lib_bagl/src/bagl_font_open_sans_semibold_18px.inc index 0f59d29b1..3c695ac67 100644 --- a/lib_bagl/src/bagl_font_open_sans_semibold_18px.inc +++ b/lib_bagl/src/bagl_font_open_sans_semibold_18px.inc @@ -807,6 +807,6 @@ const bagl_font_t fontOPEN_SANS_SEMIBOLD_18PX = { 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_SEMIBOLD_18PX + charactersOPEN_SANS_SEMIBOLD_18PX ,bitmapOPEN_SANS_SEMIBOLD_18PX }; diff --git a/lib_bagl/src/bagl_font_open_sans_semibold_8_11px.inc b/lib_bagl/src/bagl_font_open_sans_semibold_8_11px.inc index a75715fef..d136a99ba 100644 --- a/lib_bagl/src/bagl_font_open_sans_semibold_8_11px.inc +++ b/lib_bagl/src/bagl_font_open_sans_semibold_8_11px.inc @@ -955,13 +955,13 @@ const bagl_font_character_t charactersOPEN_SANS_SEMIBOLD_8_11PX[96] = { }; const bagl_font_t fontOPEN_SANS_SEMIBOLD_8_11PX = { - BAGL_FONT_OPEN_SANS_SEMIBOLD_8_11PX, /* font id (sparse font array) */ + BAGL_FONT_OPEN_SANS_SEMIBOLD_8_11PX, /* font id (sparse font array) */ 4, /* font bit per pixels */ 11, /* font height in pixels */ 8 , /* font ascent (baseline) in pixels */ 0, /* kerning */ 0x0020, /* first character */ 0x007F, /* last character */ - charactersOPEN_SANS_SEMIBOLD_8_11PX + charactersOPEN_SANS_SEMIBOLD_8_11PX ,bitmapOPEN_SANS_SEMIBOLD_8_11PX }; diff --git a/lib_bagl/src/bagl_font_rom.inc b/lib_bagl/src/bagl_font_rom.inc index 431f99389..58df2af9b 100644 --- a/lib_bagl/src/bagl_font_rom.inc +++ b/lib_bagl/src/bagl_font_rom.inc @@ -45,4 +45,3 @@ #include "bagl_font_open_sans_semibold_13_18px.inc" #include "bagl_font_symbols.inc" - diff --git a/lib_bagl/src/bagl_font_symbols.inc b/lib_bagl/src/bagl_font_symbols.inc index e8636fa15..cb3c34f10 100644 --- a/lib_bagl/src/bagl_font_symbols.inc +++ b/lib_bagl/src/bagl_font_symbols.inc @@ -17,68 +17,68 @@ ********************************************************************************/ const unsigned char bitmapSYMBOLS_0[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x51, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4c, - 0x00, 0x10, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, - 0x00, 0x71, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0xf6, 0xff, 0xff, 0x8d, 0xff, 0xbf, 0xfa, 0xff, 0xff, - 0x50, 0xff, 0xff, 0xff, 0x14, 0xf7, 0x2b, 0xe2, 0xff, 0xff, - 0xf5, 0xff, 0xff, 0xff, 0x3c, 0x51, 0x12, 0xf9, 0xff, 0xff, - 0xfe, 0xff, 0xff, 0xff, 0xcf, 0x03, 0x91, 0xff, 0xff, 0xff, - 0xfe, 0xff, 0xff, 0xff, 0xcf, 0x03, 0x91, 0xff, 0xff, 0xff, - 0xf5, 0xff, 0xff, 0xff, 0x3c, 0x51, 0x12, 0xf9, 0xff, 0xff, - 0x50, 0xff, 0xff, 0xff, 0x14, 0xf7, 0x2b, 0xe2, 0xff, 0xff, - 0x00, 0xf6, 0xff, 0xff, 0x8d, 0xff, 0xbf, 0xfa, 0xff, 0xff, - 0x00, 0x71, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x10, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x51, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4c, + 0x00, 0x10, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, + 0x00, 0x71, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0xf6, 0xff, 0xff, 0x8d, 0xff, 0xbf, 0xfa, 0xff, 0xff, + 0x50, 0xff, 0xff, 0xff, 0x14, 0xf7, 0x2b, 0xe2, 0xff, 0xff, + 0xf5, 0xff, 0xff, 0xff, 0x3c, 0x51, 0x12, 0xf9, 0xff, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xcf, 0x03, 0x91, 0xff, 0xff, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xcf, 0x03, 0x91, 0xff, 0xff, 0xff, + 0xf5, 0xff, 0xff, 0xff, 0x3c, 0x51, 0x12, 0xf9, 0xff, 0xff, + 0x50, 0xff, 0xff, 0xff, 0x14, 0xf7, 0x2b, 0xe2, 0xff, 0xff, + 0x00, 0xf6, 0xff, 0xff, 0x8d, 0xff, 0xbf, 0xfa, 0xff, 0xff, + 0x00, 0x71, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x10, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0x00, 0x00, 0x51, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x84, 0xcc, 0x48, 0x00, 0x40, 0xcc, 0xcc, 0xcc, 0x04, - 0xc4, 0xcc, 0xcc, 0xcc, 0x4c, 0xc8, 0xcc, 0xcc, 0xcc, 0x8c, - 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, - 0xc8, 0xcc, 0xcc, 0xcc, 0x8c, 0xc4, 0xcc, 0xcc, 0xcc, 0x4c, - 0x40, 0xcc, 0xcc, 0xcc, 0x04, 0x00, 0x84, 0xcc, 0x48, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x84, 0xcc, 0x48, 0x00, 0x40, 0xcc, 0xcc, 0xcc, 0x04, + 0xc4, 0xcc, 0xcc, 0xcc, 0x4c, 0xc8, 0xcc, 0xcc, 0xcc, 0x8c, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xc8, 0xcc, 0xcc, 0xcc, 0x8c, 0xc4, 0xcc, 0xcc, 0xcc, 0x4c, + 0x40, 0xcc, 0xcc, 0xcc, 0x04, 0x00, 0x84, 0xcc, 0x48, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x70, 0x4e, 0x00, + 0x00, 0x70, 0xff, 0x0a, 0x00, 0x70, 0xff, 0x1d, 0x00, 0x70, + 0xff, 0x1d, 0x00, 0x70, 0xff, 0x1d, 0x00, 0x70, 0xff, 0x1d, + 0x00, 0x60, 0xff, 0x1d, 0x00, 0x00, 0xfb, 0x9f, 0x00, 0x00, + 0x10, 0xfc, 0x8f, 0x00, 0x00, 0x10, 0xfc, 0x8f, 0x00, 0x00, + 0x10, 0xfc, 0x8f, 0x00, 0x00, 0x10, 0xfc, 0x8f, 0x00, 0x00, + 0x10, 0xfc, 0x6f, 0x00, 0x00, 0x10, 0xec, 0x05, 0x00, 0x00, + 0x10, 0x03, - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x70, 0x4e, 0x00, - 0x00, 0x70, 0xff, 0x0a, 0x00, 0x70, 0xff, 0x1d, 0x00, 0x70, - 0xff, 0x1d, 0x00, 0x70, 0xff, 0x1d, 0x00, 0x70, 0xff, 0x1d, - 0x00, 0x60, 0xff, 0x1d, 0x00, 0x00, 0xfb, 0x9f, 0x00, 0x00, - 0x10, 0xfc, 0x8f, 0x00, 0x00, 0x10, 0xfc, 0x8f, 0x00, 0x00, - 0x10, 0xfc, 0x8f, 0x00, 0x00, 0x10, 0xfc, 0x8f, 0x00, 0x00, - 0x10, 0xfc, 0x6f, 0x00, 0x00, 0x10, 0xec, 0x05, 0x00, 0x00, - 0x10, 0x03, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0xb3, 0x00, - 0x00, 0xe2, 0x07, 0x00, 0xd2, 0x5f, 0x00, 0xc1, 0xff, 0xbd, - 0x66, 0x98, 0xff, 0x19, 0x00, 0xf5, 0x1a, 0x00, 0x80, 0x1c, - 0x00, 0x00, 0x2b, 0x00, 0x00, 0x33, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0xb3, 0x00, + 0x00, 0xe2, 0x07, 0x00, 0xd2, 0x5f, 0x00, 0xc1, 0xff, 0xbd, + 0x66, 0x98, 0xff, 0x19, 0x00, 0xf5, 0x1a, 0x00, 0x80, 0x1c, + 0x00, 0x00, 0x2b, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe6, 0x07, 0x00, 0x90, 0x7f, 0x00, - 0x00, 0xf8, 0x07, 0x00, 0xa0, 0x5f, 0x00, 0xc1, 0x2d, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe6, 0x07, 0x00, 0x90, 0x7f, 0x00, + 0x00, 0xf8, 0x07, 0x00, 0xa0, 0x5f, 0x00, 0xc1, 0x2d, 0x10, 0xdc, 0x03, 0xc1, 0x3d, 0x00, 0xb4, 0x03, 0x00, - 0x00, 0x85, - 0xcb, 0xff, 0xff, 0xbc, 0x58, 0x00, 0x70, 0xfe, 0xff, 0xff, - 0xff, 0xff, 0xef, 0x07, 0xe5, 0x9f, 0x46, 0x01, 0x10, 0x64, - 0xf9, 0x5e, 0xf8, 0x29, 0x00, 0x00, 0x00, 0x00, 0x92, 0x8f, - 0xfa, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0xbf, 0xfd, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x40, 0xdf, 0xff, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x10, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0xff, 0xfd, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x40, 0xdf, 0xfa, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x60, 0xbf, 0xf8, 0x29, 0x00, 0x00, 0x00, 0x00, - 0x92, 0x8f, 0xe5, 0x9f, 0x36, 0x01, 0x10, 0x63, 0xf9, 0x5e, - 0x70, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xef, 0x07, 0x00, 0x85, - 0xdb, 0xff, 0xff, 0xbd, 0x58, 0x00, + 0x00, 0x85, + 0xcb, 0xff, 0xff, 0xbc, 0x58, 0x00, 0x70, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0xef, 0x07, 0xe5, 0x9f, 0x46, 0x01, 0x10, 0x64, + 0xf9, 0x5e, 0xf8, 0x29, 0x00, 0x00, 0x00, 0x00, 0x92, 0x8f, + 0xfa, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0xbf, 0xfd, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x40, 0xdf, 0xff, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x10, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0xff, 0xfd, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x40, 0xdf, 0xfa, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x60, 0xbf, 0xf8, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x92, 0x8f, 0xe5, 0x9f, 0x36, 0x01, 0x10, 0x63, 0xf9, 0x5e, + 0x70, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xef, 0x07, 0x00, 0x85, + 0xdb, 0xff, 0xff, 0xbd, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -137,6 +137,6 @@ const bagl_font_t fontSYMBOLS_1 = { 0, /* kerning */ 0x0000, /* first character */ 0x0001, /* last character */ - charactersSYMBOLS_1, + charactersSYMBOLS_1, bitmapSYMBOLS_1 }; diff --git a/lib_cxng/README.md b/lib_cxng/README.md index 2f22897aa..4862a9823 100644 --- a/lib_cxng/README.md +++ b/lib_cxng/README.md @@ -1,6 +1,3 @@ #CX NG Crypto as Lib - - - diff --git a/lib_cxng/include/lcx_common.h b/lib_cxng/include/lcx_common.h index 5fa3201ab..9a74898df 100644 --- a/lib_cxng/include/lcx_common.h +++ b/lib_cxng/include/lcx_common.h @@ -73,7 +73,7 @@ typedef struct { * @brief Cryptography flags * @details Some functions take **logical or** of various flags. * The following flags are globally defined: - * + * * | Bits position | Values | Flags | Meaning | Algorithms | * |----------------|-------------------|-------------------------------|--------------------------------------------|-----------------------| * | 15 | 1000000000000000 | CX_NO_REINIT | Do not reinitialize the context on CX_LAST | | diff --git a/lib_cxng/src/cx_rng_rfc6979.h b/lib_cxng/src/cx_rng_rfc6979.h index 5d934532d..4aec0a1cb 100644 --- a/lib_cxng/src/cx_rng_rfc6979.h +++ b/lib_cxng/src/cx_rng_rfc6979.h @@ -41,17 +41,20 @@ typedef struct { cx_hmac_t hmac; } cx_rnd_rfc6979_ctx_t; -WARN_UNUSED_RESULT cx_err_t cx_rng_rfc6979_init(cx_rnd_rfc6979_ctx_t *rfc_ctx, - cx_md_t hash_id, - const uint8_t *x, - size_t x_len, - const uint8_t *h1, - size_t h1_len, - const uint8_t *q, - size_t q_len - /*const uint8_t *additional_input, size_t additional_input_len*/); - -WARN_UNUSED_RESULT cx_err_t cx_rng_rfc6979_next(cx_rnd_rfc6979_ctx_t *rfc_ctx, uint8_t *out, size_t out_len); +WARN_UNUSED_RESULT cx_err_t cx_rng_rfc6979_init( + cx_rnd_rfc6979_ctx_t *rfc_ctx, + cx_md_t hash_id, + const uint8_t *x, + size_t x_len, + const uint8_t *h1, + size_t h1_len, + const uint8_t *q, + size_t q_len + /*const uint8_t *additional_input, size_t additional_input_len*/); + +WARN_UNUSED_RESULT cx_err_t cx_rng_rfc6979_next(cx_rnd_rfc6979_ctx_t *rfc_ctx, + uint8_t *out, + size_t out_len); #endif // HAVE_RNG_RFC6979 diff --git a/lib_cxng/src/cx_sha512_alt_m0.s b/lib_cxng/src/cx_sha512_alt_m0.s index 77cfc5a7c..23db69404 100644 --- a/lib_cxng/src/cx_sha512_alt_m0.s +++ b/lib_cxng/src/cx_sha512_alt_m0.s @@ -1,25 +1,25 @@ @ vim:ft=armv6 #if defined(HAVE_SHA512) || defined(HAVE_SHA384) - + #ifdef HAVE_SHA512_WITH_BLOCK_ALT_METHOD_M0 .syntax unified .thumb .text - + @ Convention ri,ri+1 are 64bits, with ri is LSB: 64bits full little-endian @ TODO use new rotr64 macro instead of function @ ============================================================ @ WARN: big MSB,LSB MSB,LSB _primeSqrt: -.word 0x428a2f98,0xd728ae22, 0x71374491,0x23ef65cd -.word 0xb5c0fbcf,0xec4d3b2f, 0xe9b5dba5,0x8189dbbc +.word 0x428a2f98,0xd728ae22, 0x71374491,0x23ef65cd +.word 0xb5c0fbcf,0xec4d3b2f, 0xe9b5dba5,0x8189dbbc .word 0x3956c25b,0xf348b538, 0x59f111f1,0xb605d019 -.word 0x923f82a4,0xaf194f9b, 0xab1c5ed5,0xda6d8118 -.word 0xd807aa98,0xa3030242, 0x12835b01,0x45706fbe +.word 0x923f82a4,0xaf194f9b, 0xab1c5ed5,0xda6d8118 +.word 0xd807aa98,0xa3030242, 0x12835b01,0x45706fbe .word 0x243185be,0x4ee4b28c, 0x550c7dc3,0xd5ffb4e2 .word 0x72be5d74,0xf27b896f, 0x80deb1fe,0x3b1696b1 .word 0x9bdc06a7,0x25c71235, 0xc19bf174,0xcf692694 @@ -29,7 +29,7 @@ _primeSqrt: .word 0x5cb0a9dc,0xbd41fbd4, 0x76f988da,0x831153b5 .word 0x983e5152,0xee66dfab, 0xa831c66d,0x2db43210 .word 0xb00327c8,0x98fb213f, 0xbf597fc7,0xbeef0ee4 -.word 0xc6e00bf3,0x3da88fc2, 0xd5a79147,0x930aa725 +.word 0xc6e00bf3,0x3da88fc2, 0xd5a79147,0x930aa725 .word 0x06ca6351,0xe003826f, 0x14292967,0x0a0e6e70 .word 0x27b70a85,0x46d22ffc, 0x2e1b2138,0x5c26c926 .word 0x4d2c6dfc,0x5ac42aed, 0x53380d13,0x9d95b3df @@ -39,7 +39,7 @@ _primeSqrt: .word 0xc24b8b70,0xd0f89791, 0xc76c51a3,0x0654be30 .word 0xd192e819,0xd6ef5218, 0xd6990624,0x5565a910 .word 0xf40e3585,0x5771202a, 0x106aa070,0x32bbd1b8 -.word 0x19a4c116,0xb8d2d0c8, 0x1e376c08,0x5141ab53 +.word 0x19a4c116,0xb8d2d0c8, 0x1e376c08,0x5141ab53 .word 0x2748774c,0xdf8eeb99, 0x34b0bcb5,0xe19b48a8 .word 0x391c0cb3,0xc5c95a63, 0x4ed8aa4a,0xe3418acb .word 0x5b9cca4f,0x7763e373, 0x682e6ff3,0xd6b2b8a3 @@ -49,8 +49,8 @@ _primeSqrt: .word 0xbef9a3f7,0xb2c67915, 0xc67178f2,0xe372532b .word 0xca273ece,0xea26619c, 0xd186b8c7,0x21c0c207 .word 0xeada7dd6,0xcde0eb1e, 0xf57d4f7f,0xee6ed178 -.word 0x06f067aa,0x72176fba, 0x0a637dc5,0xa2c898a6 -.word 0x113f9804,0xbef90dae, 0x1b710b35,0x131c471b +.word 0x06f067aa,0x72176fba, 0x0a637dc5,0xa2c898a6 +.word 0x113f9804,0xbef90dae, 0x1b710b35,0x131c471b .word 0x28db77f5,0x23047d84, 0x32caab7b,0x40c72493 .word 0x3c9ebe0a,0x15c9bebc, 0x431d67c4,0x9c100d4c .word 0x4cc5d4be,0xcb3e42b6, 0x597f299c,0xfc657e2a @@ -77,7 +77,7 @@ _primeSqrt: @ locals stack .equ _H , 0 .equ _G , 8 -.equ _F , 16 +.equ _F , 16 .equ _E , 24 .equ _D , 32 .equ _C , 40 @@ -87,7 +87,7 @@ _primeSqrt: .equ _cx_sha512_block_locals, 68 - + ;@ rh,rl = A|B|...|H .macro peekAH rl,rh, _AH LDR \rl, [SP,\_AH] @@ -98,7 +98,7 @@ _primeSqrt: @ convert loop j to index j; j%16 @ then convert index to offset: j*8 @ do that in place -.macro offsetJ rj +.macro offsetJ rj LSLS \rj, #32-4 LSRS \rj, #32-7 .endm @@ -142,7 +142,7 @@ _primeSqrt: @ r0-r5: compute 64bits @ r8-r12: 64bits tmp backup @ r10-11: 64bits tmp backup -@ +@ cx_sha512_block: PUSH {r4,r5,r6,r7,lr} MOV r4, r8 @@ -152,7 +152,7 @@ cx_sha512_block: PUSH {r4, r5, r6, r7} SUB SP, #_cx_sha512_block_locals @set locals - STR r0, [SP, #_hash] + STR r0, [SP, #_hash] @ _AH:loopACC ADDS r0, #OFSacc MOV r1, SP @@ -176,9 +176,9 @@ cx_sha512_block: SUBS r1, #16 STM r1!, {r4-r5} @ X: block - LDR r7, [SP, #_hash] + LDR r7, [SP, #_hash] ADDS r7, #OFSblock - + @swap 8 64bits words of block MOV r0, r7 @@ -192,7 +192,7 @@ cx_sha512_block: REV r4, r7 STM r1!, {r2-r5} .endr - + @80 loop MOV r7, r8 MOVS r6, #0 @@ -200,8 +200,8 @@ cx_sha512_block: CMP r6, #80 BNE _cont_loop_80 B _end_loop_80 - - _cont_loop_80: @TODO use CMP + + _cont_loop_80: @TODO use CMP @ loop >= 16 CMP r6, #16 BCS _cont_16 @@ -209,7 +209,7 @@ cx_sha512_block: _cont_16: @ X[j-2] SUBS r0, r6, #2 - offsetJ r0 + offsetJ r0 ADDS r0, r7 LDM r0, {r0, r1} PUSH {r0,r1} @@ -221,7 +221,7 @@ cx_sha512_block: EORS r4, r4, r2 EORS r5, r5, r3 POP {r0,r1} - MOV r2, r1 + MOV r2, r1 LSRS r0, #6 LSRS r1, #6 LSLS r2, #32-6 @@ -239,14 +239,14 @@ cx_sha512_block: LDM r0, {r0, r1} PUSH {r0,r1} @ + sigma0 X[j-15]: r1,r8,s7 - _mcx_rotr64_32 1,r4,r5 + _mcx_rotr64_32 1,r4,r5 MOV r0, r4 MOV r1, r5 _mcx_rotr64_32 7,r2,r3 EORS r4, r4, r2 EORS r5, r5, r3 POP {r0,r1} - MOV r2, r1 + MOV r2, r1 LSRS r0, #7 LSRS r1, #7 LSLS r2, #32-7 @@ -256,7 +256,7 @@ cx_sha512_block: MOV r0, r10 MOV r1, r11 add_doubleword r0,r1,r4,r5 - + @ + X[j-7 %F] SUBS r0, r6, #7 offsetJ r0 @@ -266,19 +266,19 @@ cx_sha512_block: @ + X[j-16 %F] MOV r0, r6 - SUBS r0, #16 - offsetJ r0 + SUBS r0, #16 + offsetJ r0 ADD r0, r7 LDM r0, {r0, r1} add_doubleword r0,r1,r4,r5 - + MOV r0, r6 - offsetJ r0 + offsetJ r0 ADD r0, r7 - STM r0!, {r4,r5} - _end_16: + STM r0!, {r4,r5} + _end_16: - @compute t1 + @compute t1 @ sum1(E): r14,r18,r41 peekAH r0, r1,#_E _mcx_rotr64_32 14,r4,r5 @@ -296,7 +296,7 @@ cx_sha512_block: peekAH r0, r1,#_H add_doubleword r0,r1,r4,r5 MOV r10,r4 - MOV r11,r5 + MOV r11,r5 @ + ch(E,F,G) : (x & y) ^ (~x & z) peekAH r0, r1, #_E peekAH r2, r3, #_F @@ -308,7 +308,7 @@ cx_sha512_block: ANDS r4, r4, r0 @ z = ~x& z ANDS r5, r5, r1 EORS r4, r2 @ ^ - EORS r5, r3 + EORS r5, r3 MOV r0, r10 MOV r1, r11 add_doubleword r0,r1,r4,r5 @@ -317,19 +317,19 @@ cx_sha512_block: MOV r1, r6 LSLS r1, #3 ADD r0, r1 - LDM r0, {r0,r1} + LDM r0, {r0,r1} add_doubleword r1,r0,r4,r5 @ + X[j&0xF] MOV r0, r6 - offsetJ r0 + offsetJ r0 ADD r0, r7 LDM r0, {r0, r1} add_doubleword r0,r1,r4,r5 - @ t1 + @ t1 MOV r10,r4 MOV r11,r5 - @ compute t2 + @ compute t2 @ sum0(A): r28,r34,r39 peekAH r0, r1,#_A _mcx_rotr64_32 28,r4,r5 @@ -349,7 +349,7 @@ cx_sha512_block: @ maj(A,B,C); (x & y) ^ (x & z) ^ (y & z) peekAH r0, r1, #_A peekAH r2, r3, #_B - ANDS r2, r0, r2 + ANDS r2, r0, r2 ANDS r3, r1, r3 @ x&y peekAH r4, r5, #_C ANDS r0, r0, r4 @@ -357,7 +357,7 @@ cx_sha512_block: EORS r0, r2 EORS r1, r3 @ ^ peekAH r2, r3, #_B - ANDS r4, r4, r2 + ANDS r4, r4, r2 ANDS r5, r5, r3 @ y&z EORS r0, r4 EORS r1, r5 @ ^ @@ -400,7 +400,7 @@ cx_sha512_block: MOV r5,r12 add_doubleword r4,r5,r2,r3 STM r1!, {r2,r3} @A = t1+t2 - + @ more rounds? ADDS r6,#1 B _loop_80 @@ -408,7 +408,7 @@ cx_sha512_block: @ final chaining - LDR r0, [SP, #_hash] + LDR r0, [SP, #_hash] ADDS r0, r0, #OFSacc MOV r1, r0 .macro updateACC _AH @@ -416,16 +416,16 @@ cx_sha512_block: peekAH r4, r5, \_AH add_doubleword r4,r5,r2,r3 STM r1!, {r2,r3} -.endm - updateACC #_A - updateACC #_B - updateACC #_C - updateACC #_D - updateACC #_E - updateACC #_F - updateACC #_G - updateACC #_H - +.endm + updateACC #_A + updateACC #_B + updateACC #_C + updateACC #_D + updateACC #_E + updateACC #_F + updateACC #_G + updateACC #_H + ADD SP,#_cx_sha512_block_locals POP {r4, r5, r6, r7} MOV r8, r4 diff --git a/lib_cxng/src/cx_utils.h b/lib_cxng/src/cx_utils.h index 1a117f61f..0bc1c400c 100644 --- a/lib_cxng/src/cx_utils.h +++ b/lib_cxng/src/cx_utils.h @@ -89,4 +89,4 @@ void cx_swap_buffer64(uint64bits_t *v, int len); void cx_memxor(uint8_t *buf1, const uint8_t *buf2, size_t len); -#endif // CX_UTILS_H +#endif // CX_UTILS_H diff --git a/lib_stusb_impl/usbd_impl.c b/lib_stusb_impl/usbd_impl.c index 0c7bf983d..d30393f04 100644 --- a/lib_stusb_impl/usbd_impl.c +++ b/lib_stusb_impl/usbd_impl.c @@ -196,17 +196,17 @@ static uint8_t const USBD_PRODUCT_FS_STRING[] = { #endif /* USB Standard Device Descriptor */ -static uint8_t const USBD_LangIDDesc[]= +static uint8_t const USBD_LangIDDesc[]= { - USB_LEN_LANGID_STR_DESC, - USB_DESC_TYPE_STRING, + USB_LEN_LANGID_STR_DESC, + USB_DESC_TYPE_STRING, LOBYTE(USBD_LANGID_STRING), - HIBYTE(USBD_LANGID_STRING), + HIBYTE(USBD_LANGID_STRING), }; static uint8_t const USB_SERIAL_STRING[] = { - 4*2+2, + 4*2+2, USB_DESC_TYPE_STRING, '0', 0, '0', 0, @@ -509,58 +509,58 @@ static __ALIGN_BEGIN uint8_t const USBD_CfgDesc[] __ALIGN_END = 0x21, /* bDescriptorType: Functional Descriptor type. */ 0x10, /* bcdCCID(LSB): CCID Class Spec release number (1.00) */ 0x01, /* bcdCCID(MSB) */ - + 0x00, /* bMaxSlotIndex :highest available slot on this device */ 0x03, /* bVoltageSupport: bit Wise OR for 01h-5.0V 02h-3.0V 04h 1.8V*/ - + 0x01,0x00,0x00,0x00, /* dwProtocols: 0001h = Protocol T=0 */ - 0x10,0x0E,0x00,0x00, /* dwDefaultClock: 3.6Mhz = 3600kHz = 0x0E10, - for 4 Mhz the value is (0x00000FA0) : + 0x10,0x0E,0x00,0x00, /* dwDefaultClock: 3.6Mhz = 3600kHz = 0x0E10, + for 4 Mhz the value is (0x00000FA0) : This is used in ETU and waiting time calculations*/ - 0x10,0x0E,0x00,0x00, /* dwMaximumClock: Maximum supported ICC clock frequency - in KHz. So, 3.6Mhz = 3600kHz = 0x0E10, + 0x10,0x0E,0x00,0x00, /* dwMaximumClock: Maximum supported ICC clock frequency + in KHz. So, 3.6Mhz = 3600kHz = 0x0E10, 4 Mhz (0x00000FA0) : */ - 0x00, /* bNumClockSupported : no setting from PC - If the value is 00h, the - supported clock frequencies are assumed to be the - default clock frequency defined by dwDefaultClock - and the maximum clock frequency defined by + 0x00, /* bNumClockSupported : no setting from PC + If the value is 00h, the + supported clock frequencies are assumed to be the + default clock frequency defined by dwDefaultClock + and the maximum clock frequency defined by dwMaximumClock */ - + 0xCD,0x25,0x00,0x00, /* dwDataRate: Default ICC I/O data rate in bps - 9677 bps = 0x25CD + 9677 bps = 0x25CD for example 10752 bps (0x00002A00) */ - - 0xCD,0x25,0x00,0x00, /* dwMaxDataRate: Maximum supported ICC I/O data + + 0xCD,0x25,0x00,0x00, /* dwMaxDataRate: Maximum supported ICC I/O data rate in bps */ 0x00, /* bNumDataRatesSupported : The number of data rates that are supported by the CCID - If the value is 00h, all data rates between the default - data rate dwDataRate and the maximum data rate + If the value is 00h, all data rates between the default + data rate dwDataRate and the maximum data rate dwMaxDataRate are supported. Dont support GET_CLOCK_FREQUENCIES - */ - //46 + */ + //46 0x00,0x00,0x00,0x00, /* dwMaxIFSD: 0 (T=0 only) */ 0x00,0x00,0x00,0x00, /* dwSynchProtocols */ 0x00,0x00,0x00,0x00, /* dwMechanical: no special characteristics */ - + 0xBA, 0x06, 0x02, 0x00, - //0x38,0x00,EXCHANGE_LEVEL_FEATURE,0x00, + //0x38,0x00,EXCHANGE_LEVEL_FEATURE,0x00, /* dwFeatures: clk, baud rate, voltage : automatic */ - /* 00000008h Automatic ICC voltage selection + /* 00000008h Automatic ICC voltage selection 00000010h Automatic ICC clock frequency change - 00000020h Automatic baud rate change according to - active parameters provided by the Host or self - determined 00000100h CCID can set - ICC in clock stop mode - - Only one of the following values may be present to + 00000020h Automatic baud rate change according to + active parameters provided by the Host or self + determined 00000100h CCID can set + ICC in clock stop mode + + Only one of the following values may be present to select a level of exchange: 00010000h TPDU level exchanges with CCID 00020000h Short APDU level exchange with CCID - 00040000h Short and Extended APDU level exchange + 00040000h Short and Extended APDU level exchange If none of those values : character level of exchange*/ 0x0F,0x01,0x00,0x00, /* dwMaxCCIDMessageLength: Maximum block size + header*/ /* 261 + 10 */ @@ -579,7 +579,7 @@ static __ALIGN_BEGIN uint8_t const USBD_CfgDesc[] __ALIGN_END = LOBYTE(CCID_BULK_EPIN_SIZE), HIBYTE(CCID_BULK_EPIN_SIZE), 0x00, /*Polling interval in milliseconds */ - + 0x07, /*Endpoint descriptor length = 7 */ 0x05, /*Endpoint descriptor type */ CCID_BULK_OUT_EP, /*Endpoint address (OUT, address 1) */ @@ -654,7 +654,7 @@ __ALIGN_BEGIN uint8_t const USBD_HID_Desc[] __ALIGN_END = sizeof(HID_ReportDesc),/*wItemLength: Total length of Report descriptor*/ 0x00, }; -#else +#else /* USB HID device Configuration Descriptor */ __ALIGN_BEGIN uint8_t const USBD_HID_Desc_kbd[] __ALIGN_END = { @@ -705,13 +705,13 @@ static uint8_t const USBD_DeviceDesc[]= { #if defined(HAVE_VID_PID_PROBER) || defined(HAVE_LEGACY_PID) LOBYTE(USBD_PID), /* idProduct */ #else // HAVE_VID_PID_PROBER || defined(HAVE_LEGACY_PID) - LOBYTE(USBD_PID + LOBYTE(USBD_PID #ifndef HAVE_USB_HIDKBD | 0x01 #else | 0x02 #endif -#ifdef HAVE_IO_U2F +#ifdef HAVE_IO_U2F | 0x04 #endif // HAVE_IO_U2F #ifdef HAVE_USB_CLASS_CCID @@ -720,12 +720,12 @@ static uint8_t const USBD_DeviceDesc[]= { #ifdef HAVE_WEBUSB | 0x10 #endif // HAVE_WEBUSB - ), -#endif // HAVE_VID_PID_PROBER || HAVE_LEGACY_PID + ), +#endif // HAVE_VID_PID_PROBER || HAVE_LEGACY_PID HIBYTE(USBD_PID), /* idProduct */ - // Change this ID to make windows WINUSB/WEBUSB reenumerate when the + // Change this ID to make windows WINUSB/WEBUSB reenumerate when the // descriptor changes and the PID/VID are not changed. 0x01, /* bcdDevice rel. 2.01 */ 0x02, diff --git a/lib_ux/src/ux_layout_bb.c b/lib_ux/src/ux_layout_bb.c index 69577f3f0..65a940f2d 100644 --- a/lib_ux/src/ux_layout_bb.c +++ b/lib_ux/src/ux_layout_bb.c @@ -45,7 +45,7 @@ const bagl_element_t ux_layout_bb_elements[] = { // left/right icons {{BAGL_ICON , 0x01, 2, 12, 4, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, (const char*)&C_icon_left}, {{BAGL_ICON , 0x02, 122, 12, 4, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, (const char*)&C_icon_right}, - + {{BAGL_LABELINE , 0x10, 6, 12, 116, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, NULL}, {{BAGL_LABELINE , 0x11, 6, 26, 116, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, NULL}, #else diff --git a/lib_ux/src/ux_layout_pbb.c b/lib_ux/src/ux_layout_pbb.c index a09385484..f382e7397 100644 --- a/lib_ux/src/ux_layout_pbb.c +++ b/lib_ux/src/ux_layout_pbb.c @@ -47,7 +47,7 @@ const bagl_element_t ux_layout_pbb_elements[] = { // left/right icons {{BAGL_ICON , 0x01, 2, 12, 4, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, (const char*)&C_icon_left}, {{BAGL_ICON , 0x02, 122, 12, 4, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, (const char*)&C_icon_right}, - + {{BAGL_ICON , 0x0F, 16, 8, 16, 16, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, NULL}, {{BAGL_LABELINE , 0x10, 41, 12, 128, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px, 0 }, NULL}, {{BAGL_LABELINE , 0x11, 41, 26, 128, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_EXTRABOLD_11px, 0 }, NULL}, diff --git a/lib_ux/src/ux_layout_pn.c b/lib_ux/src/ux_layout_pn.c index ecdc956a2..4aa7627a4 100644 --- a/lib_ux/src/ux_layout_pn.c +++ b/lib_ux/src/ux_layout_pn.c @@ -40,7 +40,7 @@ const bagl_element_t ux_layout_pn_elements[] = { // left/right icons {{BAGL_ICON , 0x01, 2, 12, 4, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, (const char*)&C_icon_left }, {{BAGL_ICON , 0x02, 122, 12, 4, 7, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, 0 }, (const char*)&C_icon_right }, - + {{BAGL_ICON , 0x10, 56, 2, 16, 16, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, NULL }, {{BAGL_LABELINE , 0x11, 0, 28, 128, 32, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, NULL }, #else diff --git a/lib_ux/src/ux_legacy.c b/lib_ux/src/ux_legacy.c index 8f7aefba3..ea1b5bcdb 100644 --- a/lib_ux/src/ux_legacy.c +++ b/lib_ux/src/ux_legacy.c @@ -35,7 +35,7 @@ const bagl_element_t ux_menu_elements[] = { // icons {{BAGL_ICON , 0x81, 3, 14, 7, 4, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_UP }, NULL }, {{BAGL_ICON , 0x82, 118, 14, 7, 4, 0, 0, 0 , 0xFFFFFF, 0x000000, 0, BAGL_GLYPH_ICON_DOWN }, NULL }, - + // previous setting name {{BAGL_LABELINE , 0x41, 14, 3, 100, 12, 0, 0, 0 , 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px|BAGL_FONT_ALIGNMENT_CENTER, 0 }, NULL }, diff --git a/src/ledger_protocol.c b/src/ledger_protocol.c index 28d016470..500e7c72d 100644 --- a/src/ledger_protocol.c +++ b/src/ledger_protocol.c @@ -211,4 +211,4 @@ void LEDGER_PROTOCOL_tx(uint8_t *buffer, uint16_t length) } ledger_protocol->chunk_length = chunk_offset; PRINTF(" %d\n", ledger_protocol->chunk_length); -} \ No newline at end of file +}