1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibPDF: Implement 7.6.4.3.4 Algorithm 2.B: Computing a hash

This is a step towards AESV3 support for PDF files.

The straight-forward way of writing this with our APIs is pretty
allocation-heavy, but this code won't run all that often for the
regular "open PDF, check password" flow.
This commit is contained in:
Nico Weber 2023-07-17 20:39:55 -04:00 committed by Linus Groh
parent 492962502f
commit c4bad2186f
2 changed files with 80 additions and 22 deletions

View file

@ -62,7 +62,12 @@ private:
ByteBuffer compute_encryption_key_r2_to_r5(ByteBuffer password_string);
ByteBuffer compute_encryption_key_r6_and_later(ByteBuffer password_string);
ByteBuffer computing_a_hash_r6_and_later(ByteBuffer password_string);
enum class HashKind {
Owner,
User,
};
ByteBuffer computing_a_hash_r6_and_later(ByteBuffer input, StringView input_password, HashKind);
Document* m_document;
size_t m_revision;