feat: improve BinaryWriter API#986
Conversation
92abbcb to
7766c73
Compare
025fcab to
4470355
Compare
|
@nico-famedly: Can you try out the |
f51ea31 to
74d6835
Compare
|
I parallelized the binary writer API in a way that the hive cipher now only needs to immediately return the pretended length of the encrypted data while the actual encryption can happen in background - also several crypto operations at once. That's what the When the native implementation is told to write to disk (e.g. by flush() or close()), the There, the binary writer checks whether there are running operations in background and correspondingly waits for them to complete. Afterwards, the buffer is returned. For some reason, at this place, the returned buffer is always an empty buffer filled with 0 only, even though exactly before, a print of the buffer shows the correct bytes inside. Also, this here ensures the cache of pending operations is empty before returning the buffer. Any idea? |
74d6835 to
536af7b
Compare
c1a214e to
aa0ef45
Compare
aa0ef45 to
b1ab7b7
Compare
- extend default buffer size - allow HiveCipher to asynchronously perform crypto - implement HiveAesThreadedCipher for Hive Flutter - fix missing file in .gitignore In theory, no public API should be made incompatible here as HIveCipher was simply converted from `T Function()` to `FutureOr<T> Function()`. The idea behind the asynchronous operation is a) multithreading using e.g. the `compute()` function in Flutter or b) platform-native implementations making use of hardware-accelerated cryptographic implementations. Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
13b1a6e to
8d972e1
Compare
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
8d972e1 to
70ccfb0
Compare
In theory, no public API should be made incompatible here as HIveCipher
was simply converted from
T Function()toFutureOr<T> Function().The idea behind the asynchronous operation is
a) multithreading using e.g. the
compute()function in Flutter orb) platform-native implementations making use of hardware-accelerated
cryptographic implementations.
CC: @nico-famedly maybe you like to try out this?
Signed-off-by: TheOneWithTheBraid the-one@with-the-braid.cf