Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
soledad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
soledad
Commits
b7ed3cbb
Verified
Commit
b7ed3cbb
authored
Dec 14, 2017
by
Victor
Browse files
Options
Downloads
Patches
Plain Diff
[feature] get_unarmored_ciphertext_size on client
parent
fcdcd596
Branches
Branches containing commit
No related tags found
1 merge request
!172
Upstreaming blobs
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/leap/soledad/client/_crypto.py
+10
-0
10 additions, 0 deletions
src/leap/soledad/client/_crypto.py
with
10 additions
and
0 deletions
src/leap/soledad/client/_crypto.py
+
10
−
0
View file @
b7ed3cbb
...
...
@@ -538,3 +538,13 @@ def _ceiling(size):
step
=
2
**
i
if
size
<
step
:
return
step
def
get_unarmored_ciphertext_size
(
cleartext_size
):
# used for blobs stream up (so we can tell the server how much data we are
# sending before starting to encrypt the stream)
PREAMBLE_SIZE
=
736
# 552 urlsafe base64 encoded (it's always armored)
TAG_SIZE
=
16
SEPARATOR_SIZE
=
1
size
=
TAG_SIZE
+
PREAMBLE_SIZE
+
SEPARATOR_SIZE
return
cleartext_size
+
size
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment