awnumar / memguard

Secure software enclave for storage of sensitive information in memory.
Apache License 2.0
2.49k stars 124 forks source link

Add PlaintextSize method to Enclaves #120

Closed capnspacehook closed 4 years ago

capnspacehook commented 4 years ago

The size of the ciphertext of Enclaves is not a secret, and given that we know the size overhead of storing plaintext in an Enclave, it would be useful and more efficient to have a function that returns the size of the plaintext, without needing to create a LockedBuffer and get the size of it's protected bytes.

capnspacehook commented 4 years ago

Not sure why it fails on Windows...

awnumar commented 4 years ago

Good idea, thanks for the pull request. I don't know why the test is failing on Windows either, there is no modules.txt file because dependencies aren't being vendored...

capnspacehook commented 4 years ago

I wasn't sure what to name the new method, I like Size though. I was initially worried it would be confusing, as it isn't the true size of the Enclave, but thinking about it some more it makes sense to me. Thanks for adding the test, was going to add that but you beat me to it 👍