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

[TR3FIR-217] Add PKA controller with RSA functionalities #20

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

piotrkrygier-intent
Copy link

@piotrkrygier-intent piotrkrygier-intent commented Jul 10, 2024

Created PKA driver for RSA operations. Operations include:

  • Generating private exponent based on provided primes
  • Encrypting message
  • Decrypting message

Please note that due to the lack of dev board, development has been done on nucleo board, using mainline embassy. Some changes might be needed for this to work with our version of embassy.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

I left a first pass, awesome work BTW.

embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
Copy link

@grochowski-withintent grochowski-withintent left a comment

Choose a reason for hiding this comment

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

Nice bits. Pushing partial review so that the ongoing discussions don't get outdated.

embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
Copy link

@grochowski-withintent grochowski-withintent left a comment

Choose a reason for hiding this comment

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

Sharing another portion of nitpicks. The basis looks very solid though.

embassy-stm32/src/pka/mod.rs Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/lib.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
@ghost ghost requested a review from mattcaron-token July 15, 2024 10:00
@RafalUlko RafalUlko changed the title [TR3FIR-217] Add PKA controller with RSA functionalities WIP: [TR3FIR-217] Add PKA controller with RSA functionalities Jul 22, 2024
Copy link

@mattcaron-token mattcaron-token left a comment

Choose a reason for hiding this comment

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

This mostly looks fine. I just have a couple questions I'd like to talk through before I approve.

embassy-stm32/src/pka/mod.rs Show resolved Hide resolved
embassy-stm32/src/pka/mod.rs Outdated Show resolved Hide resolved
@RafalUlko RafalUlko changed the title WIP: [TR3FIR-217] Add PKA controller with RSA functionalities [TR3FIR-217] Add PKA controller with RSA functionalities Jul 29, 2024
@RafalUlko RafalUlko force-pushed the pka_implement branch 2 times, most recently from 8712ba7 to 1a08752 Compare August 1, 2024 08:28
Piotr Krygier and others added 2 commits August 1, 2024 10:30
Work in progres, there is a problem with exponent.

Fix modular exponent

Add finished PKA implementation with RSA operations

Fix constexpression calculations

Replace bytemuck with custom data conversion
[TR3FIR-217] Remove RSA struct from PKA driver

[TR3FIR-217] Add padding for PKA RAM writes

[TR3FIR-217] Fix modulus padding in PKA mod exp method

[TR3FIR-217] Fix modular exp in PKA

[TR3FIR-217] Fix Mongtomery param in PKA
@RafalUlko
Copy link

Squashed all Piotr's and my commits into two separate ones.

Copy link

@mattcaron-token mattcaron-token left a comment

Choose a reason for hiding this comment

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

I've reviewed most of this already, but I re-read through it and it looks fine.

@lukasz-zajac lukasz-zajac merged commit 9e481f8 into token-main Aug 5, 2024
@lukasz-zajac lukasz-zajac deleted the pka_implement branch August 5, 2024 14:43
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.

5 participants