-
Notifications
You must be signed in to change notification settings - Fork 3
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 AES Hardware Abstraction for MAX78000 HAL #9
base: main
Are you sure you want to change the base?
Conversation
…control reg for some reason
Any chance of exposing a RustCrypto compatible interface here? There seem to be some rough edges around the current interface. |
I feel that would outside the scope of a embedded hal. plus I dont know if I would have time to completed that. Feel free to add this if you would like. |
# Conflicts: # src/lib.rs
… encrypt and decrypt
Done tested with AesGcm there is a catch you cannot use the new keyword from AesGcm because cannot pass the setup objects into the constructor. It has to be used like this. let aes = Aes128Hardware::new_with_key(p.aes, &mut gcr.reg, Key::<Aes128Hardware>::default());
let cipher: AesGcm<Aes128Hardware, U12, U16> = AesGcm::from(aes);
let nonce = Nonce::<U12>::from_slice(&[0u8; 12]);
loop {
let mut data = [0u8; 16];
console.read_bytes(&mut data);
console.write_bytes(&data);
let result = cipher.encrypt(&nonce, &data[..]).unwrap();
console.write_bytes(result.as_slice());
let result = cipher.decrypt(&nonce, &result[..]).unwrap();
console.write_bytes(result.as_slice());
}
|
This pull request introduces an AES hardware abstraction layer for the MAX78000 HAL. The new module provides functionality for configuring and using the AES peripheral, including support for key management, encryption, and decryption in 16-byte blocks.
Key Features
AES Key Management:
Key
enum.Encryption and Decryption:
FIFO Operations:
Added Files
aes.rs
: Contains the AES hardware abstraction implementation.Code Example