mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Denoise
This commit is contained in:
parent
9ae5006a4a
commit
0240b37032
@ -1,11 +1,6 @@
|
||||
/** Careful when adding add other imports! */
|
||||
import * as libsodium from "./libsodium";
|
||||
import type {
|
||||
BytesOrB64,
|
||||
DecryptBlobB64,
|
||||
EncryptedBlob_2,
|
||||
EncryptJSON,
|
||||
} from "./types";
|
||||
import type { BytesOrB64, EncryptedBlob_2, EncryptJSON } from "./types";
|
||||
|
||||
export const _encryptBoxB64 = libsodium.encryptBoxB64;
|
||||
|
||||
@ -55,7 +50,11 @@ export const _decryptMetadataJSON_New = async (
|
||||
new TextDecoder().decode(await _decryptBlob(blob, key)),
|
||||
) as unknown;
|
||||
|
||||
export const _decryptMetadataJSON = async (r: DecryptBlobB64) =>
|
||||
export const _decryptMetadataJSON = async (r: {
|
||||
encryptedDataB64: string;
|
||||
decryptionHeaderB64: string;
|
||||
keyB64: string;
|
||||
}) =>
|
||||
_decryptMetadataJSON_New(
|
||||
{
|
||||
encryptedData: r.encryptedDataB64,
|
||||
|
@ -53,7 +53,6 @@ import { inWorker } from "../env";
|
||||
import * as ei from "./ente-impl";
|
||||
import type {
|
||||
BytesOrB64,
|
||||
DecryptBlobB64,
|
||||
EncryptedBlob_2,
|
||||
EncryptedBox2,
|
||||
EncryptJSON,
|
||||
@ -202,7 +201,11 @@ export const decryptMetadataJSON_New = (
|
||||
/**
|
||||
* Deprecated, retains the old API.
|
||||
*/
|
||||
export const decryptMetadataJSON = (r: DecryptBlobB64) =>
|
||||
export const decryptMetadataJSON = (r: {
|
||||
encryptedDataB64: string;
|
||||
decryptionHeaderB64: string;
|
||||
keyB64: string;
|
||||
}) =>
|
||||
inWorker()
|
||||
? ei._decryptMetadataJSON(r)
|
||||
: sharedCryptoWorker().then((w) => w.decryptMetadataJSON(r));
|
||||
|
@ -4,7 +4,6 @@
|
||||
*/
|
||||
export type BytesOrB64 = Uint8Array | string;
|
||||
|
||||
|
||||
/**
|
||||
* Deprecated.
|
||||
*
|
||||
@ -125,28 +124,3 @@ export interface EncryptedBlobB64_2 {
|
||||
*/
|
||||
decryptionHeader: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated.
|
||||
*
|
||||
* A variant of {@link DecryptBlobBytes} with the encrypted Blob's data as a
|
||||
* base64 encoded string.
|
||||
*/
|
||||
export interface DecryptBlobB64 {
|
||||
/**
|
||||
* A base64 string containing the data to decrypt.
|
||||
*/
|
||||
encryptedDataB64: string;
|
||||
/**
|
||||
* A base64 string containing the decryption header that was produced during
|
||||
* encryption.
|
||||
*
|
||||
* The header contains a random nonce and other libsodium metadata. It does
|
||||
* not need to be kept secret.
|
||||
*/
|
||||
decryptionHeaderB64: string;
|
||||
/**
|
||||
* A base64 string containing the encryption key.
|
||||
*/
|
||||
keyB64: string;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user