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

How do I use the internal AES encrypt and decrypt functions in ESP code? (IDFGH-14319) #15111

Open
3 tasks done
andy-danieal opened this issue Dec 30, 2024 · 3 comments
Open
3 tasks done
Assignees
Labels
Status: Opened Issue is new

Comments

@andy-danieal
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

wpa_supplicant/src/crypto/aes-cbc.c
Functions
aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len);
aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len);

how to used that function without 16-bytes blocks restrictions.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 30, 2024
@github-actions github-actions bot changed the title How do I use the internal AES encrypt and decrypt functions in ESP code? How do I use the internal AES encrypt and decrypt functions in ESP code? (IDFGH-14319) Dec 30, 2024
@kapilkedawat
Copy link
Collaborator

Hi @andy-danieal, may I ask what's the usecase here? This is internal WiFi API and supposed to be used by internal functions only. If you are looking for a public implementation for applications, may be you should look at mbedtls_aes_crypt_cbc().

@andy-danieal
Copy link
Author

Thank you for your response, @kapilkedawat . I'm looking for an example of how to use the internal AES encrypt and decrypt functions in ESP code. Specifically, I'd like to encrypt and decrypt a uint8_t array of bytes. Do you have an example that I could use?

@kapilkedawat
Copy link
Collaborator

you can refer this sample code for encryption. https://github.com/espressif/mbedtls/blob/mbedtls-3.6.2-idf/programs/test/benchmark.c#L720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants