-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c27898a
commit 4aadabf
Showing
6 changed files
with
434 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
service/src/main/java/org/whispersystems/textsecuregcm/backup/CopyParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2024 Signal Messenger, LLC | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
package org.whispersystems.textsecuregcm.backup; | ||
|
||
/** | ||
* Descriptor for a single copy-and-encrypt operation | ||
* | ||
* @param sourceCdn The cdn of the object to copy | ||
* @param sourceKey The mediaId within the cdn of the object to copy | ||
* @param sourceLength The length of the object to copy | ||
* @param encryptionParameters Encryption parameters to double encrypt the object | ||
* @param destinationMediaId The mediaId of the destination object | ||
*/ | ||
public record CopyParameters( | ||
int sourceCdn, | ||
String sourceKey, | ||
int sourceLength, | ||
MediaEncryptionParameters encryptionParameters, | ||
byte[] destinationMediaId) { | ||
|
||
/** | ||
* @return The size of the double-encrypted destination object after it is copied | ||
*/ | ||
long destinationObjectSize() { | ||
return encryptionParameters().outputSize(sourceLength()); | ||
} | ||
} |
Oops, something went wrong.