I know linux kernel has “aes” module internally , so perhaps someone could provide me an example for it , as i’m making a kernel module which utiliser this function.
Many thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could look at
net/mac80211/aes_ccm.cfor example. The basic sequence iscrypto_alloc_cipher("aes", ...)crypto_cipher_setkey(...)crypto_cipher_encrypt_one(...)as much as you needcrypto_free_cipher(...)Or
net/ceph/crypto.cgives an example of using AES in CBC mode.In any case be very careful of how you generate keys and the chaining mode, or else you are likely to make a mistake and do something insecure.