π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Avoid redundant copy
Neerajeea70db1fdcd
diff --git a/mobile/plugins/ente_crypto/lib/src/crypto.dart b/mobile/plugins/ente_crypto/lib/src/crypto.dartindex 9f7a10f8c2..52202c5ac9 100644--- a/mobile/plugins/ente_crypto/lib/src/crypto.dart+++ b/mobile/plugins/ente_crypto/lib/src/crypto.dart@@ -57,7 +57,11 @@ Future<Uint8List> cryptoGenericHash(Map<String, dynamic> args) async {final state =Sodium.cryptoGenerichashInit(null, Sodium.cryptoGenerichashBytesMax);await for (final chunk in file.openRead()) {- Sodium.cryptoGenerichashUpdate(state, Uint8List.fromList(chunk));+ if (chunk is Uint8List) {+ Sodium.cryptoGenerichashUpdate(state, chunk);+ } else {+ Sodium.cryptoGenerichashUpdate(state, Uint8List.fromList(chunk));+ }}return Sodium.cryptoGenerichashFinal(state, Sodium.cryptoGenerichashBytesMax);}