-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add implementation for AES CBC in Sys.Security.Crypto #2888
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition :-)
cadbd8b
to
94d5700
Compare
WalkthroughThe recent updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.cpp (2 hunks)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.h (1 hunks)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography_System_Security_Cryptography_Aes.cpp (5 hunks)
Additional comments not posted (10)
src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.cpp (2)
24-25
: New AES CBC methods added to the lookup table.The new methods
EncryptAesCbc
andDecryptAesCbc
are correctly added to the method lookup table.
41-43
: Native assembly data updated.The assembly identifier and version are correctly updated to reflect the new changes.
src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.h (4)
35-35
: New cipher mode added.The new cipher mode
CipherMode_CBC
is correctly added to theCipherMode
enum.
43-43
: New field added to struct.The new field
FIELD___iv
is correctly added to theLibrary_nf_sys_sec_cryptography_System_Security_Cryptography_Aes
struct.
47-47
: New native declaration added for EncryptAesCbc.The new native declaration
EncryptAesCbc___SZARRAY_U1__SZARRAY_U1
is correctly added.
48-48
: New native declaration added for DecryptAesCbc.The new native declaration
DecryptAesCbc___SZARRAY_U1__SZARRAY_U1
is correctly added.src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography_System_Security_Cryptography_Aes.cpp (4)
Line range hint
14-70
:
AES ECB encryption loop added.The new
passCount
variable and loop for processing data in 16-byte chunks are correctly implemented.
Line range hint
87-144
:
AES ECB decryption loop added.The new
passCount
variable and loop for processing data in 16-byte chunks are correctly implemented.
154-268
: AES CBC encryption function added.The new AES CBC encryption function is correctly implemented, including proper memory management and error handling.
Line range hint
270-353
:
AES CBC decryption function added.The new AES CBC decryption function is correctly implemented, including proper memory management and error handling.
- Add wrapper for mbedTLS API. - Update assembly declaration.
- This is because its overwritten in the call with the output result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.cpp (2 hunks)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.h (1 hunks)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography_System_Security_Cryptography_Aes.cpp (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.cpp
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography.h
- src/nanoFramework.System.Security.Cryptography/nf_sys_sec_cryptography_System_Security_Cryptography_Aes.cpp
Description
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Documentation