Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsa peripheral support #467

Merged
merged 1 commit into from
Apr 11, 2023
Merged

rsa peripheral support #467

merged 1 commit into from
Apr 11, 2023

Conversation

matrixhead
Copy link
Contributor

@matrixhead matrixhead commented Apr 5, 2023

this pr adds support for rsa peripheral, i would love to hear your thoughts on this also i tested it only in esp32 so i'm not sure this is working on other chips.

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good so far, thanks for the PR! I've tested on ESP32, ESP32-C3 & ESP32-S3 and it seems to work well so far.

CI needs fixing, could you:

  • Run rustfmt across the project
  • either bump the msrv to 1.67 or use a different solution than ilog2 etc

One final thing, and this is optional, but it would be nice to have a small benchmark vs some software solution, like we do for the other crypto examples.

@matrixhead
Copy link
Contributor Author

@MabezDev thanks 😀 i will try to do these

@matrixhead matrixhead reopened this Apr 5, 2023
@matrixhead matrixhead requested a review from MabezDev April 5, 2023 19:08
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Looks great!

@MabezDev MabezDev requested a review from bjoernQ April 11, 2023 10:27
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks for your contribution

@MabezDev MabezDev merged commit 9ff3837 into esp-rs:main Apr 11, 2023
playfulFence pushed a commit to playfulFence/esp-hal that referenced this pull request Apr 18, 2023
jessebraham added a commit that referenced this pull request Apr 20, 2023
* Update `esp-hal-procmacros` and `esp-hal-smartled` packages to support H2

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Made some progress, some aside functions are already done, bbpll configure builds, problem with 3 registers

* More progress, all necessary functions are implemented (not every was verified). Next step - test on HW

* added bus update to  function

* add esp32h2-hal package

* remove offset for ROM (maybe temporarly)

* comment yet unimplemented includes

