Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Olm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
Olm
Commits
173339ae
Commit
173339ae
authored
6 years ago
by
Hubert Chathi
Browse files
Options
Downloads
Patches
Plain Diff
add more comments describing the pk encrypt/decrypt functions
parent
bad14db8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/olm/pk.h
+14
-9
14 additions, 9 deletions
include/olm/pk.h
with
14 additions
and
9 deletions
include/olm/pk.h
+
14
−
9
View file @
173339ae
...
...
@@ -72,11 +72,15 @@ size_t olm_pk_encrypt_random_length(
);
/** Encrypt a plaintext for the recipient set using
* olm_pk_encryption_set_recipient_key. Returns olm_error() on failure. If the
* ciphertext, mac, or ephemeral_key buffers were too small then
* olm_pk_encryption_last_error() will be "OUTPUT_BUFFER_TOO_SMALL". If there
* weren't enough random bytes then olm_pk_encryption_last_error() will be
* "NOT_ENOUGH_RANDOM". */
* olm_pk_encryption_set_recipient_key. Writes to the ciphertext, mac, and
* ephemeral_key buffers, whose values should be sent to the recipient. mac is
* a Message Authentication Code to ensure that the data is received and
* decrypted properly. ephemeral_key is the public part of the ephemeral key
* used (together with the recipient's key) to generate a symmetric encryption
* key. Returns olm_error() on failure. If the ciphertext, mac, or
* ephemeral_key buffers were too small then olm_pk_encryption_last_error()
* will be "OUTPUT_BUFFER_TOO_SMALL". If there weren't enough random bytes then
* olm_pk_encryption_last_error() will be "NOT_ENOUGH_RANDOM". */
size_t
olm_pk_encrypt
(
OlmPkEncryption
*
encryption
,
void
const
*
plaintext
,
size_t
plaintext_length
,
...
...
@@ -160,10 +164,11 @@ size_t olm_pk_max_plaintext_length(
size_t
ciphertext_length
);
/** Decrypt a ciphertext. The input ciphertext buffer is destroyed. Returns
* the length of the plaintext on success. Returns olm_error() on failure. If
* the plaintext buffer is too small then olm_pk_encryption_last_error() will
* be "OUTPUT_BUFFER_TOO_SMALL". */
/** Decrypt a ciphertext. The input ciphertext buffer is destroyed. See the
* olm_pk_encrypt function for descriptions of the ephemeral_key and mac
* arguments. Returns the length of the plaintext on success. Returns
* olm_error() on failure. If the plaintext buffer is too small then
* olm_pk_encryption_last_error() will be "OUTPUT_BUFFER_TOO_SMALL". */
size_t
olm_pk_decrypt
(
OlmPkDecryption
*
decryption
,
void
const
*
ephemeral_key
,
size_t
ephemeral_key_length
,
...
...
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