Page MenuHomePhabricator

[CryptoModule] add sequential decrypt to crypto API
ClosedPublic

Authored by kamil on Apr 22 2024, 3:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 4:49 AM
Unknown Object (File)
Fri, Nov 22, 4:45 AM
Unknown Object (File)
Fri, Nov 22, 4:31 AM
Unknown Object (File)
Thu, Nov 21, 10:48 PM
Unknown Object (File)
Tue, Nov 12, 4:16 AM
Unknown Object (File)
Fri, Nov 8, 5:12 PM
Unknown Object (File)
Tue, Nov 5, 3:23 PM
Unknown Object (File)
Oct 23 2024, 7:24 PM
Subscribers

Details

Summary

This adds wrapper to olm method to sequential decrypt added in PR#11.

Test Plan

Tested in next diff in the stack

Diff Detail

Repository
rCOMM Comm
Branch
publish-receiver
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
native/cpp/CommonCpp/CryptoTools/Session.cpp
160 ↗(On Diff #39368)

there is some code duplication but not sure if there is a cleaner way of deduplicating this

kamil published this revision for review.Apr 23 2024, 6:37 AM
native/cpp/CommonCpp/CryptoTools/Session.cpp
160 ↗(On Diff #39368)

Could we extract it to a common function that returns length for decrypted content buffer? This particular example seems to be too much duplication.

202 ↗(On Diff #39368)

I think it wouldn't hurt to replace it with constructor that doesn't require casting:

std::string{decryptedMessage.begin(), decryptedMessage.end()};
This revision is now accepted and ready to land.Apr 24 2024, 3:04 AM

I missed @marcin's inline comments - I'll put up a diff shortly

native/cpp/CommonCpp/CryptoTools/Session.cpp
160 ↗(On Diff #39368)

not sure about it - this function will only call olm_decrypt_max_plaintext_length which is weird because it's like creating a wrapper over direct olm function call

202 ↗(On Diff #39368)