Skip to content

Commit

Permalink
adds performance section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
seanwatters committed Feb 7, 2024
1 parent e29c3c5 commit bfb7390
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,27 @@ assert_eq!(decrypted_content, content);
- Generate **shared secret** with **recipient public key** and **ephemeral private key**
- Encrypt **one-time content key** with **shared secret**

## Performance

For the 8mb example with 20,000 recipients, on my M1 MacBook Pro

| Operation | Time |
| --------- | --------- |
| encrypt | 101.76 ms |
| extract | 486.00 µs |
| decrypt | 44.729 ms |

Doing the equivalent operation for just 1 recipient on 8mb is

| Operation | Time |
| --------- | --------- |
| encrypt | 61.537 ms |
| decrypt | 44.729 ms |

The signing operation (internal to the `encrypt` function) and verifying operation (internal to the `decrypt` function), take 28.469 ms and 14.209 ms when benchmarked in isolation.

NOTE: the content signing/encryption logic is done in a separate thread from the per-recipient **content key** encryption, and the **content key** encryption work is done in a rayon `par_chunks_mut` loop, so the number of threads does have an impact on performance.

## Ciphersuite

- ChaCha20Poly1305 for content
Expand Down

0 comments on commit bfb7390

Please sign in to comment.