This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Commit e27ad91
Add HPKE extension
This will be useful for PIV encryption, working together with
trussed-dev/trussed-auth#41
This implements the standard HPKE from
[RFC 9180](https://www.rfc-editor.org/rfc/rfc9180.html). This uses a
custom implmentation instead of the `hpke` crate because this crate
seals the trait to implement custom ciphers, and we want to use
`ChaCha8` and not `ChaCha20`.
The implementation is tested against the RFC test vectors for
`ChaCha20`, and is made generic so that the same code can be used for
`ChaCha8` in the backend.
For ChaCha8Poly1305 AEAD ID, I used a custom `0xFFFE`, which is probably
unused. I need to look if there is somewhere someone already using
ChaCha8Poly1305 for HPKE and if there is a specified ID.1 parent 72b0820 commit e27ad91
File tree
7 files changed
+1253
-4
lines changed- extensions/hpke
- src
- src
- tests
7 files changed
+1253
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
| |||
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
45 | 57 | | |
46 | | - | |
| 58 | + | |
47 | 59 | | |
48 | 60 | | |
49 | 61 | | |
| |||
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
| 67 | + | |
55 | 68 | | |
56 | | - | |
| 69 | + | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
| |||
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
71 | | - | |
| 84 | + | |
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| 89 | + | |
76 | 90 | | |
77 | 91 | | |
78 | 92 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments