Follow up questions on Windows AES one-shot encryptor #63595
-
Hey @vcsjones, I had a few follow up questions about #58270 😄 About
I understand we can't pass the IV directly because the implementation on Windows writes on that block while encrypting/decrypting, but can't we rent this buffer from a pool instead? Or better yet, given this
I know that when using OpenSSL we do need to reinitialize the handle as it uses both the key and the IV, but given on Windows it only uses the key and the IV is a separate parameter, couldn't we cache this imported key when using the instance methods of About Thanks! And again, great work on all the crypto APIs! 🚀 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It probably can be done that way. I had that same comment in #55601 but the work around it hasn't been done.
We can, and that is an outstanding item in #55601, but it's somewhat non-trivial because the one shots are currently thread safe. You can't use a Windows key handle from multiple threads, and I don't want the APIs to go from thread safe to not thread safe. So
They could, and I started out that way, but I am having a hard time remembering why I went back to classes. I think the I am taking the time to do this "right" with structs (and using generics with constraints to even avoid boxing) for the stream hashing, so I can probably revisit this when I am done with that. I will update #55601 with these comments so that I don't forget them. |
Beta Was this translation helpful? Give feedback.
It probably can be done that way. I had that same comment in #55601 but the work around it hasn't been done.
We can, and that is an outstanding item in #55601, but it's somewhat non-trivial because the one shots are curr…