π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Inline
Manav Rathi1496b60895d7
diff --git a/web/apps/photos/src/services/upload/uploadService.ts b/web/apps/photos/src/services/upload/uploadService.tsindex 66c0dcf8da..b18e0c4781 100644--- a/web/apps/photos/src/services/upload/uploadService.ts+++ b/web/apps/photos/src/services/upload/uploadService.ts@@ -16,7 +16,7 @@ import { basename } from "@/next/file";import log from "@/next/log";import { CustomErrorMessage } from "@/next/types/ipc";import { ensure } from "@/utils/ensure";-import { ENCRYPTION_CHUNK_SIZE } from "@ente/shared/crypto/constants";+import { ENCRYPTION_CHUNK_SIZE } from "@ente/shared/crypto/internal/libsodium";import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker";import type { B64EncryptionResult } from "@ente/shared/crypto/types";import { CustomError, handleUploadError } from "@ente/shared/error";diff --git a/web/packages/shared/crypto/constants.ts b/web/packages/shared/crypto/constants.tsdeleted file mode 100644index 9226ed8744..0000000000--- a/web/packages/shared/crypto/constants.ts+++ /dev/null@@ -1 +0,0 @@-export const ENCRYPTION_CHUNK_SIZE = 4 * 1024 * 1024;diff --git a/web/packages/shared/crypto/internal/libsodium.ts b/web/packages/shared/crypto/internal/libsodium.tsindex 8c64bc4b0d..4337a0fb12 100644--- a/web/packages/shared/crypto/internal/libsodium.ts+++ b/web/packages/shared/crypto/internal/libsodium.ts@@ -9,7 +9,6 @@import { mergeUint8Arrays } from "@/utils/array";import { CustomError } from "@ente/shared/error";import sodium, { type StateAddress } from "libsodium-wrappers";-import { ENCRYPTION_CHUNK_SIZE } from "../constants";import type { B64EncryptionResult } from "../types";export async function fromB64(input: string) {@@ -115,6 +114,8 @@ export async function decryptChaChaOneShot(return pullResult.message;}+export const ENCRYPTION_CHUNK_SIZE = 4 * 1024 * 1024;+export const decryptChaCha = async (data: Uint8Array,header: Uint8Array,