* Provided  (COMPLETELY NOT SURE if it's a real solution)

* defined interrupt_map_base

* fix typo

* Implemented boot_defaults and configure functions for clock

* Not providing _start_trap_rust_hal to the linker manually now

* Typo: delete comment

* Cleaning code(1): Removed unnecessary moves, registers, addresses, functions

* Remove irrelevant comments

* Enable interrupt peripherals

* Fix errors, wrong addresses and offsets. Added new CpuClock mode for esp32h2

* Added bus update, enabling and setting i2c mst clk frequency, deleted irrelevant comments

* fix CpuControl::start_app_core signature (#466)

* Minor linker script additions

* Use correct linker script comment style

* get_wakeup_cause: fix comparison error

* Use 192 as mclk_multiple for 24-bit I2S

* use bitflags to decode wakeup cause (#473)

* get_wakeup_cause: use bitflags instead of cast, &

* get_wakeup_cause: bitflags for other cpus

* rsa peripheral support (#467)

* Added software interrupt API, examples for all of the MCUs

* Added software interrupt API, examples for all of the MCUs

* Pin nightly to 2023-03-09 to workaround a problem with embedded-hal-async in CI

* Fixed comments

* Fixed comments

* Fixed comments

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Updated Cargo.toml

* Added esp32h2-hal and other ESP32-H2 to CI workflow

* Fix Cargo.toml and add a simple hello_world example

* ci: Fix indentation

* Update esp-backtrace version in Cargo.toml

* Adjust for rustfmt

* Adjust for rustfmt

* Adjust for rustfmt

* Deleted irrelevant comments, fixed wrong i2c_clock frequency

* Update esp-hal-common/Cargo.toml

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* Populated SocResetReason to get get_wakeup_cause function working

* Update esp-hal-common/src/clock/clocks_ll/esp32h2.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* PAC has been updated, should be working now

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
Co-authored-by: dimpolo <33688001+dimpolo@users.noreply.github.com>
Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Christopher Liebman <liebman@zod.com>
Co-authored-by: Josh Weberruss <joshua.weberruss@gmail.com>
Co-authored-by: sreehari prasad <52113972+matrixhead@users.noreply.github.com>
Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
jessebraham added a commit to jessebraham/esp-hal that referenced this pull request Apr 20, 2023
* Update `esp-hal-procmacros` and `esp-hal-smartled` packages to support H2

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Made some progress, some aside functions are already done, bbpll configure builds, problem with 3 registers

* More progress, all necessary functions are implemented (not every was verified). Next step - test on HW

* added bus update to  function

* add esp32h2-hal package

* remove offset for ROM (maybe temporarly)

* comment yet unimplemented includes

* Provided  (COMPLETELY NOT SURE if it's a real solution)

* defined interrupt_map_base

* fix typo

* Implemented boot_defaults and configure functions for clock

* Not providing _start_trap_rust_hal to the linker manually now

* Typo: delete comment

* Cleaning code(1): Removed unnecessary moves, registers, addresses, functions

* Remove irrelevant comments

* Enable interrupt peripherals

* Fix errors, wrong addresses and offsets. Added new CpuClock mode for esp32h2

* Added bus update, enabling and setting i2c mst clk frequency, deleted irrelevant comments

* fix CpuControl::start_app_core signature (esp-rs#466)

* Minor linker script additions

* Use correct linker script comment style

* get_wakeup_cause: fix comparison error

* Use 192 as mclk_multiple for 24-bit I2S

* use bitflags to decode wakeup cause (esp-rs#473)

* get_wakeup_cause: use bitflags instead of cast, &

* get_wakeup_cause: bitflags for other cpus

* rsa peripheral support (esp-rs#467)

* Added software interrupt API, examples for all of the MCUs

* Added software interrupt API, examples for all of the MCUs

* Pin nightly to 2023-03-09 to workaround a problem with embedded-hal-async in CI

* Fixed comments

* Fixed comments

* Fixed comments

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Updated Cargo.toml

* Added esp32h2-hal and other ESP32-H2 to CI workflow

* Fix Cargo.toml and add a simple hello_world example

* ci: Fix indentation

* Update esp-backtrace version in Cargo.toml

* Adjust for rustfmt

* Adjust for rustfmt

* Adjust for rustfmt

* Deleted irrelevant comments, fixed wrong i2c_clock frequency

* Update esp-hal-common/Cargo.toml

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* Populated SocResetReason to get get_wakeup_cause function working

* Update esp-hal-common/src/clock/clocks_ll/esp32h2.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* PAC has been updated, should be working now

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
Co-authored-by: dimpolo <33688001+dimpolo@users.noreply.github.com>
Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Christopher Liebman <liebman@zod.com>
Co-authored-by: Josh Weberruss <joshua.weberruss@gmail.com>
Co-authored-by: sreehari prasad <52113972+matrixhead@users.noreply.github.com>
Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
SergioGasquez pushed a commit to SergioGasquez/esp-hal that referenced this pull request Apr 21, 2023
SergioGasquez added a commit to SergioGasquez/esp-hal that referenced this pull request Apr 21, 2023
* Update `esp-hal-procmacros` and `esp-hal-smartled` packages to support H2

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Made some progress, some aside functions are already done, bbpll configure builds, problem with 3 registers

* More progress, all necessary functions are implemented (not every was verified). Next step - test on HW

* added bus update to  function

* add esp32h2-hal package

* remove offset for ROM (maybe temporarly)

* comment yet unimplemented includes

* Provided  (COMPLETELY NOT SURE if it's a real solution)

* defined interrupt_map_base

* fix typo

* Implemented boot_defaults and configure functions for clock

* Not providing _start_trap_rust_hal to the linker manually now

* Typo: delete comment

* Cleaning code(1): Removed unnecessary moves, registers, addresses, functions

* Remove irrelevant comments

* Enable interrupt peripherals

* Fix errors, wrong addresses and offsets. Added new CpuClock mode for esp32h2

* Added bus update, enabling and setting i2c mst clk frequency, deleted irrelevant comments

* fix CpuControl::start_app_core signature (esp-rs#466)

* Minor linker script additions

* Use correct linker script comment style

* get_wakeup_cause: fix comparison error

* Use 192 as mclk_multiple for 24-bit I2S

* use bitflags to decode wakeup cause (esp-rs#473)

* get_wakeup_cause: use bitflags instead of cast, &

* get_wakeup_cause: bitflags for other cpus

* rsa peripheral support (esp-rs#467)

* Added software interrupt API, examples for all of the MCUs

* Added software interrupt API, examples for all of the MCUs

* Pin nightly to 2023-03-09 to workaround a problem with embedded-hal-async in CI

* Fixed comments

* Fixed comments

* Fixed comments

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Updated Cargo.toml

* Added esp32h2-hal and other ESP32-H2 to CI workflow

* Fix Cargo.toml and add a simple hello_world example

* ci: Fix indentation

* Update esp-backtrace version in Cargo.toml

* Adjust for rustfmt

* Adjust for rustfmt

* Adjust for rustfmt

* Deleted irrelevant comments, fixed wrong i2c_clock frequency

* Update esp-hal-common/Cargo.toml

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* Populated SocResetReason to get get_wakeup_cause function working

* Update esp-hal-common/src/clock/clocks_ll/esp32h2.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* PAC has been updated, should be working now

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
Co-authored-by: dimpolo <33688001+dimpolo@users.noreply.github.com>
Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Christopher Liebman <liebman@zod.com>
Co-authored-by: Josh Weberruss <joshua.weberruss@gmail.com>
Co-authored-by: sreehari prasad <52113972+matrixhead@users.noreply.github.com>
Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
jessebraham added a commit to jessebraham/esp-hal that referenced this pull request Apr 24, 2023
* Update `esp-hal-procmacros` and `esp-hal-smartled` packages to support H2

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Made some progress, some aside functions are already done, bbpll configure builds, problem with 3 registers

* More progress, all necessary functions are implemented (not every was verified). Next step - test on HW

* added bus update to  function

* add esp32h2-hal package

* remove offset for ROM (maybe temporarly)

* comment yet unimplemented includes

* Provided  (COMPLETELY NOT SURE if it's a real solution)

* defined interrupt_map_base

* fix typo

* Implemented boot_defaults and configure functions for clock

* Not providing _start_trap_rust_hal to the linker manually now

* Typo: delete comment

* Cleaning code(1): Removed unnecessary moves, registers, addresses, functions

* Remove irrelevant comments

* Enable interrupt peripherals

* Fix errors, wrong addresses and offsets. Added new CpuClock mode for esp32h2

* Added bus update, enabling and setting i2c mst clk frequency, deleted irrelevant comments

* fix CpuControl::start_app_core signature (esp-rs#466)

* Minor linker script additions

* Use correct linker script comment style

* get_wakeup_cause: fix comparison error

* Use 192 as mclk_multiple for 24-bit I2S

* use bitflags to decode wakeup cause (esp-rs#473)

* get_wakeup_cause: use bitflags instead of cast, &

* get_wakeup_cause: bitflags for other cpus

* rsa peripheral support (esp-rs#467)

* Added software interrupt API, examples for all of the MCUs

* Added software interrupt API, examples for all of the MCUs

* Pin nightly to 2023-03-09 to workaround a problem with embedded-hal-async in CI

* Fixed comments

* Fixed comments

* Fixed comments

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Updated Cargo.toml

* Added esp32h2-hal and other ESP32-H2 to CI workflow

* Fix Cargo.toml and add a simple hello_world example

* ci: Fix indentation

* Update esp-backtrace version in Cargo.toml

* Adjust for rustfmt

* Adjust for rustfmt

* Adjust for rustfmt

* Deleted irrelevant comments, fixed wrong i2c_clock frequency

* Update esp-hal-common/Cargo.toml

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* Populated SocResetReason to get get_wakeup_cause function working

* Update esp-hal-common/src/clock/clocks_ll/esp32h2.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* PAC has been updated, should be working now

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
Co-authored-by: dimpolo <33688001+dimpolo@users.noreply.github.com>
Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Christopher Liebman <liebman@zod.com>
Co-authored-by: Josh Weberruss <joshua.weberruss@gmail.com>
Co-authored-by: sreehari prasad <52113972+matrixhead@users.noreply.github.com>
Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
jessebraham added a commit to jessebraham/esp-hal that referenced this pull request Apr 24, 2023
* Update `esp-hal-procmacros` and `esp-hal-smartled` packages to support H2

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Made some progress, some aside functions are already done, bbpll configure builds, problem with 3 registers

* More progress, all necessary functions are implemented (not every was verified). Next step - test on HW

* added bus update to  function

* add esp32h2-hal package

* remove offset for ROM (maybe temporarly)

* comment yet unimplemented includes

* Provided  (COMPLETELY NOT SURE if it's a real solution)

* defined interrupt_map_base

* fix typo

* Implemented boot_defaults and configure functions for clock

* Not providing _start_trap_rust_hal to the linker manually now

* Typo: delete comment

* Cleaning code(1): Removed unnecessary moves, registers, addresses, functions

* Remove irrelevant comments

* Enable interrupt peripherals

* Fix errors, wrong addresses and offsets. Added new CpuClock mode for esp32h2

* Added bus update, enabling and setting i2c mst clk frequency, deleted irrelevant comments

* fix CpuControl::start_app_core signature (esp-rs#466)

* Minor linker script additions

* Use correct linker script comment style

* get_wakeup_cause: fix comparison error

* Use 192 as mclk_multiple for 24-bit I2S

* use bitflags to decode wakeup cause (esp-rs#473)

* get_wakeup_cause: use bitflags instead of cast, &

* get_wakeup_cause: bitflags for other cpus

* rsa peripheral support (esp-rs#467)

* Added software interrupt API, examples for all of the MCUs

* Added software interrupt API, examples for all of the MCUs

* Pin nightly to 2023-03-09 to workaround a problem with embedded-hal-async in CI

* Fixed comments

* Fixed comments

* Fixed comments

* Get scaffolding in place to get `esp-hal-common` building with `esp32h2` feature

* Updated Cargo.toml

* Added esp32h2-hal and other ESP32-H2 to CI workflow

* Fix Cargo.toml and add a simple hello_world example

* ci: Fix indentation

* Update esp-backtrace version in Cargo.toml

* Adjust for rustfmt

* Adjust for rustfmt

* Adjust for rustfmt

* Deleted irrelevant comments, fixed wrong i2c_clock frequency

* Update esp-hal-common/Cargo.toml

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* Populated SocResetReason to get get_wakeup_cause function working

* Update esp-hal-common/src/clock/clocks_ll/esp32h2.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

* PAC has been updated, should be working now

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
Co-authored-by: dimpolo <33688001+dimpolo@users.noreply.github.com>
Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Christopher Liebman <liebman@zod.com>
Co-authored-by: Josh Weberruss <joshua.weberruss@gmail.com>
Co-authored-by: sreehari prasad <52113972+matrixhead@users.noreply.github.com>
Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
i404788 pushed a commit to i404788/esp-hal that referenced this pull request Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants