eng_cryptodev.c appears to be exhibit bad behavior when hashing large files.
The problem is that unless EVP_MD_CTX_FLAG_ONESHOT is set on the message
digest context, the engine will continue to suck all the data into memory
(the mac_data field) eventually exhausting
the memory of the host machine. If that flag is set, then state doesn't
carry over from operation to operation.

I could be wrong, but it seems to be the correct way to call crypto dev is
to
set the COP_FLAG_UPDATE flag during digest update, and set the
COP_FLAG_FINAL
flag when you're ready to read the digest.

https://github.com/shanemhansen/gocryptodev/blob/master/digest.go

Thanks for openssl's hard work, it's a great platform! Please let me know
if this:

a) expected behavior
b) Me incorrectly using cryptodev
c) Some sort of workaround I'm not understanding.

eng_cryptodev.c appears to be exhibit bad?behavior?when hashing large files.
The problem is that unless?EVP_MD_CTX_FLAG_ONESHOT is set on the message
digest context, the engine will continue to suck all the data into memory (the mac_data field) eventually exhausting
the memory of the host machine. If that flag is set, then state doesn't carry over from operation to operation.

I could be wrong, but it seems to be the correct way to call crypto dev is to
set the COP_FLAG_UPDATE flag during digest update, and set the COP_FLAG_FINAL
flag when you're ready to read the digest.

https://github.com/shanemhansen/gocryptodev/blob/master/digest.go

Thanks for openssl's hard work, it's a great platform! Please let me know if this:

a) expected?behavior
b) Me incorrectly using cryptodev
c) Some sort of workaround I'm not understanding.

Reply via email to