briansmith / ring

Safe, fast, small crypto using Rust
Other
3.76k stars 708 forks source link

Add store/restore functionality to digest::Context #2053

Open anatse opened 6 months ago

anatse commented 6 months ago

For some cases, such as compute hash sum for very big data passed through the HTTP streams, it is necessary to store and restore digest context. Our case: we are have storage which provides HTTP API to download with resume, using ranges. And this storage provides SHA_XXX hash sum for whole provided data, not for part. Therefore it need to check integrity for all data at the end of stream. In most cases it is not possible to complete the operation in one session, in cause to network errors. And compute whole hash sum using ring impossible because Context cannot be restored from pervious session. We also cannot see whole data at a time because we are acts just as a proxy and target system also not provides as a hash sum.

briansmith commented 6 months ago

I don't have a problem with adding this, but I don't have cycles to do the work on it, so somebody would need to contribute it.

anatse commented 5 months ago

PR - https://github.com/briansmith/ring/pull/2081