Debian Codegraph @

rfc9180.html

raw
1 <!DOCTYPE html>
2 <html lang="en" class="RFC">
3 <head>
4 <meta charset="utf-8">
5 <meta content="Common,Latin" name="scripts">
6 <meta content="initial-scale=1.0" name="viewport">
7 <title>RFC 9180: Hybrid Public Key Encryption</title>
8 <meta content="Richard L. Barnes" name="author">
9 <meta content="Karthik Bhargavan" name="author">
10 <meta content="Benjamin Lipp" name="author">
11 <meta content="Christopher A. Wood" name="author">
12 <meta content="
13 This document describes a scheme for hybrid public key encryption (HPKE).
14 This scheme provides a variant of public key encryption of arbitrary-sized
15 plaintexts for a recipient public key. It also includes three authenticated
16 variants, including one that authenticates possession of a pre-shared key
17 and two optional ones that authenticate possession of a key encapsulation
18 mechanism (KEM) private key. HPKE works for any combination of an asymmetric
19 KEM, key derivation function (KDF), and authenticated encryption with
20 additional data (AEAD) encryption function. Some authenticated variants may not
21 be supported by all KEMs. We provide instantiations of the scheme using widely
22 used and efficient primitives, such as Elliptic Curve Diffie-Hellman (ECDH) key
23 agreement, HMAC-based key derivation function (HKDF), and SHA2.
24 This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF.
25 " name="description">
26 <meta content="xml2rfc 3.12.2" name="generator">
27 <meta content="public key encryption" name="keyword">
28 <meta content="key encapsulation" name="keyword">
29 <meta content="post-quantum public key encryption" name="keyword">
30 <meta content="9180" name="rfc.number">
31 <!-- Generator version information:
32 xml2rfc 3.12.2
33 Python 3.6.15
34 appdirs 1.4.4
35 ConfigArgParse 1.4.1
36 google-i18n-address 2.4.0
37 html5lib 1.0.1
38 intervaltree 3.0.2
39 Jinja2 2.11.3
40 kitchen 1.2.6
41 lxml 4.4.2
42 pycairo 1.15.1
43 pycountry 19.8.18
44 pyflakes 2.1.1
45 PyYAML 5.4.1
46 requests 2.24.0
47 setuptools 40.5.0
48 six 1.14.0
49 WeasyPrint 52.5
50 -->
51 <link href="rfc9180.xml" rel="alternate" type="application/rfc+xml">
52 <link href="#copyright" rel="license">
53 <style type="text/css">/*
54
55 NOTE: Changes at the bottom of this file overrides some earlier settings.
56
57 Once the style has stabilized and has been adopted as an official RFC style,
58 this can be consolidated so that style settings occur only in one place, but
59 for now the contents of this file consists first of the initial CSS work as
60 provided to the RFC Formatter (xml2rfc) work, followed by itemized and
61 commented changes found necssary during the development of the v3
62 formatters.
63
64 */
65
66 /* fonts */
67 @import url('https://fonts.googleapis.com/css?family=Noto+Sans'); /* Sans-serif */
68 @import url('https://fonts.googleapis.com/css?family=Noto+Serif'); /* Serif (print) */
69 @import url('https://fonts.googleapis.com/css?family=Roboto+Mono'); /* Monospace */
70
71 @viewport {
72 zoom: 1.0;
73 width: extend-to-zoom;
74 }
75 @-ms-viewport {
76 width: extend-to-zoom;
77 zoom: 1.0;
78 }
79 /* general and mobile first */
80 html {
81 }
82 body {
83 max-width: 90%;
84 margin: 1.5em auto;
85 color: #222;
86 background-color: #fff;
87 font-size: 14px;
88 font-family: 'Noto Sans', Arial, Helvetica, sans-serif;
89 line-height: 1.6;
90 scroll-behavior: smooth;
91 }
92 .ears {
93 display: none;
94 }
95
96 /* headings */
97 #title, h1, h2, h3, h4, h5, h6 {
98 margin: 1em 0 0.5em;
99 font-weight: bold;
100 line-height: 1.3;
101 }
102 #title {
103 clear: both;
104 border-bottom: 1px solid #ddd;
105 margin: 0 0 0.5em 0;
106 padding: 1em 0 0.5em;
107 }
108 .author {
109 padding-bottom: 4px;
110 }
111 h1 {
112 font-size: 26px;
113 margin: 1em 0;
114 }
115 h2 {
116 font-size: 22px;
117 margin-top: -20px; /* provide offset for in-page anchors */
118 padding-top: 33px;
119 }
120 h3 {
121 font-size: 18px;
122 margin-top: -36px; /* provide offset for in-page anchors */
123 padding-top: 42px;
124 }
125 h4 {
126 font-size: 16px;
127 margin-top: -36px; /* provide offset for in-page anchors */
128 padding-top: 42px;
129 }
130 h5, h6 {
131 font-size: 14px;
132 }
133 #n-copyright-notice {
134 border-bottom: 1px solid #ddd;
135 padding-bottom: 1em;
136 margin-bottom: 1em;
137 }
138 /* general structure */
139 p {
140 padding: 0;
141 margin: 0 0 1em 0;
142 text-align: left;
143 }
144 div, span {
145 position: relative;
146 }
147 div {
148 margin: 0;
149 }
150 .alignRight.art-text {
151 background-color: #f9f9f9;
152 border: 1px solid #eee;
153 border-radius: 3px;
154 padding: 1em 1em 0;
155 margin-bottom: 1.5em;
156 }
157 .alignRight.art-text pre {
158 padding: 0;
159 }
160 .alignRight {
161 margin: 1em 0;
162 }
163 .alignRight > *:first-child {
164 border: none;
165 margin: 0;
166 float: right;
167 clear: both;
168 }
169 .alignRight > *:nth-child(2) {
170 clear: both;
171 display: block;
172 border: none;
173 }
174 svg {
175 display: block;
176 }
177 .alignCenter.art-text {
178 background-color: #f9f9f9;
179 border: 1px solid #eee;
180 border-radius: 3px;
181 padding: 1em 1em 0;
182 margin-bottom: 1.5em;
183 }
184 .alignCenter.art-text pre {
185 padding: 0;
186 }
187 .alignCenter {
188 margin: 1em 0;
189 }
190 .alignCenter > *:first-child {
191 border: none;
192 /* this isn't optimal, but it's an existence proof. PrinceXML doesn't
193 support flexbox yet.
194 */
195 display: table;
196 margin: 0 auto;
197 }
198
199 /* lists */
200 ol, ul {
201 padding: 0;
202 margin: 0 0 1em 2em;
203 }
204 ol ol, ul ul, ol ul, ul ol {
205 margin-left: 1em;
206 }
207 li {
208 margin: 0 0 0.25em 0;
209 }
210 .ulCompact li {
211 margin: 0;
212 }
213 ul.empty, .ulEmpty {
214 list-style-type: none;
215 }
216 ul.empty li, .ulEmpty li {
217 margin-top: 0.5em;
218 }
219 ul.ulBare, li.ulBare {
220 margin-left: 0em !important;
221 }
222 ul.compact, .ulCompact,
223 ol.compact, .olCompact {
224 line-height: 100%;
225 margin: 0 0 0 2em;
226 }
227
228 /* definition lists */
229 dl {
230 }
231 dl > dt {
232 float: left;
233 margin-right: 1em;
234 }
235 /*
236 dl.nohang > dt {
237 float: none;
238 }
239 */
240 dl > dd {
241 margin-bottom: .8em;
242 min-height: 1.3em;
243 }
244 dl.compact > dd, .dlCompact > dd {
245 margin-bottom: 0em;
246 }
247 dl > dd > dl {
248 margin-top: 0.5em;
249 margin-bottom: 0em;
250 }
251
252 /* links */
253 a {
254 text-decoration: none;
255 }
256 a[href] {
257 color: #22e; /* Arlen: WCAG 2019 */
258 }
259 a[href]:hover {
260 background-color: #f2f2f2;
261 }
262 figcaption a[href],
263 a[href].selfRef {
264 color: #222;
265 }
266 /* XXX probably not this:
267 a.selfRef:hover {
268 background-color: transparent;
269 cursor: default;
270 } */
271
272 /* Figures */
273 tt, code, pre, code {
274 background-color: #f9f9f9;
275 font-family: 'Roboto Mono', monospace;
276 }
277 pre {
278 border: 1px solid #eee;
279 margin: 0;
280 padding: 1em;
281 }
282 img {
283 max-width: 100%;
284 }
285 figure {
286 margin: 0;
287 }
288 figure blockquote {
289 margin: 0.8em 0.4em 0.4em;
290 }
291 figcaption {
292 font-style: italic;
293 margin: 0 0 1em 0;
294 }
295 @media screen {
296 pre {
297 overflow-x: auto;
298 max-width: 100%;
299 max-width: calc(100% - 22px);
300 }
301 }
302
303 /* aside, blockquote */
304 aside, blockquote {
305 margin-left: 0;
306 padding: 1.2em 2em;
307 }
308 blockquote {
309 background-color: #f9f9f9;
310 color: #111; /* Arlen: WCAG 2019 */
311 border: 1px solid #ddd;
312 border-radius: 3px;
313 margin: 1em 0;
314 }
315 cite {
316 display: block;
317 text-align: right;
318 font-style: italic;
319 }
320
321 /* tables */
322 table {
323 width: 100%;
324 margin: 0 0 1em;
325 border-collapse: collapse;
326 border: 1px solid #eee;
327 }
328 th, td {
329 text-align: left;
330 vertical-align: top;
331 padding: 0.5em 0.75em;
332 }
333 th {
334 text-align: left;
335 background-color: #e9e9e9;
336 }
337 tr:nth-child(2n+1) > td {
338 background-color: #f5f5f5;
339 }
340 table caption {
341 font-style: italic;
342 margin: 0;
343 padding: 0;
344 text-align: left;
345 }
346 table p {
347 /* XXX to avoid bottom margin on table row signifiers. If paragraphs should
348 be allowed within tables more generally, it would be far better to select on a class. */
349 margin: 0;
350 }
351
352 /* pilcrow */
353 a.pilcrow {
354 color: #666; /* Arlen: AHDJ 2019 */
355 text-decoration: none;
356 visibility: hidden;
357 user-select: none;
358 -ms-user-select: none;
359 -o-user-select:none;
360 -moz-user-select: none;
361 -khtml-user-select: none;
362 -webkit-user-select: none;
363 -webkit-touch-callout: none;
364 }
365 @media screen {
366 aside:hover > a.pilcrow,
367 p:hover > a.pilcrow,
368 blockquote:hover > a.pilcrow,
369 div:hover > a.pilcrow,
370 li:hover > a.pilcrow,
371 pre:hover > a.pilcrow {
372 visibility: visible;
373 }
374 a.pilcrow:hover {
375 background-color: transparent;
376 }
377 }
378
379 /* misc */
380 hr {
381 border: 0;
382 border-top: 1px solid #eee;
383 }
384 .bcp14 {
385 font-variant: small-caps;
386 }
387
388 .role {
389 font-variant: all-small-caps;
390 }
391
392 /* info block */
393 #identifiers {
394 margin: 0;
395 font-size: 0.9em;
396 }
397 #identifiers dt {
398 width: 3em;
399 clear: left;
400 }
401 #identifiers dd {
402 float: left;
403 margin-bottom: 0;
404 }
405 /* Fix PDF info block run off issue */
406 @media print {
407 #identifiers dd {
408 float: none;
409 }
410 }
411 #identifiers .authors .author {
412 display: inline-block;
413 margin-right: 1.5em;
414 }
415 #identifiers .authors .org {
416 font-style: italic;
417 }
418
419 /* The prepared/rendered info at the very bottom of the page */
420 .docInfo {
421 color: #666; /* Arlen: WCAG 2019 */
422 font-size: 0.9em;
423 font-style: italic;
424 margin-top: 2em;
425 }
426 .docInfo .prepared {
427 float: left;
428 }
429 .docInfo .prepared {
430 float: right;
431 }
432
433 /* table of contents */
434 #toc {
435 padding: 0.75em 0 2em 0;
436 margin-bottom: 1em;
437 }
438 nav.toc ul {
439 margin: 0 0.5em 0 0;
440 padding: 0;
441 list-style: none;
442 }
443 nav.toc li {
444 line-height: 1.3em;
445 margin: 0.75em 0;
446 padding-left: 1.2em;
447 text-indent: -1.2em;
448 }
449 /* references */
450 .references dt {
451 text-align: right;
452 font-weight: bold;
453 min-width: 7em;
454 }
455 .references dd {
456 margin-left: 8em;
457 overflow: auto;
458 }
459
460 .refInstance {
461 margin-bottom: 1.25em;
462 }
463
464 .references .ascii {
465 margin-bottom: 0.25em;
466 }
467
468 /* index */
469 .index ul {
470 margin: 0 0 0 1em;
471 padding: 0;
472 list-style: none;
473 }
474 .index ul ul {
475 margin: 0;
476 }
477 .index li {
478 margin: 0;
479 text-indent: -2em;
480 padding-left: 2em;
481 padding-bottom: 5px;
482 }
483 .indexIndex {
484 margin: 0.5em 0 1em;
485 }
486 .index a {
487 font-weight: 700;
488 }
489 /* make the index two-column on all but the smallest screens */
490 @media (min-width: 600px) {
491 .index ul {
492 -moz-column-count: 2;
493 -moz-column-gap: 20px;
494 }
495 .index ul ul {
496 -moz-column-count: 1;
497 -moz-column-gap: 0;
498 }
499 }
500
501 /* authors */
502 address.vcard {
503 font-style: normal;
504 margin: 1em 0;
505 }
506
507 address.vcard .nameRole {
508 font-weight: 700;
509 margin-left: 0;
510 }
511 address.vcard .label {
512 font-family: "Noto Sans",Arial,Helvetica,sans-serif;
513 margin: 0.5em 0;
514 }
515 address.vcard .type {
516 display: none;
517 }
518 .alternative-contact {
519 margin: 1.5em 0 1em;
520 }
521 hr.addr {
522 border-top: 1px dashed;
523 margin: 0;
524 color: #ddd;
525 max-width: calc(100% - 16px);
526 }
527
528 /* temporary notes */
529 .rfcEditorRemove::before {
530 position: absolute;
531 top: 0.2em;
532 right: 0.2em;
533 padding: 0.2em;
534 content: "The RFC Editor will remove this note";
535 color: #9e2a00; /* Arlen: WCAG 2019 */
536 background-color: #ffd; /* Arlen: WCAG 2019 */
537 }
538 .rfcEditorRemove {
539 position: relative;
540 padding-top: 1.8em;
541 background-color: #ffd; /* Arlen: WCAG 2019 */
542 border-radius: 3px;
543 }
544 .cref {
545 background-color: #ffd; /* Arlen: WCAG 2019 */
546 padding: 2px 4px;
547 }
548 .crefSource {
549 font-style: italic;
550 }
551 /* alternative layout for smaller screens */
552 @media screen and (max-width: 1023px) {
553 body {
554 padding-top: 2em;
555 }
556 #title {
557 padding: 1em 0;
558 }
559 h1 {
560 font-size: 24px;
561 }
562 h2 {
563 font-size: 20px;
564 margin-top: -18px; /* provide offset for in-page anchors */
565 padding-top: 38px;
566 }
567 #identifiers dd {
568 max-width: 60%;
569 }
570 #toc {
571 position: fixed;
572 z-index: 2;
573 top: 0;
574 right: 0;
575 padding: 0;
576 margin: 0;
577 background-color: inherit;
578 border-bottom: 1px solid #ccc;
579 }
580 #toc h2 {
581 margin: -1px 0 0 0;
582 padding: 4px 0 4px 6px;
583 padding-right: 1em;
584 min-width: 190px;
585 font-size: 1.1em;
586 text-align: right;
587 background-color: #444;
588 color: white;
589 cursor: pointer;
590 }
591 #toc h2::before { /* css hamburger */
592 float: right;
593 position: relative;
594 width: 1em;
595 height: 1px;
596 left: -164px;
597 margin: 6px 0 0 0;
598 background: white none repeat scroll 0 0;
599 box-shadow: 0 4px 0 0 white, 0 8px 0 0 white;
600 content: "";
601 }
602 #toc nav {
603 display: none;
604 padding: 0.5em 1em 1em;
605 overflow: auto;
606 height: calc(100vh - 48px);
607 border-left: 1px solid #ddd;
608 }
609 }
610
611 /* alternative layout for wide screens */
612 @media screen and (min-width: 1024px) {
613 body {
614 max-width: 724px;
615 margin: 42px auto;
616 padding-left: 1.5em;
617 padding-right: 29em;
618 }
619 #toc {
620 position: fixed;
621 top: 42px;
622 right: 42px;
623 width: 25%;
624 margin: 0;
625 padding: 0 1em;
626 z-index: 1;
627 }
628 #toc h2 {
629 border-top: none;
630 border-bottom: 1px solid #ddd;
631 font-size: 1em;
632 font-weight: normal;
633 margin: 0;
634 padding: 0.25em 1em 1em 0;
635 }
636 #toc nav {
637 display: block;
638 height: calc(90vh - 84px);
639 bottom: 0;
640 padding: 0.5em 0 0;
641 overflow: auto;
642 }
643 img { /* future proofing */
644 max-width: 100%;
645 height: auto;
646 }
647 }
648
649 /* pagination */
650 @media print {
651 body {
652
653 width: 100%;
654 }
655 p {
656 orphans: 3;
657 widows: 3;
658 }
659 #n-copyright-notice {
660 border-bottom: none;
661 }
662 #toc, #n-introduction {
663 page-break-before: always;
664 }
665 #toc {
666 border-top: none;
667 padding-top: 0;
668 }
669 figure, pre {
670 page-break-inside: avoid;
671 }
672 figure {
673 overflow: scroll;
674 }
675 h1, h2, h3, h4, h5, h6 {
676 page-break-after: avoid;
677 }
678 h2+*, h3+*, h4+*, h5+*, h6+* {
679 page-break-before: avoid;
680 }
681 pre {
682 white-space: pre-wrap;
683 word-wrap: break-word;
684 font-size: 10pt;
685 }
686 table {
687 border: 1px solid #ddd;
688 }
689 td {
690 border-top: 1px solid #ddd;
691 }
692 }
693
694 /* This is commented out here, as the string-set: doesn't
695 pass W3C validation currently */
696 /*
697 .ears thead .left {
698 string-set: ears-top-left content();
699 }
700
701 .ears thead .center {
702 string-set: ears-top-center content();
703 }
704
705 .ears thead .right {
706 string-set: ears-top-right content();
707 }
708
709 .ears tfoot .left {
710 string-set: ears-bottom-left content();
711 }
712
713 .ears tfoot .center {
714 string-set: ears-bottom-center content();
715 }
716
717 .ears tfoot .right {
718 string-set: ears-bottom-right content();
719 }
720 */
721
722 @page :first {
723 padding-top: 0;
724 @top-left {
725 content: normal;
726 border: none;
727 }
728 @top-center {
729 content: normal;
730 border: none;
731 }
732 @top-right {
733 content: normal;
734 border: none;
735 }
736 }
737
738 @page {
739 size: A4;
740 margin-bottom: 45mm;
741 padding-top: 20px;
742 /* The follwing is commented out here, but set appropriately by in code, as
743 the content depends on the document */
744 /*
745 @top-left {
746 content: 'Internet-Draft';
747 vertical-align: bottom;
748 border-bottom: solid 1px #ccc;
749 }
750 @top-left {
751 content: string(ears-top-left);
752 vertical-align: bottom;
753 border-bottom: solid 1px #ccc;
754 }
755 @top-center {
756 content: string(ears-top-center);
757 vertical-align: bottom;
758 border-bottom: solid 1px #ccc;
759 }
760 @top-right {
761 content: string(ears-top-right);
762 vertical-align: bottom;
763 border-bottom: solid 1px #ccc;
764 }
765 @bottom-left {
766 content: string(ears-bottom-left);
767 vertical-align: top;
768 border-top: solid 1px #ccc;
769 }
770 @bottom-center {
771 content: string(ears-bottom-center);
772 vertical-align: top;
773 border-top: solid 1px #ccc;
774 }
775 @bottom-right {
776 content: '[Page ' counter(page) ']';
777 vertical-align: top;
778 border-top: solid 1px #ccc;
779 }
780 */
781
782 }
783
784 /* Changes introduced to fix issues found during implementation */
785 /* Make sure links are clickable even if overlapped by following H* */
786 a {
787 z-index: 2;
788 }
789 /* Separate body from document info even without intervening H1 */
790 section {
791 clear: both;
792 }
793
794
795 /* Top align author divs, to avoid names without organization dropping level with org names */
796 .author {
797 vertical-align: top;
798 }
799
800 /* Leave room in document info to show Internet-Draft on one line */
801 #identifiers dt {
802 width: 8em;
803 }
804
805 /* Don't waste quite as much whitespace between label and value in doc info */
806 #identifiers dd {
807 margin-left: 1em;
808 }
809
810 /* Give floating toc a background color (needed when it's a div inside section */
811 #toc {
812 background-color: white;
813 }
814
815 /* Make the collapsed ToC header render white on gray also when it's a link */
816 @media screen and (max-width: 1023px) {
817 #toc h2 a,
818 #toc h2 a:link,
819 #toc h2 a:focus,
820 #toc h2 a:hover,
821 #toc a.toplink,
822 #toc a.toplink:hover {
823 color: white;
824 background-color: #444;
825 text-decoration: none;
826 }
827 }
828
829 /* Give the bottom of the ToC some whitespace */
830 @media screen and (min-width: 1024px) {
831 #toc {
832 padding: 0 0 1em 1em;
833 }
834 }
835
836 /* Style section numbers with more space between number and title */
837 .section-number {
838 padding-right: 0.5em;
839 }
840
841 /* prevent monospace from becoming overly large */
842 tt, code, pre, code {
843 font-size: 95%;
844 }
845
846 /* Fix the height/width aspect for ascii art*/
847 pre.sourcecode,
848 .art-text pre {
849 line-height: 1.12;
850 }
851
852
853 /* Add styling for a link in the ToC that points to the top of the document */
854 a.toplink {
855 float: right;
856 margin-right: 0.5em;
857 }
858
859 /* Fix the dl styling to match the RFC 7992 attributes */
860 dl > dt,
861 dl.dlParallel > dt {
862 float: left;
863 margin-right: 1em;
864 }
865 dl.dlNewline > dt {
866 float: none;
867 }
868
869 /* Provide styling for table cell text alignment */
870 table td.text-left,
871 table th.text-left {
872 text-align: left;
873 }
874 table td.text-center,
875 table th.text-center {
876 text-align: center;
877 }
878 table td.text-right,
879 table th.text-right {
880 text-align: right;
881 }
882
883 /* Make the alternative author contact informatio look less like just another
884 author, and group it closer with the primary author contact information */
885 .alternative-contact {
886 margin: 0.5em 0 0.25em 0;
887 }
888 address .non-ascii {
889 margin: 0 0 0 2em;
890 }
891
892 /* With it being possible to set tables with alignment
893 left, center, and right, { width: 100%; } does not make sense */
894 table {
895 width: auto;
896 }
897
898 /* Avoid reference text that sits in a block with very wide left margin,
899 because of a long floating dt label.*/
900 .references dd {
901 overflow: visible;
902 }
903
904 /* Control caption placement */
905 caption {
906 caption-side: bottom;
907 }
908
909 /* Limit the width of the author address vcard, so names in right-to-left
910 script don't end up on the other side of the page. */
911
912 address.vcard {
913 max-width: 30em;
914 margin-right: auto;
915 }
916
917 /* For address alignment dependent on LTR or RTL scripts */
918 address div.left {
919 text-align: left;
920 }
921 address div.right {
922 text-align: right;
923 }
924
925 /* Provide table alignment support. We can't use the alignX classes above
926 since they do unwanted things with caption and other styling. */
927 table.right {
928 margin-left: auto;
929 margin-right: 0;
930 }
931 table.center {
932 margin-left: auto;
933 margin-right: auto;
934 }
935 table.left {
936 margin-left: 0;
937 margin-right: auto;
938 }
939
940 /* Give the table caption label the same styling as the figcaption */
941 caption a[href] {
942 color: #222;
943 }
944
945 @media print {
946 .toplink {
947 display: none;
948 }
949
950 /* avoid overwriting the top border line with the ToC header */
951 #toc {
952 padding-top: 1px;
953 }
954
955 /* Avoid page breaks inside dl and author address entries */
956 .vcard {
957 page-break-inside: avoid;
958 }
959
960 }
961 /* Tweak the bcp14 keyword presentation */
962 .bcp14 {
963 font-variant: small-caps;
964 font-weight: bold;
965 font-size: 0.9em;
966 }
967 /* Tweak the invisible space above H* in order not to overlay links in text above */
968 h2 {
969 margin-top: -18px; /* provide offset for in-page anchors */
970 padding-top: 31px;
971 }
972 h3 {
973 margin-top: -18px; /* provide offset for in-page anchors */
974 padding-top: 24px;
975 }
976 h4 {
977 margin-top: -18px; /* provide offset for in-page anchors */
978 padding-top: 24px;
979 }
980 /* Float artwork pilcrow to the right */
981 @media screen {
982 .artwork a.pilcrow {
983 display: block;
984 line-height: 0.7;
985 margin-top: 0.15em;
986 }
987 }
988 /* Make pilcrows on dd visible */
989 @media screen {
990 dd:hover > a.pilcrow {
991 visibility: visible;
992 }
993 }
994 /* Make the placement of figcaption match that of a table's caption
995 by removing the figure's added bottom margin */
996 .alignLeft.art-text,
997 .alignCenter.art-text,
998 .alignRight.art-text {
999 margin-bottom: 0;
1000 }
1001 .alignLeft,
1002 .alignCenter,
1003 .alignRight {
1004 margin: 1em 0 0 0;
1005 }
1006 /* In print, the pilcrow won't show on hover, so prevent it from taking up space,
1007 possibly even requiring a new line */
1008 @media print {
1009 a.pilcrow {
1010 display: none;
1011 }
1012 }
1013 /* Styling for the external metadata */
1014 div#external-metadata {
1015 background-color: #eee;
1016 padding: 0.5em;
1017 margin-bottom: 0.5em;
1018 display: none;
1019 }
1020 div#internal-metadata {
1021 padding: 0.5em; /* to match the external-metadata padding */
1022 }
1023 /* Styling for title RFC Number */
1024 h1#rfcnum {
1025 clear: both;
1026 margin: 0 0 -1em;
1027 padding: 1em 0 0 0;
1028 }
1029 /* Make .olPercent look the same as <ol><li> */
1030 dl.olPercent > dd {
1031 margin-bottom: 0.25em;
1032 min-height: initial;
1033 }
1034 /* Give aside some styling to set it apart */
1035 aside {
1036 border-left: 1px solid #ddd;
1037 margin: 1em 0 1em 2em;
1038 padding: 0.2em 2em;
1039 }
1040 aside > dl,
1041 aside > ol,
1042 aside > ul,
1043 aside > table,
1044 aside > p {
1045 margin-bottom: 0.5em;
1046 }
1047 /* Additional page break settings */
1048 @media print {
1049 figcaption, table caption {
1050 page-break-before: avoid;
1051 }
1052 }
1053 /* Font size adjustments for print */
1054 @media print {
1055 body { font-size: 10pt; line-height: normal; max-width: 96%; }
1056 h1 { font-size: 1.72em; padding-top: 1.5em; } /* 1*1.2*1.2*1.2 */
1057 h2 { font-size: 1.44em; padding-top: 1.5em; } /* 1*1.2*1.2 */
1058 h3 { font-size: 1.2em; padding-top: 1.5em; } /* 1*1.2 */
1059 h4 { font-size: 1em; padding-top: 1.5em; }
1060 h5, h6 { font-size: 1em; margin: initial; padding: 0.5em 0 0.3em; }
1061 }
1062 /* Sourcecode margin in print, when there's no pilcrow */
1063 @media print {
1064 .artwork,
1065 .sourcecode {
1066 margin-bottom: 1em;
1067 }
1068 }
1069 /* Avoid narrow tables forcing too narrow table captions, which may render badly */
1070 table {
1071 min-width: 20em;
1072 }
1073 /* ol type a */
1074 ol.type-a { list-style-type: lower-alpha; }
1075 ol.type-A { list-style-type: upper-alpha; }
1076 ol.type-i { list-style-type: lower-roman; }
1077 ol.type-I { list-style-type: lower-roman; }
1078 /* Apply the print table and row borders in general, on request from the RPC,
1079 and increase the contrast between border and odd row background sligthtly */
1080 table {
1081 border: 1px solid #ddd;
1082 }
1083 td {
1084 border-top: 1px solid #ddd;
1085 }
1086 tr:nth-child(2n+1) > td {
1087 background-color: #f8f8f8;
1088 }
1089 /* Use style rules to govern display of the TOC. */
1090 @media screen and (max-width: 1023px) {
1091 #toc nav { display: none; }
1092 #toc.active nav { display: block; }
1093 }
1094 /* Add support for keepWithNext */
1095 .keepWithNext {
1096 break-after: avoid-page;
1097 break-after: avoid-page;
1098 }
1099 /* Add support for keepWithPrevious */
1100 .keepWithPrevious {
1101 break-before: avoid-page;
1102 }
1103 /* Change the approach to avoiding breaks inside artwork etc. */
1104 figure, pre, table, .artwork, .sourcecode {
1105 break-before: auto;
1106 break-after: auto;
1107 }
1108 /* Avoid breaks between <dt> and <dd> */
1109 dl {
1110 break-before: auto;
1111 break-inside: auto;
1112 }
1113 dt {
1114 break-before: auto;
1115 break-after: avoid-page;
1116 }
1117 dd {
1118 break-before: avoid-page;
1119 break-after: auto;
1120 orphans: 3;
1121 widows: 3
1122 }
1123 span.break, dd.break {
1124 margin-bottom: 0;
1125 min-height: 0;
1126 break-before: auto;
1127 break-inside: auto;
1128 break-after: auto;
1129 }
1130 /* Undo break-before ToC */
1131 @media print {
1132 #toc {
1133 break-before: auto;
1134 }
1135 }
1136 /* Text in compact lists should not get extra bottim margin space,
1137 since that would makes the list not compact */
1138 ul.compact p, .ulCompact p,
1139 ol.compact p, .olCompact p {
1140 margin: 0;
1141 }
1142 /* But the list as a whole needs the extra space at the end */
1143 section ul.compact,
1144 section .ulCompact,
1145 section ol.compact,
1146 section .olCompact {
1147 margin-bottom: 1em; /* same as p not within ul.compact etc. */
1148 }
1149 /* The tt and code background above interferes with for instance table cell
1150 backgrounds. Changed to something a bit more selective. */
1151 tt, code {
1152 background-color: transparent;
1153 }
1154 p tt, p code, li tt, li code {
1155 background-color: #f8f8f8;
1156 }
1157 /* Tweak the pre margin -- 0px doesn't come out well */
1158 pre {
1159 margin-top: 0.5px;
1160 }
1161 /* Tweak the comact list text */
1162 ul.compact, .ulCompact,
1163 ol.compact, .olCompact,
1164 dl.compact, .dlCompact {
1165 line-height: normal;
1166 }
1167 /* Don't add top margin for nested lists */
1168 li > ul, li > ol, li > dl,
1169 dd > ul, dd > ol, dd > dl,
1170 dl > dd > dl {
1171 margin-top: initial;
1172 }
1173 /* Elements that should not be rendered on the same line as a <dt> */
1174 /* This should match the element list in writer.text.TextWriter.render_dl() */
1175 dd > div.artwork:first-child,
1176 dd > aside:first-child,
1177 dd > figure:first-child,
1178 dd > ol:first-child,
1179 dd > div:first-child > pre.sourcecode,
1180 dd > table:first-child,
1181 dd > ul:first-child {
1182 clear: left;
1183 }
1184 /* fix for weird browser behaviour when <dd/> is empty */
1185 dt+dd:empty::before{
1186 content: "\00a0";
1187 }
1188 /* Make paragraph spacing inside <li> smaller than in body text, to fit better within the list */
1189 li > p {
1190 margin-bottom: 0.5em
1191 }
1192 /* Don't let p margin spill out from inside list items */
1193 li > p:last-of-type {
1194 margin-bottom: 0;
1195 }
1196 </style>
1197 <link href="rfc-local.css" rel="stylesheet" type="text/css">
1198 <link href="https://dx.doi.org/10.17487/rfc9180" rel="alternate">
1199 <link href="urn:issn:2070-1721" rel="alternate">
1200 <link href="https://datatracker.ietf.org/doc/draft-irtf-cfrg-hpke-12" rel="prev">
1201 </head>
1202 <body>
1203 <script src="https://www.rfc-editor.org/js/metadata.min.js"></script>
1204 <table class="ears">
1205 <thead><tr>
1206 <td class="left">RFC 9180</td>
1207 <td class="center">HPKE</td>
1208 <td class="right">February 2022</td>
1209 </tr></thead>
1210 <tfoot><tr>
1211 <td class="left">Barnes, et al.</td>
1212 <td class="center">Informational</td>
1213 <td class="right">[Page]</td>
1214 </tr></tfoot>
1215 </table>
1216 <div id="external-metadata" class="document-information"></div>
1217 <div id="internal-metadata" class="document-information">
1218 <dl id="identifiers">
1219 <dt class="label-stream">Stream:</dt>
1220 <dd class="stream">Internet Research Task Force (IRTF)</dd>
1221 <dt class="label-rfc">RFC:</dt>
1222 <dd class="rfc"><a href="https://www.rfc-editor.org/rfc/rfc9180" class="eref">9180</a></dd>
1223 <dt class="label-category">Category:</dt>
1224 <dd class="category">Informational</dd>
1225 <dt class="label-published">Published:</dt>
1226 <dd class="published">
1227 <time datetime="2022-02" class="published">February 2022</time>
1228 </dd>
1229 <dt class="label-issn">ISSN:</dt>
1230 <dd class="issn">2070-1721</dd>
1231 <dt class="label-authors">Authors:</dt>
1232 <dd class="authors">
1233 <div class="author">
1234 <div class="author-name">R. Barnes</div>
1235 <div class="org">Cisco</div>
1236 </div>
1237 <div class="author">
1238 <div class="author-name">K. Bhargavan</div>
1239 <div class="org">Inria</div>
1240 </div>
1241 <div class="author">
1242 <div class="author-name">B. Lipp</div>
1243 <div class="org">Inria</div>
1244 </div>
1245 <div class="author">
1246 <div class="author-name">C. Wood</div>
1247 <div class="org">Cloudflare</div>
1248 </div>
1249 </dd>
1250 </dl>
1251 </div>
1252 <h1 id="rfcnum">RFC 9180</h1>
1253 <h1 id="title">Hybrid Public Key Encryption</h1>
1254 <section id="section-abstract">
1255 <h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
1256 <p id="section-abstract-1">This document describes a scheme for hybrid public key encryption (HPKE).
1257 This scheme provides a variant of public key encryption of arbitrary-sized
1258 plaintexts for a recipient public key. It also includes three authenticated
1259 variants, including one that authenticates possession of a pre-shared key
1260 and two optional ones that authenticate possession of a key encapsulation
1261 mechanism (KEM) private key. HPKE works for any combination of an asymmetric
1262 KEM, key derivation function (KDF), and authenticated encryption with
1263 additional data (AEAD) encryption function. Some authenticated variants may not
1264 be supported by all KEMs. We provide instantiations of the scheme using widely
1265 used and efficient primitives, such as Elliptic Curve Diffie-Hellman (ECDH) key
1266 agreement, HMAC-based key derivation function (HKDF), and SHA2.<a href="#section-abstract-1" class="pilcrow">¶</a></p>
1267 <p id="section-abstract-2">This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF.<a href="#section-abstract-2" class="pilcrow">¶</a></p>
1268 </section>
1269 <div id="status-of-memo">
1270 <section id="section-boilerplate.1">
1271 <h2 id="name-status-of-this-memo">
1272 <a href="#name-status-of-this-memo" class="section-name selfRef">Status of This Memo</a>
1273 </h2>
1274 <p id="section-boilerplate.1-1">
1275 This document is not an Internet Standards Track specification; it is
1276 published for informational purposes.<a href="#section-boilerplate.1-1" class="pilcrow">¶</a></p>
1277 <p id="section-boilerplate.1-2">
1278 This document is a product of the Internet Research Task Force
1279 (IRTF). The IRTF publishes the results of Internet-related
1280 research and development activities. These results might not be
1281 suitable for deployment. This RFC represents the consensus of the Crypto Forum
1282 Research Group of the Internet Research Task Force (IRTF).
1283 Documents approved for publication by the IRSG are not
1284 candidates for any level of Internet Standard; see Section 2 of RFC
1285 7841.<a href="#section-boilerplate.1-2" class="pilcrow">¶</a></p>
1286 <p id="section-boilerplate.1-3">
1287 Information about the current status of this document, any
1288 errata, and how to provide feedback on it may be obtained at
1289 <span><a href="https://www.rfc-editor.org/info/rfc9180">https://www.rfc-editor.org/info/rfc9180</a></span>.<a href="#section-boilerplate.1-3" class="pilcrow">¶</a></p>
1290 </section>
1291 </div>
1292 <div id="copyright">
1293 <section id="section-boilerplate.2">
1294 <h2 id="name-copyright-notice">
1295 <a href="#name-copyright-notice" class="section-name selfRef">Copyright Notice</a>
1296 </h2>
1297 <p id="section-boilerplate.2-1">
1298 Copyright (c) 2022 IETF Trust and the persons identified as the
1299 document authors. All rights reserved.<a href="#section-boilerplate.2-1" class="pilcrow">¶</a></p>
1300 <p id="section-boilerplate.2-2">
1301 This document is subject to BCP 78 and the IETF Trust's Legal
1302 Provisions Relating to IETF Documents
1303 (<span><a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a></span>) in effect on the date of
1304 publication of this document. Please review these documents
1305 carefully, as they describe your rights and restrictions with
1306 respect to this document.<a href="#section-boilerplate.2-2" class="pilcrow">¶</a></p>
1307 </section>
1308 </div>
1309 <div id="toc">
1310 <section id="section-toc.1">
1311 <a href="#" onclick="scroll(0,0)" class="toplink">▲</a><h2 id="name-table-of-contents">
1312 <a href="#name-table-of-contents" class="section-name selfRef">Table of Contents</a>
1313 </h2>
1314 <nav class="toc"><ul class="compact toc ulBare ulEmpty">
1315 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.1">
1316 <p id="section-toc.1-1.1.1" class="keepWithNext"><a href="#section-1" class="xref">1</a>.  <a href="#name-introduction" class="xref">Introduction</a></p>
1317 </li>
1318 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.2">
1319 <p id="section-toc.1-1.2.1" class="keepWithNext"><a href="#section-2" class="xref">2</a>.  <a href="#name-requirements-notation" class="xref">Requirements Notation</a></p>
1320 </li>
1321 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.3">
1322 <p id="section-toc.1-1.3.1" class="keepWithNext"><a href="#section-3" class="xref">3</a>.  <a href="#name-notation" class="xref">Notation</a></p>
1323 </li>
1324 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.4">
1325 <p id="section-toc.1-1.4.1"><a href="#section-4" class="xref">4</a>.  <a href="#name-cryptographic-dependencies" class="xref">Cryptographic Dependencies</a></p>
1326 <ul class="compact toc ulBare ulEmpty">
1327 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.4.2.1">
1328 <p id="section-toc.1-1.4.2.1.1"><a href="#section-4.1" class="xref">4.1</a>.  <a href="#name-dh-based-kem-dhkem" class="xref">DH-Based KEM (DHKEM)</a></p>
1329 </li>
1330 </ul>
1331 </li>
1332 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5">
1333 <p id="section-toc.1-1.5.1"><a href="#section-5" class="xref">5</a>.  <a href="#name-hybrid-public-key-encryptio" class="xref">Hybrid Public Key Encryption</a></p>
1334 <ul class="compact toc ulBare ulEmpty">
1335 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.1">
1336 <p id="section-toc.1-1.5.2.1.1"><a href="#section-5.1" class="xref">5.1</a>.  <a href="#name-creating-the-encryption-con" class="xref">Creating the Encryption Context</a></p>
1337 <ul class="compact toc ulBare ulEmpty">
1338 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.1.2.1">
1339 <p id="section-toc.1-1.5.2.1.2.1.1"><a href="#section-5.1.1" class="xref">5.1.1</a>.  <a href="#name-encryption-to-a-public-key" class="xref">Encryption to a Public Key</a></p>
1340 </li>
1341 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.1.2.2">
1342 <p id="section-toc.1-1.5.2.1.2.2.1"><a href="#section-5.1.2" class="xref">5.1.2</a>.  <a href="#name-authentication-using-a-pre-" class="xref">Authentication Using a Pre-Shared Key</a></p>
1343 </li>
1344 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.1.2.3">
1345 <p id="section-toc.1-1.5.2.1.2.3.1"><a href="#section-5.1.3" class="xref">5.1.3</a>.  <a href="#name-authentication-using-an-asy" class="xref">Authentication Using an Asymmetric Key</a></p>
1346 </li>
1347 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.1.2.4">
1348 <p id="section-toc.1-1.5.2.1.2.4.1"><a href="#section-5.1.4" class="xref">5.1.4</a>.  <a href="#name-authentication-using-both-a" class="xref">Authentication Using Both a PSK and an Asymmetric Key</a></p>
1349 </li>
1350 </ul>
1351 </li>
1352 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.2">
1353 <p id="section-toc.1-1.5.2.2.1"><a href="#section-5.2" class="xref">5.2</a>.  <a href="#name-encryption-and-decryption" class="xref">Encryption and Decryption</a></p>
1354 </li>
1355 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.3">
1356 <p id="section-toc.1-1.5.2.3.1"><a href="#section-5.3" class="xref">5.3</a>.  <a href="#name-secret-export" class="xref">Secret Export</a></p>
1357 </li>
1358 </ul>
1359 </li>
1360 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.6">
1361 <p id="section-toc.1-1.6.1"><a href="#section-6" class="xref">6</a>.  <a href="#name-single-shot-apis" class="xref">Single-Shot APIs</a></p>
1362 <ul class="compact toc ulBare ulEmpty">
1363 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.6.2.1">
1364 <p id="section-toc.1-1.6.2.1.1"><a href="#section-6.1" class="xref">6.1</a>.  <a href="#name-encryption-and-decryption-2" class="xref">Encryption and Decryption</a></p>
1365 </li>
1366 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.6.2.2">
1367 <p id="section-toc.1-1.6.2.2.1"><a href="#section-6.2" class="xref">6.2</a>.  <a href="#name-secret-export-2" class="xref">Secret Export</a></p>
1368 </li>
1369 </ul>
1370 </li>
1371 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7">
1372 <p id="section-toc.1-1.7.1"><a href="#section-7" class="xref">7</a>.  <a href="#name-algorithm-identifiers" class="xref">Algorithm Identifiers</a></p>
1373 <ul class="compact toc ulBare ulEmpty">
1374 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.1">
1375 <p id="section-toc.1-1.7.2.1.1"><a href="#section-7.1" class="xref">7.1</a>.  <a href="#name-key-encapsulation-mechanism" class="xref">Key Encapsulation Mechanisms (KEMs)</a></p>
1376 <ul class="compact toc ulBare ulEmpty">
1377 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.1.2.1">
1378 <p id="section-toc.1-1.7.2.1.2.1.1"><a href="#section-7.1.1" class="xref">7.1.1</a>.  <a href="#name-serializepublickey-and-dese" class="xref">SerializePublicKey and DeserializePublicKey</a></p>
1379 </li>
1380 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.1.2.2">
1381 <p id="section-toc.1-1.7.2.1.2.2.1"><a href="#section-7.1.2" class="xref">7.1.2</a>.  <a href="#name-serializeprivatekey-and-des" class="xref">SerializePrivateKey and DeserializePrivateKey</a></p>
1382 </li>
1383 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.1.2.3">
1384 <p id="section-toc.1-1.7.2.1.2.3.1"><a href="#section-7.1.3" class="xref">7.1.3</a>.  <a href="#name-derivekeypair" class="xref">DeriveKeyPair</a></p>
1385 </li>
1386 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.1.2.4">
1387 <p id="section-toc.1-1.7.2.1.2.4.1"><a href="#section-7.1.4" class="xref">7.1.4</a>.  <a href="#name-validation-of-inputs-and-ou" class="xref">Validation of Inputs and Outputs</a></p>
1388 </li>
1389 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.1.2.5">
1390 <p id="section-toc.1-1.7.2.1.2.5.1"><a href="#section-7.1.5" class="xref">7.1.5</a>.  <a href="#name-future-kems" class="xref">Future KEMs</a></p>
1391 </li>
1392 </ul>
1393 </li>
1394 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.2">
1395 <p id="section-toc.1-1.7.2.2.1"><a href="#section-7.2" class="xref">7.2</a>.  <a href="#name-key-derivation-functions-kd" class="xref">Key Derivation Functions (KDFs)</a></p>
1396 <ul class="compact toc ulBare ulEmpty">
1397 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.2.2.1">
1398 <p id="section-toc.1-1.7.2.2.2.1.1"><a href="#section-7.2.1" class="xref">7.2.1</a>.  <a href="#name-input-length-restrictions" class="xref">Input Length Restrictions</a></p>
1399 </li>
1400 </ul>
1401 </li>
1402 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7.2.3">
1403 <p id="section-toc.1-1.7.2.3.1"><a href="#section-7.3" class="xref">7.3</a>.  <a href="#name-authenticated-encryption-wi" class="xref">Authenticated Encryption with Associated Data (AEAD)
1404 Functions</a></p>
1405 </li>
1406 </ul>
1407 </li>
1408 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.8">
1409 <p id="section-toc.1-1.8.1"><a href="#section-8" class="xref">8</a>.  <a href="#name-api-considerations" class="xref">API Considerations</a></p>
1410 <ul class="compact toc ulBare ulEmpty">
1411 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.8.2.1">
1412 <p id="section-toc.1-1.8.2.1.1"><a href="#section-8.1" class="xref">8.1</a>.  <a href="#name-auxiliary-authenticated-app" class="xref">Auxiliary Authenticated Application Information</a></p>
1413 </li>
1414 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.8.2.2">
1415 <p id="section-toc.1-1.8.2.2.1"><a href="#section-8.2" class="xref">8.2</a>.  <a href="#name-errors" class="xref">Errors</a></p>
1416 </li>
1417 </ul>
1418 </li>
1419 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9">
1420 <p id="section-toc.1-1.9.1"><a href="#section-9" class="xref">9</a>.  <a href="#name-security-considerations" class="xref">Security Considerations</a></p>
1421 <ul class="compact toc ulBare ulEmpty">
1422 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.1">
1423 <p id="section-toc.1-1.9.2.1.1"><a href="#section-9.1" class="xref">9.1</a>.  <a href="#name-security-properties" class="xref">Security Properties</a></p>
1424 <ul class="compact toc ulBare ulEmpty">
1425 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.1.2.1">
1426 <p id="section-toc.1-1.9.2.1.2.1.1"><a href="#section-9.1.1" class="xref">9.1.1</a>.  <a href="#name-key-compromise-impersonatio" class="xref">Key-Compromise Impersonation</a></p>
1427 </li>
1428 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.1.2.2">
1429 <p id="section-toc.1-1.9.2.1.2.2.1"><a href="#section-9.1.2" class="xref">9.1.2</a>.  <a href="#name-computational-analysis" class="xref">Computational Analysis</a></p>
1430 </li>
1431 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.1.2.3">
1432 <p id="section-toc.1-1.9.2.1.2.3.1"><a href="#section-9.1.3" class="xref">9.1.3</a>.  <a href="#name-post-quantum-security" class="xref">Post-Quantum Security</a></p>
1433 </li>
1434 </ul>
1435 </li>
1436 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.2">
1437 <p id="section-toc.1-1.9.2.2.1"><a href="#section-9.2" class="xref">9.2</a>.  <a href="#name-security-requirements-on-a-" class="xref">Security Requirements on a KEM Used within HPKE</a></p>
1438 <ul class="compact toc ulBare ulEmpty">
1439 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.2.2.1">
1440 <p id="section-toc.1-1.9.2.2.2.1.1"><a href="#section-9.2.1" class="xref">9.2.1</a>.  <a href="#name-encap-decap-interface" class="xref">Encap/Decap Interface</a></p>
1441 </li>
1442 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.2.2.2">
1443 <p id="section-toc.1-1.9.2.2.2.2.1"><a href="#section-9.2.2" class="xref">9.2.2</a>.  <a href="#name-authencap-authdecap-interfa" class="xref">AuthEncap/AuthDecap Interface</a></p>
1444 </li>
1445 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.2.2.3">
1446 <p id="section-toc.1-1.9.2.2.2.3.1"><a href="#section-9.2.3" class="xref">9.2.3</a>.  <a href="#name-kem-key-reuse" class="xref">KEM Key Reuse</a></p>
1447 </li>
1448 </ul>
1449 </li>
1450 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.3">
1451 <p id="section-toc.1-1.9.2.3.1"><a href="#section-9.3" class="xref">9.3</a>.  <a href="#name-security-requirements-on-a-k" class="xref">Security Requirements on a KDF</a></p>
1452 </li>
1453 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.4">
1454 <p id="section-toc.1-1.9.2.4.1"><a href="#section-9.4" class="xref">9.4</a>.  <a href="#name-security-requirements-on-an" class="xref">Security Requirements on an AEAD</a></p>
1455 </li>
1456 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.5">
1457 <p id="section-toc.1-1.9.2.5.1"><a href="#section-9.5" class="xref">9.5</a>.  <a href="#name-pre-shared-key-recommendati" class="xref">Pre-Shared Key Recommendations</a></p>
1458 </li>
1459 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.6">
1460 <p id="section-toc.1-1.9.2.6.1"><a href="#section-9.6" class="xref">9.6</a>.  <a href="#name-domain-separation" class="xref">Domain Separation</a></p>
1461 </li>
1462 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7">
1463 <p id="section-toc.1-1.9.2.7.1"><a href="#section-9.7" class="xref">9.7</a>.  <a href="#name-application-embedding-and-n" class="xref">Application Embedding and Non-Goals</a></p>
1464 <ul class="compact toc ulBare ulEmpty">
1465 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7.2.1">
1466 <p id="section-toc.1-1.9.2.7.2.1.1"><a href="#section-9.7.1" class="xref">9.7.1</a>.  <a href="#name-message-order-and-message-l" class="xref">Message Order and Message Loss</a></p>
1467 </li>
1468 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7.2.2">
1469 <p id="section-toc.1-1.9.2.7.2.2.1"><a href="#section-9.7.2" class="xref">9.7.2</a>.  <a href="#name-downgrade-prevention" class="xref">Downgrade Prevention</a></p>
1470 </li>
1471 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7.2.3">
1472 <p id="section-toc.1-1.9.2.7.2.3.1"><a href="#section-9.7.3" class="xref">9.7.3</a>.  <a href="#name-replay-protection" class="xref">Replay Protection</a></p>
1473 </li>
1474 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7.2.4">
1475 <p id="section-toc.1-1.9.2.7.2.4.1"><a href="#section-9.7.4" class="xref">9.7.4</a>.  <a href="#name-forward-secrecy" class="xref">Forward Secrecy</a></p>
1476 </li>
1477 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7.2.5">
1478 <p id="section-toc.1-1.9.2.7.2.5.1"><a href="#section-9.7.5" class="xref">9.7.5</a>.  <a href="#name-bad-ephemeral-randomness" class="xref">Bad Ephemeral Randomness</a></p>
1479 </li>
1480 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.7.2.6">
1481 <p id="section-toc.1-1.9.2.7.2.6.1"><a href="#section-9.7.6" class="xref">9.7.6</a>.  <a href="#name-hiding-plaintext-length" class="xref">Hiding Plaintext Length</a></p>
1482 </li>
1483 </ul>
1484 </li>
1485 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.8">
1486 <p id="section-toc.1-1.9.2.8.1"><a href="#section-9.8" class="xref">9.8</a>.  <a href="#name-bidirectional-encryption" class="xref">Bidirectional Encryption</a></p>
1487 </li>
1488 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9.2.9">
1489 <p id="section-toc.1-1.9.2.9.1"><a href="#section-9.9" class="xref">9.9</a>.  <a href="#name-metadata-protection" class="xref">Metadata Protection</a></p>
1490 </li>
1491 </ul>
1492 </li>
1493 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.10">
1494 <p id="section-toc.1-1.10.1"><a href="#section-10" class="xref">10</a>. <a href="#name-message-encoding" class="xref">Message Encoding</a></p>
1495 </li>
1496 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.11">
1497 <p id="section-toc.1-1.11.1"><a href="#section-11" class="xref">11</a>. <a href="#name-iana-considerations" class="xref">IANA Considerations</a></p>
1498 <ul class="compact toc ulBare ulEmpty">
1499 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.11.2.1">
1500 <p id="section-toc.1-1.11.2.1.1"><a href="#section-11.1" class="xref">11.1</a>.  <a href="#name-kem-identifiers" class="xref">KEM Identifiers</a></p>
1501 </li>
1502 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.11.2.2">
1503 <p id="section-toc.1-1.11.2.2.1"><a href="#section-11.2" class="xref">11.2</a>.  <a href="#name-kdf-identifiers" class="xref">KDF Identifiers</a></p>
1504 </li>
1505 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.11.2.3">
1506 <p id="section-toc.1-1.11.2.3.1"><a href="#section-11.3" class="xref">11.3</a>.  <a href="#name-aead-identifiers" class="xref">AEAD Identifiers</a></p>
1507 </li>
1508 </ul>
1509 </li>
1510 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.12">
1511 <p id="section-toc.1-1.12.1"><a href="#section-12" class="xref">12</a>. <a href="#name-references" class="xref">References</a></p>
1512 <ul class="compact toc ulBare ulEmpty">
1513 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.12.2.1">
1514 <p id="section-toc.1-1.12.2.1.1"><a href="#section-12.1" class="xref">12.1</a>.  <a href="#name-normative-references" class="xref">Normative References</a></p>
1515 </li>
1516 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.12.2.2">
1517 <p id="section-toc.1-1.12.2.2.1"><a href="#section-12.2" class="xref">12.2</a>.  <a href="#name-informative-references" class="xref">Informative References</a></p>
1518 </li>
1519 </ul>
1520 </li>
1521 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13">
1522 <p id="section-toc.1-1.13.1"><a href="#appendix-A" class="xref">Appendix A</a>.  <a href="#name-test-vectors" class="xref">Test Vectors</a></p>
1523 <ul class="compact toc ulBare ulEmpty">
1524 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.1">
1525 <p id="section-toc.1-1.13.2.1.1"><a href="#appendix-A.1" class="xref">A.1</a>.  <a href="#name-dhkemx25519-hkdf-sha256-hkd" class="xref">DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM</a></p>
1526 <ul class="compact toc ulBare ulEmpty">
1527 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.1.2.1">
1528 <p id="section-toc.1-1.13.2.1.2.1.1"><a href="#appendix-A.1.1" class="xref">A.1.1</a>.  <a href="#name-base-setup-information" class="xref">Base Setup Information</a></p>
1529 </li>
1530 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.1.2.2">
1531 <p id="section-toc.1-1.13.2.1.2.2.1"><a href="#appendix-A.1.2" class="xref">A.1.2</a>.  <a href="#name-psk-setup-information" class="xref">PSK Setup Information</a></p>
1532 </li>
1533 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.1.2.3">
1534 <p id="section-toc.1-1.13.2.1.2.3.1"><a href="#appendix-A.1.3" class="xref">A.1.3</a>.  <a href="#name-auth-setup-information" class="xref">Auth Setup Information</a></p>
1535 </li>
1536 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.1.2.4">
1537 <p id="section-toc.1-1.13.2.1.2.4.1"><a href="#appendix-A.1.4" class="xref">A.1.4</a>.  <a href="#name-authpsk-setup-information" class="xref">AuthPSK Setup Information</a></p>
1538 </li>
1539 </ul>
1540 </li>
1541 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.2">
1542 <p id="section-toc.1-1.13.2.2.1"><a href="#appendix-A.2" class="xref">A.2</a>.  <a href="#name-dhkemx25519-hkdf-sha256-hkdf" class="xref">DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305</a></p>
1543 <ul class="compact toc ulBare ulEmpty">
1544 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.2.2.1">
1545 <p id="section-toc.1-1.13.2.2.2.1.1"><a href="#appendix-A.2.1" class="xref">A.2.1</a>.  <a href="#name-base-setup-information-2" class="xref">Base Setup Information</a></p>
1546 </li>
1547 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.2.2.2">
1548 <p id="section-toc.1-1.13.2.2.2.2.1"><a href="#appendix-A.2.2" class="xref">A.2.2</a>.  <a href="#name-psk-setup-information-2" class="xref">PSK Setup Information</a></p>
1549 </li>
1550 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.2.2.3">
1551 <p id="section-toc.1-1.13.2.2.2.3.1"><a href="#appendix-A.2.3" class="xref">A.2.3</a>.  <a href="#name-auth-setup-information-2" class="xref">Auth Setup Information</a></p>
1552 </li>
1553 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.2.2.4">
1554 <p id="section-toc.1-1.13.2.2.2.4.1"><a href="#appendix-A.2.4" class="xref">A.2.4</a>.  <a href="#name-authpsk-setup-information-2" class="xref">AuthPSK Setup Information</a></p>
1555 </li>
1556 </ul>
1557 </li>
1558 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.3">
1559 <p id="section-toc.1-1.13.2.3.1"><a href="#appendix-A.3" class="xref">A.3</a>.  <a href="#name-dhkemp-256-hkdf-sha256-hkdf" class="xref">DHKEM(P-256, HKDF-SHA256), HKDF-SHA256, AES-128-GCM</a></p>
1560 <ul class="compact toc ulBare ulEmpty">
1561 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.3.2.1">
1562 <p id="section-toc.1-1.13.2.3.2.1.1"><a href="#appendix-A.3.1" class="xref">A.3.1</a>.  <a href="#name-base-setup-information-3" class="xref">Base Setup Information</a></p>
1563 </li>
1564 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.3.2.2">
1565 <p id="section-toc.1-1.13.2.3.2.2.1"><a href="#appendix-A.3.2" class="xref">A.3.2</a>.  <a href="#name-psk-setup-information-3" class="xref">PSK Setup Information</a></p>
1566 </li>
1567 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.3.2.3">
1568 <p id="section-toc.1-1.13.2.3.2.3.1"><a href="#appendix-A.3.3" class="xref">A.3.3</a>.  <a href="#name-auth-setup-information-3" class="xref">Auth Setup Information</a></p>
1569 </li>
1570 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.3.2.4">
1571 <p id="section-toc.1-1.13.2.3.2.4.1"><a href="#appendix-A.3.4" class="xref">A.3.4</a>.  <a href="#name-authpsk-setup-information-3" class="xref">AuthPSK Setup Information</a></p>
1572 </li>
1573 </ul>
1574 </li>
1575 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.4">
1576 <p id="section-toc.1-1.13.2.4.1"><a href="#appendix-A.4" class="xref">A.4</a>.  <a href="#name-dhkemp-256-hkdf-sha256-hkdf-" class="xref">DHKEM(P-256, HKDF-SHA256), HKDF-SHA512, AES-128-GCM</a></p>
1577 <ul class="compact toc ulBare ulEmpty">
1578 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.4.2.1">
1579 <p id="section-toc.1-1.13.2.4.2.1.1"><a href="#appendix-A.4.1" class="xref">A.4.1</a>.  <a href="#name-base-setup-information-4" class="xref">Base Setup Information</a></p>
1580 </li>
1581 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.4.2.2">
1582 <p id="section-toc.1-1.13.2.4.2.2.1"><a href="#appendix-A.4.2" class="xref">A.4.2</a>.  <a href="#name-psk-setup-information-4" class="xref">PSK Setup Information</a></p>
1583 </li>
1584 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.4.2.3">
1585 <p id="section-toc.1-1.13.2.4.2.3.1"><a href="#appendix-A.4.3" class="xref">A.4.3</a>.  <a href="#name-auth-setup-information-4" class="xref">Auth Setup Information</a></p>
1586 </li>
1587 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.4.2.4">
1588 <p id="section-toc.1-1.13.2.4.2.4.1"><a href="#appendix-A.4.4" class="xref">A.4.4</a>.  <a href="#name-authpsk-setup-information-4" class="xref">AuthPSK Setup Information</a></p>
1589 </li>
1590 </ul>
1591 </li>
1592 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.5">
1593 <p id="section-toc.1-1.13.2.5.1"><a href="#appendix-A.5" class="xref">A.5</a>.  <a href="#name-dhkemp-256-hkdf-sha256-hkdf-s" class="xref">DHKEM(P-256, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305</a></p>
1594 <ul class="compact toc ulBare ulEmpty">
1595 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.5.2.1">
1596 <p id="section-toc.1-1.13.2.5.2.1.1"><a href="#appendix-A.5.1" class="xref">A.5.1</a>.  <a href="#name-base-setup-information-5" class="xref">Base Setup Information</a></p>
1597 </li>
1598 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.5.2.2">
1599 <p id="section-toc.1-1.13.2.5.2.2.1"><a href="#appendix-A.5.2" class="xref">A.5.2</a>.  <a href="#name-psk-setup-information-5" class="xref">PSK Setup Information</a></p>
1600 </li>
1601 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.5.2.3">
1602 <p id="section-toc.1-1.13.2.5.2.3.1"><a href="#appendix-A.5.3" class="xref">A.5.3</a>.  <a href="#name-auth-setup-information-5" class="xref">Auth Setup Information</a></p>
1603 </li>
1604 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.5.2.4">
1605 <p id="section-toc.1-1.13.2.5.2.4.1"><a href="#appendix-A.5.4" class="xref">A.5.4</a>.  <a href="#name-authpsk-setup-information-5" class="xref">AuthPSK Setup Information</a></p>
1606 </li>
1607 </ul>
1608 </li>
1609 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.6">
1610 <p id="section-toc.1-1.13.2.6.1"><a href="#appendix-A.6" class="xref">A.6</a>.  <a href="#name-dhkemp-521-hkdf-sha512-hkdf" class="xref">DHKEM(P-521, HKDF-SHA512), HKDF-SHA512, AES-256-GCM</a></p>
1611 <ul class="compact toc ulBare ulEmpty">
1612 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.6.2.1">
1613 <p id="section-toc.1-1.13.2.6.2.1.1"><a href="#appendix-A.6.1" class="xref">A.6.1</a>.  <a href="#name-base-setup-information-6" class="xref">Base Setup Information</a></p>
1614 </li>
1615 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.6.2.2">
1616 <p id="section-toc.1-1.13.2.6.2.2.1"><a href="#appendix-A.6.2" class="xref">A.6.2</a>.  <a href="#name-psk-setup-information-6" class="xref">PSK Setup Information</a></p>
1617 </li>
1618 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.6.2.3">
1619 <p id="section-toc.1-1.13.2.6.2.3.1"><a href="#appendix-A.6.3" class="xref">A.6.3</a>.  <a href="#name-auth-setup-information-6" class="xref">Auth Setup Information</a></p>
1620 </li>
1621 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.6.2.4">
1622 <p id="section-toc.1-1.13.2.6.2.4.1"><a href="#appendix-A.6.4" class="xref">A.6.4</a>.  <a href="#name-authpsk-setup-information-6" class="xref">AuthPSK Setup Information</a></p>
1623 </li>
1624 </ul>
1625 </li>
1626 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.7">
1627 <p id="section-toc.1-1.13.2.7.1"><a href="#appendix-A.7" class="xref">A.7</a>.  <a href="#name-dhkemx25519-hkdf-sha256-hkdf-" class="xref">DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, Export-Only AEAD</a></p>
1628 <ul class="compact toc ulBare ulEmpty">
1629 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.7.2.1">
1630 <p id="section-toc.1-1.13.2.7.2.1.1"><a href="#appendix-A.7.1" class="xref">A.7.1</a>.  <a href="#name-base-setup-information-7" class="xref">Base Setup Information</a></p>
1631 </li>
1632 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.7.2.2">
1633 <p id="section-toc.1-1.13.2.7.2.2.1"><a href="#appendix-A.7.2" class="xref">A.7.2</a>.  <a href="#name-psk-setup-information-7" class="xref">PSK Setup Information</a></p>
1634 </li>
1635 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.7.2.3">
1636 <p id="section-toc.1-1.13.2.7.2.3.1"><a href="#appendix-A.7.3" class="xref">A.7.3</a>.  <a href="#name-auth-setup-information-7" class="xref">Auth Setup Information</a></p>
1637 </li>
1638 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13.2.7.2.4">
1639 <p id="section-toc.1-1.13.2.7.2.4.1"><a href="#appendix-A.7.4" class="xref">A.7.4</a>.  <a href="#name-authpsk-setup-information-7" class="xref">AuthPSK Setup Information</a></p>
1640 </li>
1641 </ul>
1642 </li>
1643 </ul>
1644 </li>
1645 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.14">
1646 <p id="section-toc.1-1.14.1"><a href="#appendix-B" class="xref"></a><a href="#name-acknowledgements" class="xref">Acknowledgements</a></p>
1647 </li>
1648 <li class="compact toc ulBare ulEmpty" id="section-toc.1-1.15">
1649 <p id="section-toc.1-1.15.1"><a href="#appendix-C" class="xref"></a><a href="#name-authors-addresses" class="xref">Authors' Addresses</a></p>
1650 </li>
1651 </ul>
1652 </nav>
1653 </section>
1654 </div>
1655 <div id="introduction">
1656 <section id="section-1">
1657 <h2 id="name-introduction">
1658 <a href="#section-1" class="section-number selfRef">1. </a><a href="#name-introduction" class="section-name selfRef">Introduction</a>
1659 </h2>
1660 <p id="section-1-1">Encryption schemes that combine asymmetric and symmetric algorithms have been
1661 specified and practiced since the early days of public key cryptography, e.g.,
1662 <span>[<a href="#RFC1421" class="xref">RFC1421</a>]</span>. Combining the two yields the key management advantages of asymmetric
1663 cryptography and the performance benefits of symmetric cryptography. The traditional
1664 combination has been "encrypt the symmetric key with the public key." "Hybrid"
1665 public key encryption (HPKE) schemes, specified here, take a different approach:
1666 "generate the symmetric key and its encapsulation with the public key."
1667 Specifically, encrypted messages convey an encryption key encapsulated with a
1668 public key scheme, along with one or more arbitrary-sized ciphertexts encrypted
1669 using that key. This type of public key encryption has many applications in
1670 practice, including Messaging Layer Security <span>[<a href="#I-D.ietf-mls-protocol" class="xref">MLS-PROTOCOL</a>]</span> and
1671 TLS Encrypted ClientHello <span>[<a href="#I-D.ietf-tls-esni" class="xref">TLS-ECH</a>]</span>.<a href="#section-1-1" class="pilcrow">¶</a></p>
1672 <p id="section-1-2">Currently, there are numerous competing and non-interoperable standards and
1673 variants for hybrid encryption, mostly variants on the Elliptic Curve Integrated Encryption Scheme (ECIES), including ANSI X9.63
1674 (ECIES) <span>[<a href="#ANSI" class="xref">ANSI</a>]</span>, IEEE 1363a <span>[<a href="#IEEE1363" class="xref">IEEE1363</a>]</span>, ISO/IEC 18033-2 <span>[<a href="#ISO" class="xref">ISO</a>]</span>, and SECG SEC 1
1675 <span>[<a href="#SECG" class="xref">SECG</a>]</span>. See <span>[<a href="#MAEA10" class="xref">MAEA10</a>]</span> for a thorough comparison. All these existing
1676 schemes have problems, e.g., because they rely on outdated primitives, lack
1677 proofs of indistinguishable (adaptive) chosen-ciphertext attack (IND-CCA2) security, or fail to provide test vectors.<a href="#section-1-2" class="pilcrow">¶</a></p>
1678 <p id="section-1-3">This document defines an HPKE scheme that provides a subset
1679 of the functions provided by the collection of schemes above but
1680 specified with sufficient clarity that they can be interoperably
1681 implemented. The HPKE construction defined herein is secure against (adaptive)
1682 chosen ciphertext attacks (IND-CCA2-secure) under classical assumptions about
1683 the underlying primitives <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span> <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span>. A summary of
1684 these analyses is in <a href="#sec-properties" class="xref">Section 9.1</a>.<a href="#section-1-3" class="pilcrow">¶</a></p>
1685 <p id="section-1-4">This document represents the consensus of the Crypto Forum Research Group (CFRG).<a href="#section-1-4" class="pilcrow">¶</a></p>
1686 </section>
1687 </div>
1688 <div id="requirements-notation">
1689 <section id="section-2">
1690 <h2 id="name-requirements-notation">
1691 <a href="#section-2" class="section-number selfRef">2. </a><a href="#name-requirements-notation" class="section-name selfRef">Requirements Notation</a>
1692 </h2>
1693 <p id="section-2-1">The key words "<span class="bcp14">MUST</span>", "<span class="bcp14">MUST NOT</span>",
1694 "<span class="bcp14">REQUIRED</span>", "<span class="bcp14">SHALL</span>", "<span class="bcp14">SHALL NOT</span>", "<span class="bcp14">SHOULD</span>", "<span class="bcp14">SHOULD NOT</span>",
1695 "<span class="bcp14">RECOMMENDED</span>", "<span class="bcp14">NOT RECOMMENDED</span>",
1696 "<span class="bcp14">MAY</span>", and "<span class="bcp14">OPTIONAL</span>" in this document
1697 are to be interpreted as described in BCP 14 <span>[<a href="#RFC2119" class="xref">RFC2119</a>]</span>
1698 <span>[<a href="#RFC8174" class="xref">RFC8174</a>]</span> when, and only when, they appear in all capitals,
1699 as shown here.<a href="#section-2-1" class="pilcrow">¶</a></p>
1700 </section>
1701 </div>
1702 <div id="notation">
1703 <section id="section-3">
1704 <h2 id="name-notation">
1705 <a href="#section-3" class="section-number selfRef">3. </a><a href="#name-notation" class="section-name selfRef">Notation</a>
1706 </h2>
1707 <p id="section-3-1">The following terms are used throughout this document to describe the
1708 operations, roles, and behaviors of HPKE:<a href="#section-3-1" class="pilcrow">¶</a></p>
1709 <span class="break"></span><dl class="dlParallel" id="section-3-2">
1710 <dt id="section-3-2.1">
1711 <code>(skX, pkX)</code>:</dt>
1712 <dd style="margin-left: 1.5em" id="section-3-2.2">A key encapsulation mechanism (KEM) key pair used in role X,
1713 where X is one of S, R, or E as sender, recipient, and ephemeral, respectively;
1714 <code>skX</code> is the private key and <code>pkX</code> is the public key.<a href="#section-3-2.2" class="pilcrow">¶</a>
1715 </dd>
1716 <dd class="break"></dd>
1717 <dt id="section-3-2.3">
1718 <code>pk(skX)</code>:</dt>
1719 <dd style="margin-left: 1.5em" id="section-3-2.4">The KEM public key corresponding to the KEM private key <code>skX</code>.<a href="#section-3-2.4" class="pilcrow">¶</a>
1720 </dd>
1721 <dd class="break"></dd>
1722 <dt id="section-3-2.5">Sender (S):</dt>
1723 <dd style="margin-left: 1.5em" id="section-3-2.6">Role of entity that sends an encrypted message.<a href="#section-3-2.6" class="pilcrow">¶</a>
1724 </dd>
1725 <dd class="break"></dd>
1726 <dt id="section-3-2.7">Recipient (R):</dt>
1727 <dd style="margin-left: 1.5em" id="section-3-2.8">Role of entity that receives an encrypted message.<a href="#section-3-2.8" class="pilcrow">¶</a>
1728 </dd>
1729 <dd class="break"></dd>
1730 <dt id="section-3-2.9">Ephemeral (E):</dt>
1731 <dd style="margin-left: 1.5em" id="section-3-2.10">Role of a fresh random value meant for one-time use.<a href="#section-3-2.10" class="pilcrow">¶</a>
1732 </dd>
1733 <dd class="break"></dd>
1734 <dt id="section-3-2.11">
1735 <code>I2OSP(n, w)</code>:</dt>
1736 <dd style="margin-left: 1.5em" id="section-3-2.12">Convert non-negative integer <code>n</code> to a <code>w</code>-length,
1737 big-endian byte
1738 string, as described in <span>[<a href="#RFC8017" class="xref">RFC8017</a>]</span>.<a href="#section-3-2.12" class="pilcrow">¶</a>
1739 </dd>
1740 <dd class="break"></dd>
1741 <dt id="section-3-2.13">
1742 <code>OS2IP(x)</code>:</dt>
1743 <dd style="margin-left: 1.5em" id="section-3-2.14">Convert byte string <code>x</code> to a non-negative integer, as described in
1744 <span>[<a href="#RFC8017" class="xref">RFC8017</a>]</span>, assuming big-endian byte order.<a href="#section-3-2.14" class="pilcrow">¶</a>
1745 </dd>
1746 <dd class="break"></dd>
1747 <dt id="section-3-2.15">
1748 <code>concat(x0, ..., xN)</code>:</dt>
1749 <dd style="margin-left: 1.5em" id="section-3-2.16">Concatenation of byte strings. <code>concat(0x01, 0x0203, 0x040506) =
1750 0x010203040506</code>.<a href="#section-3-2.16" class="pilcrow">¶</a>
1751 </dd>
1752 <dd class="break"></dd>
1753 <dt id="section-3-2.17">
1754 <code>random(n)</code>:</dt>
1755 <dd style="margin-left: 1.5em" id="section-3-2.18">A pseudorandom byte string of length <code>n</code> bytes<a href="#section-3-2.18" class="pilcrow">¶</a>
1756 </dd>
1757 <dd class="break"></dd>
1758 <dt id="section-3-2.19">
1759 <code>xor(a,b)</code>:</dt>
1760 <dd style="margin-left: 1.5em" id="section-3-2.20">XOR of byte strings; <code>xor(0xF0F0, 0x1234) = 0xE2C4</code>. It is an error to
1761 call this function with two arguments of unequal length.<a href="#section-3-2.20" class="pilcrow">¶</a>
1762 </dd>
1763 <dd class="break"></dd>
1764 </dl>
1765 </section>
1766 </div>
1767 <div id="base-crypto">
1768 <section id="section-4">
1769 <h2 id="name-cryptographic-dependencies">
1770 <a href="#section-4" class="section-number selfRef">4. </a><a href="#name-cryptographic-dependencies" class="section-name selfRef">Cryptographic Dependencies</a>
1771 </h2>
1772 <p id="section-4-1">HPKE variants rely on the following primitives:<a href="#section-4-1" class="pilcrow">¶</a></p>
1773 <ul class="normal">
1774 <li class="normal" id="section-4-2.1">
1775 <p id="section-4-2.1.1">A key encapsulation mechanism (KEM):<a href="#section-4-2.1.1" class="pilcrow">¶</a></p>
1776 <ul class="normal">
1777 <li class="normal" id="section-4-2.1.2.1">
1778 <code>GenerateKeyPair()</code>: Randomized algorithm to generate a key pair
1779 <code>(skX, pkX)</code>.<a href="#section-4-2.1.2.1" class="pilcrow">¶</a>
1780 </li>
1781 <li class="normal" id="section-4-2.1.2.2">
1782 <code>DeriveKeyPair(ikm)</code>: Deterministic algorithm to derive a key
1783 pair <code>(skX, pkX)</code> from the
1784 byte string <code>ikm</code>, where <code>ikm</code> <span class="bcp14">SHOULD</span> have at
1785 least <code>Nsk</code> bytes of entropy (see <a href="#derive-key-pair" class="xref">Section 7.1.3</a> for discussion).<a href="#section-4-2.1.2.2" class="pilcrow">¶</a>
1786 </li>
1787 <li class="normal" id="section-4-2.1.2.3">
1788 <code>SerializePublicKey(pkX)</code>: Produce a byte string of length <code>Npk</code> encoding the public key
1789 <code>pkX</code>.<a href="#section-4-2.1.2.3" class="pilcrow">¶</a>
1790 </li>
1791 <li class="normal" id="section-4-2.1.2.4">
1792 <code>DeserializePublicKey(pkXm)</code>: Parse a byte string of length <code>Npk</code> to recover a public key. This
1793 function can raise a <code>DeserializeError</code> error upon <code>pkXm</code>
1794 deserialization failure.<a href="#section-4-2.1.2.4" class="pilcrow">¶</a>
1795 </li>
1796 <li class="normal" id="section-4-2.1.2.5">
1797 <code>Encap(pkR)</code>: Randomized algorithm to generate an ephemeral, fixed-length symmetric key
1798 (the KEM shared secret) and a fixed-length encapsulation of that key that can
1799 be decapsulated by the holder of the private key corresponding to <code>pkR</code>.
1800 This function can raise an <code>EncapError</code> on encapsulation failure.<a href="#section-4-2.1.2.5" class="pilcrow">¶</a>
1801 </li>
1802 <li class="normal" id="section-4-2.1.2.6">
1803 <code>Decap(enc, skR)</code>: Deterministic algorithm using the private key <code>skR</code> to recover the
1804 ephemeral symmetric key (the KEM shared secret) from its encapsulated
1805 representation <code>enc</code>. This function can raise a <code>DecapError</code> on
1806 decapsulation failure.<a href="#section-4-2.1.2.6" class="pilcrow">¶</a>
1807 </li>
1808 <li class="normal" id="section-4-2.1.2.7">
1809 <code>AuthEncap(pkR, skS)</code> (optional): Same as <code>Encap()</code>, and the outputs encode an assurance that the KEM
1810 shared secret was generated by the holder of the private key <code>skS</code>.<a href="#section-4-2.1.2.7" class="pilcrow">¶</a>
1811 </li>
1812 <li class="normal" id="section-4-2.1.2.8">
1813 <code>AuthDecap(enc, skR, pkS)</code> (optional): Same as <code>Decap()</code>, and the recipient is assured that the KEM shared
1814 secret was generated by the holder of the private key <code>skS</code>.<a href="#section-4-2.1.2.8" class="pilcrow">¶</a>
1815 </li>
1816 <li class="normal" id="section-4-2.1.2.9">
1817 <code>Nsecret</code>: The length in bytes of a KEM shared secret produced by this KEM.<a href="#section-4-2.1.2.9" class="pilcrow">¶</a>
1818 </li>
1819 <li class="normal" id="section-4-2.1.2.10">
1820 <code>Nenc</code>: The length in bytes of an encapsulated key produced by this KEM.<a href="#section-4-2.1.2.10" class="pilcrow">¶</a>
1821 </li>
1822 <li class="normal" id="section-4-2.1.2.11">
1823 <code>Npk</code>: The length in bytes of an encoded public key for this KEM.<a href="#section-4-2.1.2.11" class="pilcrow">¶</a>
1824 </li>
1825 <li class="normal" id="section-4-2.1.2.12">
1826 <code>Nsk</code>: The length in bytes of an encoded private key for this KEM.<a href="#section-4-2.1.2.12" class="pilcrow">¶</a>
1827 </li>
1828 </ul>
1829 </li>
1830 <li class="normal" id="section-4-2.2">
1831 <p id="section-4-2.2.1">A key derivation function (KDF):<a href="#section-4-2.2.1" class="pilcrow">¶</a></p>
1832 <ul class="normal">
1833 <li class="normal" id="section-4-2.2.2.1">
1834 <code>Extract(salt, ikm)</code>: Extract a pseudorandom key of fixed length <code>Nh</code> bytes from input
1835 keying material <code>ikm</code> and an optional byte string <code>salt</code>.<a href="#section-4-2.2.2.1" class="pilcrow">¶</a>
1836 </li>
1837 <li class="normal" id="section-4-2.2.2.2">
1838 <code>Expand(prk, info, L)</code>: Expand a pseudorandom key <code>prk</code> using optional string <code>info</code>
1839 into <code>L</code> bytes of output keying material.<a href="#section-4-2.2.2.2" class="pilcrow">¶</a>
1840 </li>
1841 <li class="normal" id="section-4-2.2.2.3">
1842 <code>Nh</code>: The output size of the <code>Extract()</code> function in bytes.<a href="#section-4-2.2.2.3" class="pilcrow">¶</a>
1843 </li>
1844 </ul>
1845 </li>
1846 <li class="normal" id="section-4-2.3">
1847 <p id="section-4-2.3.1">An AEAD encryption algorithm <span>[<a href="#RFC5116" class="xref">RFC5116</a>]</span>:<a href="#section-4-2.3.1" class="pilcrow">¶</a></p>
1848 <ul class="normal">
1849 <li class="normal" id="section-4-2.3.2.1">
1850 <code>Seal(key, nonce, aad, pt)</code>: Encrypt and authenticate plaintext <code>pt</code> with associated data
1851 <code>aad</code> using symmetric key <code>key</code> and nonce
1852 <code>nonce</code>,
1853 yielding ciphertext and tag <code>ct</code>. This function can raise a
1854 <code>MessageLimitReachedError</code> upon failure.<a href="#section-4-2.3.2.1" class="pilcrow">¶</a>
1855 </li>
1856 <li class="normal" id="section-4-2.3.2.2">
1857 <code>Open(key, nonce, aad, ct)</code>: Decrypt ciphertext and tag <code>ct</code> using associated data
1858 <code>aad</code>
1859 with symmetric key <code>key</code> and nonce <code>nonce</code>, returning plaintext
1860 message <code>pt</code>. This function can raise an <code>OpenError</code> or
1861 <code>MessageLimitReachedError</code> upon failure.<a href="#section-4-2.3.2.2" class="pilcrow">¶</a>
1862 </li>
1863 <li class="normal" id="section-4-2.3.2.3">
1864 <code>Nk</code>: The length in bytes of a key for this algorithm.<a href="#section-4-2.3.2.3" class="pilcrow">¶</a>
1865 </li>
1866 <li class="normal" id="section-4-2.3.2.4">
1867 <code>Nn</code>: The length in bytes of a nonce for this algorithm.<a href="#section-4-2.3.2.4" class="pilcrow">¶</a>
1868 </li>
1869 <li class="normal" id="section-4-2.3.2.5">
1870 <code>Nt</code>: The length in bytes of the authentication tag for this algorithm.<a href="#section-4-2.3.2.5" class="pilcrow">¶</a>
1871 </li>
1872 </ul>
1873 </li>
1874 </ul>
1875 <p id="section-4-3">Beyond the above, a KEM <span class="bcp14">MAY</span> also expose the following functions, whose
1876 behavior is detailed in <a href="#serializeprivatekey" class="xref">Section 7.1.2</a>:<a href="#section-4-3" class="pilcrow">¶</a></p>
1877 <ul class="normal">
1878 <li class="normal" id="section-4-4.1">
1879 <code>SerializePrivateKey(skX)</code>: Produce a byte string of length <code>Nsk</code> encoding the private key
1880 <code>skX</code>.<a href="#section-4-4.1" class="pilcrow">¶</a>
1881 </li>
1882 <li class="normal" id="section-4-4.2">
1883 <code>DeserializePrivateKey(skXm)</code>: Parse a byte string of length <code>Nsk</code> to recover a private key. This
1884 function can raise a <code>DeserializeError</code> error upon <code>skXm</code>
1885 deserialization failure.<a href="#section-4-4.2" class="pilcrow">¶</a>
1886 </li>
1887 </ul>
1888 <p id="section-4-5">A <em>ciphersuite</em> is a triple (KEM, KDF, AEAD) containing a choice of algorithm
1889 for each primitive.<a href="#section-4-5" class="pilcrow">¶</a></p>
1890 <p id="section-4-6">A set of algorithm identifiers for concrete instantiations of these
1891 primitives is provided in <a href="#ciphersuites" class="xref">Section 7</a>. Algorithm identifier
1892 values are two bytes long.<a href="#section-4-6" class="pilcrow">¶</a></p>
1893 <p id="section-4-7">Note that <code>GenerateKeyPair</code> can be implemented as <code>DeriveKeyPair(random(Nsk))</code>.<a href="#section-4-7" class="pilcrow">¶</a></p>
1894 <p id="section-4-8">The notation <code>pk(skX)</code>, depending on its use and the KEM and its
1895 implementation, is either the
1896 computation of the public key using the private key, or just syntax
1897 expressing the retrieval of the public key, assuming it is stored along
1898 with the private key object.<a href="#section-4-8" class="pilcrow">¶</a></p>
1899 <p id="section-4-9">The following two functions are defined to facilitate domain separation of
1900 KDF calls as well as context binding:<a href="#section-4-9" class="pilcrow">¶</a></p>
1901 <div id="section-4-10">
1902 <pre class="lang-pseudocode sourcecode">
1903 def LabeledExtract(salt, label, ikm):
1904 labeled_ikm = concat("HPKE-v1", suite_id, label, ikm)
1905 return Extract(salt, labeled_ikm)
1906
1907 def LabeledExpand(prk, label, info, L):
1908 labeled_info = concat(I2OSP(L, 2), "HPKE-v1", suite_id,
1909 label, info)
1910 return Expand(prk, labeled_info, L)
1911 </pre><a href="#section-4-10" class="pilcrow">¶</a>
1912 </div>
1913 <p id="section-4-11">The value of <code>suite_id</code> depends on where the KDF is used; it is assumed
1914 implicit from the implementation and not passed as a parameter. If used
1915 inside a KEM algorithm, <code>suite_id</code> <span class="bcp14">MUST</span> start with "KEM" and identify
1916 this KEM algorithm; if used in the remainder of HPKE, it <span class="bcp14">MUST</span> start with
1917 "HPKE" and identify the entire ciphersuite in use. See Sections <a href="#dhkem" class="xref">4.1</a>
1918 and <a href="#encryption-context" class="xref">5.1</a> for details.<a href="#section-4-11" class="pilcrow">¶</a></p>
1919 <div id="dhkem">
1920 <section id="section-4.1">
1921 <h3 id="name-dh-based-kem-dhkem">
1922 <a href="#section-4.1" class="section-number selfRef">4.1. </a><a href="#name-dh-based-kem-dhkem" class="section-name selfRef">DH-Based KEM (DHKEM)</a>
1923 </h3>
1924 <p id="section-4.1-1">Suppose we are given a KDF, and a Diffie-Hellman (DH) group providing the
1925 following operations:<a href="#section-4.1-1" class="pilcrow">¶</a></p>
1926 <ul class="normal">
1927 <li class="normal" id="section-4.1-2.1">
1928 <code>DH(skX, pkY)</code>: Perform a non-interactive Diffie-Hellman exchange using the private key
1929 <code>skX</code> and public key <code>pkY</code> to produce a Diffie-Hellman shared
1930 secret of length <code>Ndh</code>. This function can raise a <code>ValidationError</code>
1931 as described in <a href="#validation" class="xref">Section 7.1.4</a>.<a href="#section-4.1-2.1" class="pilcrow">¶</a>
1932 </li>
1933 <li class="normal" id="section-4.1-2.2">
1934 <code>Ndh</code>: The length in bytes of a Diffie-Hellman shared secret produced by
1935 <code>DH()</code>.<a href="#section-4.1-2.2" class="pilcrow">¶</a>
1936 </li>
1937 <li class="normal" id="section-4.1-2.3">
1938 <code>Nsk</code>: The length in bytes of a Diffie-Hellman private key.<a href="#section-4.1-2.3" class="pilcrow">¶</a>
1939 </li>
1940 </ul>
1941 <p id="section-4.1-3">Then we can construct a KEM that implements the interface defined in <a href="#base-crypto" class="xref">Section 4</a>
1942 called <code>DHKEM(Group, KDF)</code> in the following way, where <code>Group</code> denotes the
1943 Diffie-Hellman group and <code>KDF</code> denotes the KDF. The function parameters <code>pkR</code> and <code>pkS</code>
1944 are deserialized public keys, and <code>enc</code> is a serialized public key. Since
1945 encapsulated keys are Diffie-Hellman public keys in this KEM algorithm,
1946 we use <code>SerializePublicKey()</code> and <code>DeserializePublicKey()</code> to encode and decode
1947 them, respectively. <code>Npk</code> equals <code>Nenc</code>. <code>GenerateKeyPair()</code> produces a key pair
1948 for the Diffie-Hellman group in use. <a href="#derive-key-pair" class="xref">Section 7.1.3</a> contains the
1949 <code>DeriveKeyPair()</code> function specification for DHKEMs defined in this document.<a href="#section-4.1-3" class="pilcrow">¶</a></p>
1950 <div id="section-4.1-4">
1951 <pre class="lang-pseudocode sourcecode">
1952 def ExtractAndExpand(dh, kem_context):
1953 eae_prk = LabeledExtract("", "eae_prk", dh)
1954 shared_secret = LabeledExpand(eae_prk, "shared_secret",
1955 kem_context, Nsecret)
1956 return shared_secret
1957
1958 def Encap(pkR):
1959 skE, pkE = GenerateKeyPair()
1960 dh = DH(skE, pkR)
1961 enc = SerializePublicKey(pkE)
1962
1963 pkRm = SerializePublicKey(pkR)
1964 kem_context = concat(enc, pkRm)
1965
1966 shared_secret = ExtractAndExpand(dh, kem_context)
1967 return shared_secret, enc
1968
1969 def Decap(enc, skR):
1970 pkE = DeserializePublicKey(enc)
1971 dh = DH(skR, pkE)
1972
1973 pkRm = SerializePublicKey(pk(skR))
1974 kem_context = concat(enc, pkRm)
1975
1976 shared_secret = ExtractAndExpand(dh, kem_context)
1977 return shared_secret
1978
1979 def AuthEncap(pkR, skS):
1980 skE, pkE = GenerateKeyPair()
1981 dh = concat(DH(skE, pkR), DH(skS, pkR))
1982 enc = SerializePublicKey(pkE)
1983
1984 pkRm = SerializePublicKey(pkR)
1985 pkSm = SerializePublicKey(pk(skS))
1986 kem_context = concat(enc, pkRm, pkSm)
1987
1988 shared_secret = ExtractAndExpand(dh, kem_context)
1989 return shared_secret, enc
1990
1991 def AuthDecap(enc, skR, pkS):
1992 pkE = DeserializePublicKey(enc)
1993 dh = concat(DH(skR, pkE), DH(skR, pkS))
1994
1995 pkRm = SerializePublicKey(pk(skR))
1996 pkSm = SerializePublicKey(pkS)
1997 kem_context = concat(enc, pkRm, pkSm)
1998
1999 shared_secret = ExtractAndExpand(dh, kem_context)
2000 return shared_secret
2001 </pre><a href="#section-4.1-4" class="pilcrow">¶</a>
2002 </div>
2003 <p id="section-4.1-5">The implicit <code>suite_id</code> value used within <code>LabeledExtract</code> and
2004 <code>LabeledExpand</code> is defined as follows, where <code>kem_id</code> is defined
2005 in <a href="#kem-ids" class="xref">Section 7.1</a>:<a href="#section-4.1-5" class="pilcrow">¶</a></p>
2006 <div id="section-4.1-6">
2007 <pre class="lang-pseudocode sourcecode">
2008 suite_id = concat("KEM", I2OSP(kem_id, 2))
2009 </pre><a href="#section-4.1-6" class="pilcrow">¶</a>
2010 </div>
2011 <p id="section-4.1-7">The KDF used in DHKEM can be equal to or different from the KDF used
2012 in the remainder of HPKE, depending on the chosen variant.
2013 Implementations <span class="bcp14">MUST</span> make sure to use the constants (<code>Nh</code>) and function
2014 calls (<code>LabeledExtract</code> and <code>LabeledExpand</code>) of the appropriate KDF when
2015 implementing DHKEM. See <a href="#kdf-choice" class="xref">Section 9.3</a> for a comment on the choice of
2016 a KDF for the remainder of HPKE, and <a href="#domain-separation" class="xref">Section 9.6</a> for the
2017 rationale of the labels.<a href="#section-4.1-7" class="pilcrow">¶</a></p>
2018 <p id="section-4.1-8">For the variants of DHKEM defined in this document, the size <code>Nsecret</code> of the
2019 KEM shared secret is equal to the output length of the hash function
2020 underlying the KDF. For P-256, P-384, and P-521, the size <code>Ndh</code> of the
2021 Diffie-Hellman shared secret is equal to 32, 48, and 66, respectively,
2022 corresponding to the x-coordinate of the resulting elliptic curve point <span>[<a href="#IEEE1363" class="xref">IEEE1363</a>]</span>.
2023 For X25519 and X448, the size <code>Ndh</code> is equal to 32 and 56, respectively
2024 (see <span>[<a href="#RFC7748" class="xref">RFC7748</a>], <a href="https://www.rfc-editor.org/rfc/rfc7748#section-5" class="relref">Section 5</a></span>).<a href="#section-4.1-8" class="pilcrow">¶</a></p>
2025 <p id="section-4.1-9">It is important to note that the <code>AuthEncap()</code> and <code>AuthDecap()</code> functions of the
2026 DHKEM variants defined in this document are vulnerable to key-compromise
2027 impersonation (KCI). This means the assurance that the KEM shared secret
2028 was generated by the holder of the private key <code>skS</code> does not hold if
2029 the recipient private key <code>skR</code> is compromised. See <a href="#sec-properties" class="xref">Section 9.1</a>
2030 for more details.<a href="#section-4.1-9" class="pilcrow">¶</a></p>
2031 <p id="section-4.1-10">Senders and recipients <span class="bcp14">MUST</span> validate KEM inputs and outputs as described
2032 in <a href="#kem-ids" class="xref">Section 7.1</a>.<a href="#section-4.1-10" class="pilcrow">¶</a></p>
2033 </section>
2034 </div>
2035 </section>
2036 </div>
2037 <div id="hpke">
2038 <section id="section-5">
2039 <h2 id="name-hybrid-public-key-encryptio">
2040 <a href="#section-5" class="section-number selfRef">5. </a><a href="#name-hybrid-public-key-encryptio" class="section-name selfRef">Hybrid Public Key Encryption</a>
2041 </h2>
2042 <p id="section-5-1">In this section, we define a few HPKE variants. All variants take a
2043 recipient public key and a sequence of plaintexts <code>pt</code> and produce an
2044 encapsulated key <code>enc</code> and a sequence of ciphertexts <code>ct</code>. These outputs are
2045 constructed so that only the holder of <code>skR</code> can decapsulate the key from
2046 <code>enc</code> and decrypt the ciphertexts. All the algorithms also take an
2047 <code>info</code> parameter that can be used to influence the generation of keys
2048 (e.g., to fold in identity information) and an <code>aad</code> parameter that
2049 provides additional authenticated data to the AEAD algorithm in use.<a href="#section-5-1" class="pilcrow">¶</a></p>
2050 <p id="section-5-2">In addition to the base case of encrypting to a public key, we
2051 include three authenticated variants: one that authenticates
2052 possession of a pre-shared key, one that authenticates
2053 possession of a KEM private key, and one that authenticates possession of both
2054 a pre-shared key and a KEM private key. All authenticated variants contribute
2055 additional keying material to the encryption operation. The following one-byte
2056 values will be used to distinguish between modes:<a href="#section-5-2" class="pilcrow">¶</a></p>
2057 <span id="name-hpke-modes"></span><div id="hpke-modes">
2058 <table class="center" id="table-1">
2059 <caption>
2060 <a href="#table-1" class="selfRef">Table 1</a>:
2061 <a href="#name-hpke-modes" class="selfRef">HPKE Modes</a>
2062 </caption>
2063 <thead>
2064 <tr>
2065 <th class="text-left" rowspan="1" colspan="1">Mode</th>
2066 <th class="text-left" rowspan="1" colspan="1">Value</th>
2067 </tr>
2068 </thead>
2069 <tbody>
2070 <tr>
2071 <td class="text-left" rowspan="1" colspan="1">mode_base</td>
2072 <td class="text-left" rowspan="1" colspan="1">0x00</td>
2073 </tr>
2074 <tr>
2075 <td class="text-left" rowspan="1" colspan="1">mode_psk</td>
2076 <td class="text-left" rowspan="1" colspan="1">0x01</td>
2077 </tr>
2078 <tr>
2079 <td class="text-left" rowspan="1" colspan="1">mode_auth</td>
2080 <td class="text-left" rowspan="1" colspan="1">0x02</td>
2081 </tr>
2082 <tr>
2083 <td class="text-left" rowspan="1" colspan="1">mode_auth_psk</td>
2084 <td class="text-left" rowspan="1" colspan="1">0x03</td>
2085 </tr>
2086 </tbody>
2087 </table>
2088 </div>
2089 <p id="section-5-4">All these cases follow the same basic two-step pattern:<a href="#section-5-4" class="pilcrow">¶</a></p>
2090 <ol start="1" type="1" class="normal type-1" id="section-5-5">
2091 <li id="section-5-5.1">Set up an encryption context that is shared between the sender
2092 and the recipient.<a href="#section-5-5.1" class="pilcrow">¶</a>
2093 </li>
2094 <li id="section-5-5.2">Use that context to encrypt or decrypt content.<a href="#section-5-5.2" class="pilcrow">¶</a>
2095 </li>
2096 </ol>
2097 <p id="section-5-6">A <em>context</em> is an implementation-specific structure that encodes
2098 the AEAD algorithm and key in use, and manages the nonces used so
2099 that the same nonce is not used with multiple plaintexts. It also
2100 has an interface for exporting secret values, as described in
2101 <a href="#hpke-export" class="xref">Section 5.3</a>. See <a href="#hpke-dem" class="xref">Section 5.2</a> for a description of this structure
2102 and its interfaces. HPKE decryption fails when the underlying AEAD
2103 decryption fails.<a href="#section-5-6" class="pilcrow">¶</a></p>
2104 <p id="section-5-7">The constructions described here presume that the relevant non-private
2105 parameters (<code>enc</code>, <code>psk_id</code>, etc.) are transported between the sender and the
2106 recipient by some application making use of HPKE. Moreover, a recipient with more
2107 than one public key needs some way of determining which of its public keys was
2108 used for the encapsulation operation. As an example, applications may send this
2109 information alongside a ciphertext from the sender to the recipient. Specification of
2110 such a mechanism is left to the application. See <a href="#message-encoding" class="xref">Section 10</a> for more
2111 details.<a href="#section-5-7" class="pilcrow">¶</a></p>
2112 <p id="section-5-8">Note that some KEMs may not support <code>AuthEncap()</code> or <code>AuthDecap()</code>.
2113 For such KEMs, only <code>mode_base</code> or <code>mode_psk</code> are supported. Future specifications
2114 which define new KEMs <span class="bcp14">MUST</span> indicate whether these modes are supported.
2115 See <a href="#future-kems" class="xref">Section 7.1.5</a> for more details.<a href="#section-5-8" class="pilcrow">¶</a></p>
2116 <p id="section-5-9">The procedures described in this section are laid out in a
2117 Python-like pseudocode. The algorithms in use are left implicit.<a href="#section-5-9" class="pilcrow">¶</a></p>
2118 <div id="encryption-context">
2119 <section id="section-5.1">
2120 <h3 id="name-creating-the-encryption-con">
2121 <a href="#section-5.1" class="section-number selfRef">5.1. </a><a href="#name-creating-the-encryption-con" class="section-name selfRef">Creating the Encryption Context</a>
2122 </h3>
2123 <p id="section-5.1-1">The variants of HPKE defined in this document share a common
2124 key schedule that translates the protocol inputs into an encryption
2125 context. The key schedule inputs are as follows:<a href="#section-5.1-1" class="pilcrow">¶</a></p>
2126 <ul class="normal">
2127 <li class="normal" id="section-5.1-2.1">
2128 <code>mode</code>: A one-byte value indicating the HPKE mode, defined in <a href="#hpke-modes" class="xref">Table 1</a>.<a href="#section-5.1-2.1" class="pilcrow">¶</a>
2129 </li>
2130 <li class="normal" id="section-5.1-2.2">
2131 <code>shared_secret</code>: A KEM shared secret generated for this transaction.<a href="#section-5.1-2.2" class="pilcrow">¶</a>
2132 </li>
2133 <li class="normal" id="section-5.1-2.3">
2134 <code>info</code>: Application-supplied information (optional; default value "").<a href="#section-5.1-2.3" class="pilcrow">¶</a>
2135 </li>
2136 <li class="normal" id="section-5.1-2.4">
2137 <code>psk</code> A pre-shared key (PSK) held by both the sender and the recipient (optional;
2138 default value "").<a href="#section-5.1-2.4" class="pilcrow">¶</a>
2139 </li>
2140 <li class="normal" id="section-5.1-2.5">
2141 <code>psk_id</code>: An identifier for the PSK (optional; default value "").<a href="#section-5.1-2.5" class="pilcrow">¶</a>
2142 </li>
2143 </ul>
2144 <p id="section-5.1-3">Senders and recipients <span class="bcp14">MUST</span> validate KEM inputs and outputs as described
2145 in <a href="#kem-ids" class="xref">Section 7.1</a>.<a href="#section-5.1-3" class="pilcrow">¶</a></p>
2146 <p id="section-5.1-4">The <code>psk</code> and <code>psk_id</code> fields <span class="bcp14">MUST</span> appear together or not at all.
2147 That is, if a non-default value is provided for one of them, then
2148 the other <span class="bcp14">MUST</span> be set to a non-default value. This requirement is
2149 encoded in <code>VerifyPSKInputs()</code> below.<a href="#section-5.1-4" class="pilcrow">¶</a></p>
2150 <p id="section-5.1-5">The <code>psk</code>, <code>psk_id</code>, and <code>info</code> fields have maximum lengths that depend
2151 on the KDF itself, on the definition of <code>LabeledExtract()</code>, and on the
2152 constant labels used together with them. See <a href="#kdf-input-length" class="xref">Section 7.2.1</a> for
2153 precise limits on these lengths.<a href="#section-5.1-5" class="pilcrow">¶</a></p>
2154 <p id="section-5.1-6">The <code>key</code>, <code>base_nonce</code>, and <code>exporter_secret</code> computed by the key schedule
2155 have the property that they are only known to the holder of the recipient
2156 private key, and the entity that used the KEM to generate <code>shared_secret</code> and
2157 <code>enc</code>.<a href="#section-5.1-6" class="pilcrow">¶</a></p>
2158 <p id="section-5.1-7">In the Auth and AuthPSK modes, the recipient is assured that the sender
2159 held the private key <code>skS</code>. This assurance is limited for the DHKEM
2160 variants defined in this document because of key-compromise impersonation,
2161 as described in Sections <a href="#dhkem" class="xref">4.1</a> and <a href="#sec-properties" class="xref">9.1</a>. If in the PSK and
2162 AuthPSK modes, the <code>psk</code> and <code>psk_id</code> arguments are provided as required,
2163 then the recipient is assured that the sender held the corresponding
2164 pre-shared key. See <a href="#sec-properties" class="xref">Section 9.1</a> for more details.<a href="#section-5.1-7" class="pilcrow">¶</a></p>
2165 <p id="section-5.1-8">The HPKE algorithm identifiers, i.e., the KEM <code>kem_id</code>, KDF <code>kdf_id</code>, and
2166 AEAD <code>aead_id</code> 2-byte code points, as defined in Tables <a href="#kemid-values" class="xref">2</a>, <a href="#kdfid-values" class="xref">3</a>,
2167 and <a href="#aeadid-values" class="xref">5</a>, respectively, are assumed implicit from the implementation
2168 and not passed as parameters. The implicit <code>suite_id</code> value used within
2169 <code>LabeledExtract</code> and <code>LabeledExpand</code> is defined based on them as follows:<a href="#section-5.1-8" class="pilcrow">¶</a></p>
2170 <div id="section-5.1-9">
2171 <pre class="lang-pseudocode sourcecode">
2172 suite_id = concat(
2173 "HPKE",
2174 I2OSP(kem_id, 2),
2175 I2OSP(kdf_id, 2),
2176 I2OSP(aead_id, 2)
2177 )
2178 </pre><a href="#section-5.1-9" class="pilcrow">¶</a>
2179 </div>
2180 <div id="section-5.1-10">
2181 <pre class="lang-pseudocode sourcecode">
2182 default_psk = ""
2183 default_psk_id = ""
2184
2185 def VerifyPSKInputs(mode, psk, psk_id):
2186 got_psk = (psk != default_psk)
2187 got_psk_id = (psk_id != default_psk_id)
2188 if got_psk != got_psk_id:
2189 raise Exception("Inconsistent PSK inputs")
2190
2191 if got_psk and (mode in [mode_base, mode_auth]):
2192 raise Exception("PSK input provided when not needed")
2193 if (not got_psk) and (mode in [mode_psk, mode_auth_psk]):
2194 raise Exception("Missing required PSK input")
2195
2196 def KeySchedule&lt;ROLE&gt;(mode, shared_secret, info, psk, psk_id):
2197 VerifyPSKInputs(mode, psk, psk_id)
2198
2199 psk_id_hash = LabeledExtract("", "psk_id_hash", psk_id)
2200 info_hash = LabeledExtract("", "info_hash", info)
2201 key_schedule_context = concat(mode, psk_id_hash, info_hash)
2202
2203 secret = LabeledExtract(shared_secret, "secret", psk)
2204
2205 key = LabeledExpand(secret, "key", key_schedule_context, Nk)
2206 base_nonce = LabeledExpand(secret, "base_nonce",
2207 key_schedule_context, Nn)
2208 exporter_secret = LabeledExpand(secret, "exp",
2209 key_schedule_context, Nh)
2210
2211 return Context&lt;ROLE&gt;(key, base_nonce, 0, exporter_secret)
2212 </pre><a href="#section-5.1-10" class="pilcrow">¶</a>
2213 </div>
2214 <p id="section-5.1-11">The <code>ROLE</code> template parameter is either S or R, depending on the role of
2215 sender or recipient, respectively. See <a href="#hpke-dem" class="xref">Section 5.2</a> for a discussion of the
2216 key schedule output, including the role-specific <code>Context</code> structure and its API.<a href="#section-5.1-11" class="pilcrow">¶</a></p>
2217 <p id="section-5.1-12">Note that the <code>key_schedule_context</code> construction in <code>KeySchedule()</code> is
2218 equivalent to serializing a structure of the following form in the TLS presentation
2219 syntax:<a href="#section-5.1-12" class="pilcrow">¶</a></p>
2220 <div id="section-5.1-13">
2221 <pre class="lang-pseudocode sourcecode">
2222 struct {
2223 uint8 mode;
2224 opaque psk_id_hash[Nh];
2225 opaque info_hash[Nh];
2226 } KeyScheduleContext;
2227 </pre><a href="#section-5.1-13" class="pilcrow">¶</a>
2228 </div>
2229 <div id="hpke-kem">
2230 <section id="section-5.1.1">
2231 <h4 id="name-encryption-to-a-public-key">
2232 <a href="#section-5.1.1" class="section-number selfRef">5.1.1. </a><a href="#name-encryption-to-a-public-key" class="section-name selfRef">Encryption to a Public Key</a>
2233 </h4>
2234 <p id="section-5.1.1-1">The most basic function of an HPKE scheme is to enable encryption
2235 to the holder of a given KEM private key. The <code>SetupBaseS()</code> and
2236 <code>SetupBaseR()</code> procedures establish contexts that can be used to
2237 encrypt and decrypt, respectively, for a given private key.<a href="#section-5.1.1-1" class="pilcrow">¶</a></p>
2238 <p id="section-5.1.1-2">The KEM shared secret is combined via the KDF
2239 with information describing the key exchange, as well as the
2240 explicit <code>info</code> parameter provided by the caller.<a href="#section-5.1.1-2" class="pilcrow">¶</a></p>
2241 <p id="section-5.1.1-3">The parameter <code>pkR</code> is a public key, and <code>enc</code> is an encapsulated
2242 KEM shared secret.<a href="#section-5.1.1-3" class="pilcrow">¶</a></p>
2243 <div id="section-5.1.1-4">
2244 <pre class="sourcecode">
2245 def SetupBaseS(pkR, info):
2246 shared_secret, enc = Encap(pkR)
2247 return enc, KeyScheduleS(mode_base, shared_secret, info,
2248 default_psk, default_psk_id)
2249
2250 def SetupBaseR(enc, skR, info):
2251 shared_secret = Decap(enc, skR)
2252 return KeyScheduleR(mode_base, shared_secret, info,
2253 default_psk, default_psk_id)
2254 </pre><a href="#section-5.1.1-4" class="pilcrow">¶</a>
2255 </div>
2256 </section>
2257 </div>
2258 <div id="mode-psk">
2259 <section id="section-5.1.2">
2260 <h4 id="name-authentication-using-a-pre-">
2261 <a href="#section-5.1.2" class="section-number selfRef">5.1.2. </a><a href="#name-authentication-using-a-pre-" class="section-name selfRef">Authentication Using a Pre-Shared Key</a>
2262 </h4>
2263 <p id="section-5.1.2-1">This variant extends the base mechanism by allowing the recipient to
2264 authenticate that the sender possessed a given PSK. The PSK also
2265 improves confidentiality guarantees in certain adversary models, as
2266 described in more detail in <a href="#sec-properties" class="xref">Section 9.1</a>. We assume that both
2267 parties have been provisioned with both the PSK value <code>psk</code> and another
2268 byte string <code>psk_id</code> that is used to identify which PSK should be used.<a href="#section-5.1.2-1" class="pilcrow">¶</a></p>
2269 <p id="section-5.1.2-2">The primary difference from the base case is that the <code>psk</code> and <code>psk_id</code> values
2270 are used as <code>ikm</code> inputs to the KDF (instead of using the empty string).<a href="#section-5.1.2-2" class="pilcrow">¶</a></p>
2271 <p id="section-5.1.2-3">The PSK <span class="bcp14">MUST</span> have at least 32 bytes of entropy and <span class="bcp14">SHOULD</span> be of length <code>Nh</code>
2272 bytes or longer. See <a href="#security-psk" class="xref">Section 9.5</a> for a more detailed discussion.<a href="#section-5.1.2-3" class="pilcrow">¶</a></p>
2273 <div id="section-5.1.2-4">
2274 <pre class="lang-pseudocode sourcecode">
2275 def SetupPSKS(pkR, info, psk, psk_id):
2276 shared_secret, enc = Encap(pkR)
2277 return enc, KeyScheduleS(mode_psk, shared_secret, info,
2278 psk, psk_id)
2279
2280 def SetupPSKR(enc, skR, info, psk, psk_id):
2281 shared_secret = Decap(enc, skR)
2282 return KeyScheduleR(mode_psk, shared_secret, info, psk, psk_id)
2283 </pre><a href="#section-5.1.2-4" class="pilcrow">¶</a>
2284 </div>
2285 </section>
2286 </div>
2287 <div id="mode-auth">
2288 <section id="section-5.1.3">
2289 <h4 id="name-authentication-using-an-asy">
2290 <a href="#section-5.1.3" class="section-number selfRef">5.1.3. </a><a href="#name-authentication-using-an-asy" class="section-name selfRef">Authentication Using an Asymmetric Key</a>
2291 </h4>
2292 <p id="section-5.1.3-1">This variant extends the base mechanism by allowing the recipient
2293 to authenticate that the sender possessed a given KEM private key.
2294 This is because <code>AuthDecap(enc, skR, pkS)</code> produces the correct KEM
2295 shared secret only if the encapsulated value <code>enc</code> was produced by
2296 <code>AuthEncap(pkR, skS)</code>, where <code>skS</code> is the private key corresponding
2297 to <code>pkS</code>. In other words, at most two entities (precisely two, in the case
2298 of DHKEM) could have produced this secret, so if the recipient is at most one, then
2299 the sender is the other with overwhelming probability.<a href="#section-5.1.3-1" class="pilcrow">¶</a></p>
2300 <p id="section-5.1.3-2">The primary difference from the base case is that the calls to
2301 <code>Encap()</code> and <code>Decap()</code> are replaced with calls to <code>AuthEncap()</code> and
2302 <code>AuthDecap()</code>, which add the sender public key to their internal
2303 context string. The function parameters <code>pkR</code> and <code>pkS</code> are
2304 public keys, and <code>enc</code> is an encapsulated KEM shared secret.<a href="#section-5.1.3-2" class="pilcrow">¶</a></p>
2305 <p id="section-5.1.3-3">Obviously, this variant can only be used with a KEM that provides
2306 <code>AuthEncap()</code> and <code>AuthDecap()</code> procedures.<a href="#section-5.1.3-3" class="pilcrow">¶</a></p>
2307 <p id="section-5.1.3-4">This mechanism authenticates only the key pair of the sender, not
2308 any other identifier. If an application wishes to bind HPKE
2309 ciphertexts or exported secrets to another identity for the sender
2310 (e.g., an email address or domain name), then this identifier should be
2311 included in the <code>info</code> parameter to avoid identity misbinding issues <span>[<a href="#IMB" class="xref">IMB</a>]</span>.<a href="#section-5.1.3-4" class="pilcrow">¶</a></p>
2312 <div id="section-5.1.3-5">
2313 <pre class="lang-pseudocode sourcecode">
2314 def SetupAuthS(pkR, info, skS):
2315 shared_secret, enc = AuthEncap(pkR, skS)
2316 return enc, KeyScheduleS(mode_auth, shared_secret, info,
2317 default_psk, default_psk_id)
2318
2319 def SetupAuthR(enc, skR, info, pkS):
2320 shared_secret = AuthDecap(enc, skR, pkS)
2321 return KeyScheduleR(mode_auth, shared_secret, info,
2322 default_psk, default_psk_id)
2323 </pre><a href="#section-5.1.3-5" class="pilcrow">¶</a>
2324 </div>
2325 </section>
2326 </div>
2327 <div id="mode-auth-psk">
2328 <section id="section-5.1.4">
2329 <h4 id="name-authentication-using-both-a">
2330 <a href="#section-5.1.4" class="section-number selfRef">5.1.4. </a><a href="#name-authentication-using-both-a" class="section-name selfRef">Authentication Using Both a PSK and an Asymmetric Key</a>
2331 </h4>
2332 <p id="section-5.1.4-1">This mode is a straightforward combination of the PSK and
2333 authenticated modes. Like the PSK mode, a PSK is provided as input to the key schedule,
2334 and like the authenticated mode, authenticated KEM variants are used.<a href="#section-5.1.4-1" class="pilcrow">¶</a></p>
2335 <div id="section-5.1.4-2">
2336 <pre class="lang-pseudocode sourcecode">
2337 def SetupAuthPSKS(pkR, info, psk, psk_id, skS):
2338 shared_secret, enc = AuthEncap(pkR, skS)
2339 return enc, KeyScheduleS(mode_auth_psk, shared_secret, info,
2340 psk, psk_id)
2341
2342 def SetupAuthPSKR(enc, skR, info, psk, psk_id, pkS):
2343 shared_secret = AuthDecap(enc, skR, pkS)
2344 return KeyScheduleR(mode_auth_psk, shared_secret, info,
2345 psk, psk_id)
2346 </pre><a href="#section-5.1.4-2" class="pilcrow">¶</a>
2347 </div>
2348 <p id="section-5.1.4-3">The PSK <span class="bcp14">MUST</span> have at least 32 bytes of entropy and <span class="bcp14">SHOULD</span> be of length <code>Nh</code>
2349 bytes or longer. See <a href="#security-psk" class="xref">Section 9.5</a> for a more detailed discussion.<a href="#section-5.1.4-3" class="pilcrow">¶</a></p>
2350 </section>
2351 </div>
2352 </section>
2353 </div>
2354 <div id="hpke-dem">
2355 <section id="section-5.2">
2356 <h3 id="name-encryption-and-decryption">
2357 <a href="#section-5.2" class="section-number selfRef">5.2. </a><a href="#name-encryption-and-decryption" class="section-name selfRef">Encryption and Decryption</a>
2358 </h3>
2359 <p id="section-5.2-1">HPKE allows multiple encryption operations to be done based on a
2360 given setup transaction. Since the public key operations involved
2361 in setup are typically more expensive than symmetric encryption or
2362 decryption, this allows applications to amortize the cost of the
2363 public key operations, reducing the overall overhead.<a href="#section-5.2-1" class="pilcrow">¶</a></p>
2364 <p id="section-5.2-2">In order to avoid nonce reuse, however, this encryption must be
2365 stateful. Each of the setup procedures above produces a role-specific
2366 context object that stores the AEAD and secret export parameters.
2367 The AEAD parameters consist of:<a href="#section-5.2-2" class="pilcrow">¶</a></p>
2368 <ul class="normal">
2369 <li class="normal" id="section-5.2-3.1">The AEAD algorithm in use<a href="#section-5.2-3.1" class="pilcrow">¶</a>
2370 </li>
2371 <li class="normal" id="section-5.2-3.2">A secret <code>key</code><a href="#section-5.2-3.2" class="pilcrow">¶</a>
2372 </li>
2373 <li class="normal" id="section-5.2-3.3">A base nonce <code>base_nonce</code><a href="#section-5.2-3.3" class="pilcrow">¶</a>
2374 </li>
2375 <li class="normal" id="section-5.2-3.4">A sequence number (initially 0)<a href="#section-5.2-3.4" class="pilcrow">¶</a>
2376 </li>
2377 </ul>
2378 <p id="section-5.2-4">The secret export parameters consist of:<a href="#section-5.2-4" class="pilcrow">¶</a></p>
2379 <ul class="normal">
2380 <li class="normal" id="section-5.2-5.1">The HPKE ciphersuite in use and<a href="#section-5.2-5.1" class="pilcrow">¶</a>
2381 </li>
2382 <li class="normal" id="section-5.2-5.2">An <code>exporter_secret</code> used for the secret export interface (see
2383 <a href="#hpke-export" class="xref">Section 5.3</a>)<a href="#section-5.2-5.2" class="pilcrow">¶</a>
2384 </li>
2385 </ul>
2386 <p id="section-5.2-6">All these parameters except the AEAD sequence number are constant.
2387 The sequence number provides nonce uniqueness: The nonce used for
2388 each encryption or decryption operation is the result of XORing
2389 <code>base_nonce</code> with the current sequence number, encoded as a big-endian
2390 integer of the same length as <code>base_nonce</code>. Implementations <span class="bcp14">MAY</span> use a
2391 sequence number that is shorter than the nonce length (padding on the left
2392 with zero), but <span class="bcp14">MUST</span> raise an error if the sequence number overflows. The AEAD
2393 algorithm produces ciphertext that is Nt bytes longer than the plaintext.
2394 Nt = 16 for AEAD algorithms defined in this document.<a href="#section-5.2-6" class="pilcrow">¶</a></p>
2395 <p id="section-5.2-7">Encryption is unidirectional from sender to recipient. The sender's
2396 context can encrypt a plaintext <code>pt</code> with associated data <code>aad</code> as
2397 follows:<a href="#section-5.2-7" class="pilcrow">¶</a></p>
2398 <div id="section-5.2-8">
2399 <pre class="lang-pseudocode sourcecode">
2400 def ContextS.Seal(aad, pt):
2401 ct = Seal(self.key, self.ComputeNonce(self.seq), aad, pt)
2402 self.IncrementSeq()
2403 return ct
2404 </pre><a href="#section-5.2-8" class="pilcrow">¶</a>
2405 </div>
2406 <p id="section-5.2-9">The recipient's context can decrypt a ciphertext <code>ct</code> with associated
2407 data <code>aad</code> as follows:<a href="#section-5.2-9" class="pilcrow">¶</a></p>
2408 <div id="section-5.2-10">
2409 <pre class="lang-pseudocode sourcecode">
2410 def ContextR.Open(aad, ct):
2411 pt = Open(self.key, self.ComputeNonce(self.seq), aad, ct)
2412 if pt == OpenError:
2413 raise OpenError
2414 self.IncrementSeq()
2415 return pt
2416 </pre><a href="#section-5.2-10" class="pilcrow">¶</a>
2417 </div>
2418 <p id="section-5.2-11">Each encryption or decryption operation increments the sequence number for
2419 the context in use. The per-message nonce and sequence number increment
2420 details are as follows:<a href="#section-5.2-11" class="pilcrow">¶</a></p>
2421 <div id="section-5.2-12">
2422 <pre class="lang-pseudocode sourcecode">
2423 def Context&lt;ROLE&gt;.ComputeNonce(seq):
2424 seq_bytes = I2OSP(seq, Nn)
2425 return xor(self.base_nonce, seq_bytes)
2426
2427 def Context&lt;ROLE&gt;.IncrementSeq():
2428 if self.seq &gt;= (1 &lt;&lt; (8*Nn)) - 1:
2429 raise MessageLimitReachedError
2430 self.seq += 1
2431 </pre><a href="#section-5.2-12" class="pilcrow">¶</a>
2432 </div>
2433 <p id="section-5.2-13">The sender's context <span class="bcp14">MUST NOT</span> be used for decryption. Similarly, the recipient's
2434 context <span class="bcp14">MUST NOT</span> be used for encryption. Higher-level protocols reusing the HPKE
2435 key exchange for more general purposes can derive separate keying material as
2436 needed using use the secret export interface; see Sections <a href="#hpke-export" class="xref">5.3</a> and <a href="#bidirectional" class="xref">9.8</a>
2437 for more details.<a href="#section-5.2-13" class="pilcrow">¶</a></p>
2438 <p id="section-5.2-14">It is up to the application to ensure that encryptions and decryptions are
2439 done in the proper sequence, so that encryption and decryption nonces align.
2440 If <code>ContextS.Seal()</code> or <code>ContextR.Open()</code> would cause the <code>seq</code> field to
2441 overflow, then the implementation <span class="bcp14">MUST</span> fail with an error. (In the pseudocode
2442 below, <code>Context&lt;ROLE&gt;.IncrementSeq()</code> fails with an error when <code>seq</code> overflows,
2443 which causes <code>ContextS.Seal()</code> and <code>ContextR.Open()</code> to fail accordingly.)
2444 Note that the internal <code>Seal()</code> and <code>Open()</code> calls inside correspond to the
2445 context's AEAD algorithm.<a href="#section-5.2-14" class="pilcrow">¶</a></p>
2446 </section>
2447 </div>
2448 <div id="hpke-export">
2449 <section id="section-5.3">
2450 <h3 id="name-secret-export">
2451 <a href="#section-5.3" class="section-number selfRef">5.3. </a><a href="#name-secret-export" class="section-name selfRef">Secret Export</a>
2452 </h3>
2453 <p id="section-5.3-1">HPKE provides an interface for exporting secrets from the encryption context
2454 using a variable-length pseudorandom function (PRF), similar to the TLS 1.3 exporter interface
2455 (see <span>[<a href="#RFC8446" class="xref">RFC8446</a>], <a href="https://www.rfc-editor.org/rfc/rfc8446#section-7.5" class="relref">Section 7.5</a></span>). This interface takes as input a context
2456 string <code>exporter_context</code> and a desired length <code>L</code> in bytes, and produces
2457 a secret derived from the internal exporter secret using the corresponding
2458 KDF Expand function. For the KDFs defined in this specification, <code>L</code> has
2459 a maximum value of <code>255*Nh</code>. Future specifications that define new KDFs
2460 <span class="bcp14">MUST</span> specify a bound for <code>L</code>.<a href="#section-5.3-1" class="pilcrow">¶</a></p>
2461 <p id="section-5.3-2">The <code>exporter_context</code> field has a maximum length that depends on the KDF
2462 itself, on the definition of <code>LabeledExpand()</code>, and on the constant labels
2463 used together with them. See <a href="#kdf-input-length" class="xref">Section 7.2.1</a> for precise limits on this
2464 length.<a href="#section-5.3-2" class="pilcrow">¶</a></p>
2465 <div id="section-5.3-3">
2466 <pre class="lang-pseudocode sourcecode">
2467 def Context.Export(exporter_context, L):
2468 return LabeledExpand(self.exporter_secret, "sec",
2469 exporter_context, L)
2470 </pre><a href="#section-5.3-3" class="pilcrow">¶</a>
2471 </div>
2472 <p id="section-5.3-4">Applications that do not use the encryption API in <a href="#hpke-dem" class="xref">Section 5.2</a> can use
2473 the export-only AEAD ID <code>0xFFFF</code> when computing the key schedule. Such
2474 applications can avoid computing the <code>key</code> and <code>base_nonce</code> values in the
2475 key schedule, as they are not used by the Export interface described above.<a href="#section-5.3-4" class="pilcrow">¶</a></p>
2476 </section>
2477 </div>
2478 </section>
2479 </div>
2480 <div id="single-shot-apis">
2481 <section id="section-6">
2482 <h2 id="name-single-shot-apis">
2483 <a href="#section-6" class="section-number selfRef">6. </a><a href="#name-single-shot-apis" class="section-name selfRef">Single-Shot APIs</a>
2484 </h2>
2485 <div id="single-shot-encryption">
2486 <section id="section-6.1">
2487 <h3 id="name-encryption-and-decryption-2">
2488 <a href="#section-6.1" class="section-number selfRef">6.1. </a><a href="#name-encryption-and-decryption-2" class="section-name selfRef">Encryption and Decryption</a>
2489 </h3>
2490 <p id="section-6.1-1">In many cases, applications encrypt only a single message to a recipient's public key.
2491 This section provides templates for HPKE APIs that implement stateless "single-shot"
2492 encryption and decryption using APIs specified in Sections <a href="#hpke-kem" class="xref">5.1.1</a> and <a href="#hpke-dem" class="xref">5.2</a>:<a href="#section-6.1-1" class="pilcrow">¶</a></p>
2493 <div id="section-6.1-2">
2494 <pre class="lang-pseudocode sourcecode">
2495 def Seal&lt;MODE&gt;(pkR, info, aad, pt, ...):
2496 enc, ctx = Setup&lt;MODE&gt;S(pkR, info, ...)
2497 ct = ctx.Seal(aad, pt)
2498 return enc, ct
2499
2500 def Open&lt;MODE&gt;(enc, skR, info, aad, ct, ...):
2501 ctx = Setup&lt;MODE&gt;R(enc, skR, info, ...)
2502 return ctx.Open(aad, ct)
2503 </pre><a href="#section-6.1-2" class="pilcrow">¶</a>
2504 </div>
2505 <p id="section-6.1-3">The <code>MODE</code> template parameter is one of Base, PSK, Auth, or AuthPSK. The optional parameters
2506 indicated by "..." depend on <code>MODE</code> and may be empty. For example, <code>SetupBase()</code> has no
2507 additional parameters. <code>SealAuthPSK()</code> and <code>OpenAuthPSK()</code> would be implemented as follows:<a href="#section-6.1-3" class="pilcrow">¶</a></p>
2508 <div id="section-6.1-4">
2509 <pre class="lang-pseudocode sourcecode">
2510 def SealAuthPSK(pkR, info, aad, pt, psk, psk_id, skS):
2511 enc, ctx = SetupAuthPSKS(pkR, info, psk, psk_id, skS)
2512 ct = ctx.Seal(aad, pt)
2513 return enc, ct
2514
2515 def OpenAuthPSK(enc, skR, info, aad, ct, psk, psk_id, pkS):
2516 ctx = SetupAuthPSKR(enc, skR, info, psk, psk_id, pkS)
2517 return ctx.Open(aad, ct)
2518 </pre><a href="#section-6.1-4" class="pilcrow">¶</a>
2519 </div>
2520 </section>
2521 </div>
2522 <div id="secret-export">
2523 <section id="section-6.2">
2524 <h3 id="name-secret-export-2">
2525 <a href="#section-6.2" class="section-number selfRef">6.2. </a><a href="#name-secret-export-2" class="section-name selfRef">Secret Export</a>
2526 </h3>
2527 <p id="section-6.2-1">Applications may also want to derive a secret known only to a given recipient.
2528 This section provides templates for HPKE APIs that implement stateless
2529 "single-shot" secret export using APIs specified in <a href="#hpke-export" class="xref">Section 5.3</a>:<a href="#section-6.2-1" class="pilcrow">¶</a></p>
2530 <div id="section-6.2-2">
2531 <pre class="lang-pseudocode sourcecode">
2532 def SendExport&lt;MODE&gt;(pkR, info, exporter_context, L, ...):
2533 enc, ctx = Setup&lt;MODE&gt;S(pkR, info, ...)
2534 exported = ctx.Export(exporter_context, L)
2535 return enc, exported
2536
2537 def ReceiveExport&lt;MODE&gt;(enc, skR, info, exporter_context, L, ...):
2538 ctx = Setup&lt;MODE&gt;R(enc, skR, info, ...)
2539 return ctx.Export(exporter_context, L)
2540 </pre><a href="#section-6.2-2" class="pilcrow">¶</a>
2541 </div>
2542 <p id="section-6.2-3">As in <a href="#single-shot-encryption" class="xref">Section 6.1</a>, the <code>MODE</code> template parameter is one of Base, PSK,
2543 Auth, or AuthPSK. The optional parameters indicated by "..." depend on <code>MODE</code> and may
2544 be empty.<a href="#section-6.2-3" class="pilcrow">¶</a></p>
2545 </section>
2546 </div>
2547 </section>
2548 </div>
2549 <div id="ciphersuites">
2550 <section id="section-7">
2551 <h2 id="name-algorithm-identifiers">
2552 <a href="#section-7" class="section-number selfRef">7. </a><a href="#name-algorithm-identifiers" class="section-name selfRef">Algorithm Identifiers</a>
2553 </h2>
2554 <p id="section-7-1">This section lists algorithm identifiers suitable for different HPKE configurations.
2555 Future specifications may introduce new KEM, KDF, and AEAD algorithm identifiers
2556 and retain the security guarantees presented in this document provided they adhere
2557 to the security requirements in Sections <a href="#kem-security" class="xref">9.2</a>, <a href="#kdf-choice" class="xref">9.3</a>, and <a href="#aead-security" class="xref">9.4</a>,
2558 respectively.<a href="#section-7-1" class="pilcrow">¶</a></p>
2559 <div id="kem-ids">
2560 <section id="section-7.1">
2561 <h3 id="name-key-encapsulation-mechanism">
2562 <a href="#section-7.1" class="section-number selfRef">7.1. </a><a href="#name-key-encapsulation-mechanism" class="section-name selfRef">Key Encapsulation Mechanisms (KEMs)</a>
2563 </h3>
2564 <span id="name-kem-ids"></span><div id="kemid-values">
2565 <table class="center" id="table-2">
2566 <caption>
2567 <a href="#table-2" class="selfRef">Table 2</a>:
2568 <a href="#name-kem-ids" class="selfRef">KEM IDs</a>
2569 </caption>
2570 <thead>
2571 <tr>
2572 <th class="text-left" rowspan="1" colspan="1">Value</th>
2573 <th class="text-left" rowspan="1" colspan="1">KEM</th>
2574 <th class="text-left" rowspan="1" colspan="1">Nsecret</th>
2575 <th class="text-left" rowspan="1" colspan="1">Nenc</th>
2576 <th class="text-left" rowspan="1" colspan="1">Npk</th>
2577 <th class="text-left" rowspan="1" colspan="1">Nsk</th>
2578 <th class="text-left" rowspan="1" colspan="1">Auth</th>
2579 <th class="text-left" rowspan="1" colspan="1">Reference</th>
2580 </tr>
2581 </thead>
2582 <tbody>
2583 <tr>
2584 <td class="text-left" rowspan="1" colspan="1">0x0000</td>
2585 <td class="text-left" rowspan="1" colspan="1">Reserved</td>
2586 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2587 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2588 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2589 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2590 <td class="text-left" rowspan="1" colspan="1">yes</td>
2591 <td class="text-left" rowspan="1" colspan="1">RFC 9180</td>
2592 </tr>
2593 <tr>
2594 <td class="text-left" rowspan="1" colspan="1">0x0010</td>
2595 <td class="text-left" rowspan="1" colspan="1">DHKEM(P-256, HKDF-SHA256)</td>
2596 <td class="text-left" rowspan="1" colspan="1">32</td>
2597 <td class="text-left" rowspan="1" colspan="1">65</td>
2598 <td class="text-left" rowspan="1" colspan="1">65</td>
2599 <td class="text-left" rowspan="1" colspan="1">32</td>
2600 <td class="text-left" rowspan="1" colspan="1">yes</td>
2601 <td class="text-left" rowspan="1" colspan="1">
2602 <span>[<a href="#NISTCurves" class="xref">NISTCurves</a>]</span>, <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>
2603 </td>
2604 </tr>
2605 <tr>
2606 <td class="text-left" rowspan="1" colspan="1">0x0011</td>
2607 <td class="text-left" rowspan="1" colspan="1">DHKEM(P-384, HKDF-SHA384)</td>
2608 <td class="text-left" rowspan="1" colspan="1">48</td>
2609 <td class="text-left" rowspan="1" colspan="1">97</td>
2610 <td class="text-left" rowspan="1" colspan="1">97</td>
2611 <td class="text-left" rowspan="1" colspan="1">48</td>
2612 <td class="text-left" rowspan="1" colspan="1">yes</td>
2613 <td class="text-left" rowspan="1" colspan="1">
2614 <span>[<a href="#NISTCurves" class="xref">NISTCurves</a>]</span>, <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>
2615 </td>
2616 </tr>
2617 <tr>
2618 <td class="text-left" rowspan="1" colspan="1">0x0012</td>
2619 <td class="text-left" rowspan="1" colspan="1">DHKEM(P-521, HKDF-SHA512)</td>
2620 <td class="text-left" rowspan="1" colspan="1">64</td>
2621 <td class="text-left" rowspan="1" colspan="1">133</td>
2622 <td class="text-left" rowspan="1" colspan="1">133</td>
2623 <td class="text-left" rowspan="1" colspan="1">66</td>
2624 <td class="text-left" rowspan="1" colspan="1">yes</td>
2625 <td class="text-left" rowspan="1" colspan="1">
2626 <span>[<a href="#NISTCurves" class="xref">NISTCurves</a>]</span>, <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>
2627 </td>
2628 </tr>
2629 <tr>
2630 <td class="text-left" rowspan="1" colspan="1">0x0020</td>
2631 <td class="text-left" rowspan="1" colspan="1">DHKEM(X25519, HKDF-SHA256)</td>
2632 <td class="text-left" rowspan="1" colspan="1">32</td>
2633 <td class="text-left" rowspan="1" colspan="1">32</td>
2634 <td class="text-left" rowspan="1" colspan="1">32</td>
2635 <td class="text-left" rowspan="1" colspan="1">32</td>
2636 <td class="text-left" rowspan="1" colspan="1">yes</td>
2637 <td class="text-left" rowspan="1" colspan="1">
2638 <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>, <span>[<a href="#RFC7748" class="xref">RFC7748</a>]</span>
2639 </td>
2640 </tr>
2641 <tr>
2642 <td class="text-left" rowspan="1" colspan="1">0x0021</td>
2643 <td class="text-left" rowspan="1" colspan="1">DHKEM(X448, HKDF-SHA512)</td>
2644 <td class="text-left" rowspan="1" colspan="1">64</td>
2645 <td class="text-left" rowspan="1" colspan="1">56</td>
2646 <td class="text-left" rowspan="1" colspan="1">56</td>
2647 <td class="text-left" rowspan="1" colspan="1">56</td>
2648 <td class="text-left" rowspan="1" colspan="1">yes</td>
2649 <td class="text-left" rowspan="1" colspan="1">
2650 <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>, <span>[<a href="#RFC7748" class="xref">RFC7748</a>]</span>
2651 </td>
2652 </tr>
2653 </tbody>
2654 </table>
2655 </div>
2656 <p id="section-7.1-2">The <code>Auth</code> column indicates if the KEM algorithm provides the <code>AuthEncap()</code>/<code>AuthDecap()</code>
2657 interface and is therefore suitable for the Auth and AuthPSK modes. The meaning of all
2658 other columns is explained in <a href="#kem-template" class="xref">Section 11.1</a>. All algorithms are suitable for the
2659 PSK mode.<a href="#section-7.1-2" class="pilcrow">¶</a></p>
2660 <div id="serializepublickey-and-deserializepublickey">
2661 <section id="section-7.1.1">
2662 <h4 id="name-serializepublickey-and-dese">
2663 <a href="#section-7.1.1" class="section-number selfRef">7.1.1. </a><a href="#name-serializepublickey-and-dese" class="section-name selfRef">SerializePublicKey and DeserializePublicKey</a>
2664 </h4>
2665 <p id="section-7.1.1-1">For P-256, P-384, and P-521, the <code>SerializePublicKey()</code> function of the
2666 KEM performs the uncompressed Elliptic-Curve-Point-to-Octet-String
2667 conversion according to <span>[<a href="#SECG" class="xref">SECG</a>]</span>. <code>DeserializePublicKey()</code> performs the
2668 uncompressed Octet-String-to-Elliptic-Curve-Point conversion.<a href="#section-7.1.1-1" class="pilcrow">¶</a></p>
2669 <p id="section-7.1.1-2">For X25519 and X448, the <code>SerializePublicKey()</code> and <code>DeserializePublicKey()</code>
2670 functions are the identity function, since these curves already use
2671 fixed-length byte strings for public keys.<a href="#section-7.1.1-2" class="pilcrow">¶</a></p>
2672 <p id="section-7.1.1-3">Some deserialized public keys <span class="bcp14">MUST</span> be validated before they can be used. See
2673 <a href="#validation" class="xref">Section 7.1.4</a> for specifics.<a href="#section-7.1.1-3" class="pilcrow">¶</a></p>
2674 </section>
2675 </div>
2676 <div id="serializeprivatekey">
2677 <section id="section-7.1.2">
2678 <h4 id="name-serializeprivatekey-and-des">
2679 <a href="#section-7.1.2" class="section-number selfRef">7.1.2. </a><a href="#name-serializeprivatekey-and-des" class="section-name selfRef">SerializePrivateKey and DeserializePrivateKey</a>
2680 </h4>
2681 <p id="section-7.1.2-1">As per <span>[<a href="#SECG" class="xref">SECG</a>]</span>, P-256, P-384, and P-521 private keys are field elements in the
2682 scalar field of the curve being used. For this section, and for
2683 <a href="#derive-key-pair" class="xref">Section 7.1.3</a>, it is assumed that implementors of ECDH over these curves
2684 use an integer representation of private keys that is compatible with the
2685 <code>OS2IP()</code> function.<a href="#section-7.1.2-1" class="pilcrow">¶</a></p>
2686 <p id="section-7.1.2-2">For P-256, P-384, and P-521, the <code>SerializePrivateKey()</code> function of the KEM
2687 performs the Field-Element-to-Octet-String conversion according to <span>[<a href="#SECG" class="xref">SECG</a>]</span>. If
2688 the private key is an integer outside the range <code>[0, order-1]</code>, where <code>order</code>
2689 is the order of the curve being used, the private key <span class="bcp14">MUST</span> be reduced to its
2690 representative in <code>[0, order-1]</code> before being serialized.
2691 <code>DeserializePrivateKey()</code> performs the Octet-String-to-Field-Element conversion
2692 according to <span>[<a href="#SECG" class="xref">SECG</a>]</span>.<a href="#section-7.1.2-2" class="pilcrow">¶</a></p>
2693 <p id="section-7.1.2-3">For X25519 and X448, private keys are identical to their byte string
2694 representation, so little processing has to be done. The
2695 <code>SerializePrivateKey()</code> function <span class="bcp14">MUST</span> clamp its output and the
2696 <code>DeserializePrivateKey()</code> function <span class="bcp14">MUST</span> clamp its input, where <em>clamping</em> refers to the
2697 bitwise operations performed on <code>k</code> in the <code>decodeScalar25519()</code> and
2698 <code>decodeScalar448()</code> functions defined in <span><a href="https://www.rfc-editor.org/rfc/rfc7748#section-5" class="relref">Section 5</a> of [<a href="#RFC7748" class="xref">RFC7748</a>]</span>.<a href="#section-7.1.2-3" class="pilcrow">¶</a></p>
2699 <p id="section-7.1.2-4">To catch invalid keys early on, implementors of DHKEMs <span class="bcp14">SHOULD</span> check that
2700 deserialized private keys are not equivalent to 0 (mod <code>order</code>), where <code>order</code>
2701 is the order of the DH group. Note that this property is trivially true for X25519
2702 and X448 groups, since clamped values can never be 0 (mod <code>order</code>).<a href="#section-7.1.2-4" class="pilcrow">¶</a></p>
2703 </section>
2704 </div>
2705 <div id="derive-key-pair">
2706 <section id="section-7.1.3">
2707 <h4 id="name-derivekeypair">
2708 <a href="#section-7.1.3" class="section-number selfRef">7.1.3. </a><a href="#name-derivekeypair" class="section-name selfRef">DeriveKeyPair</a>
2709 </h4>
2710 <p id="section-7.1.3-1">The keys that <code>DeriveKeyPair()</code> produces have only as much entropy as the provided
2711 input keying material. For a given KEM, the <code>ikm</code> parameter given to <code>DeriveKeyPair()</code> <span class="bcp14">SHOULD</span>
2712 have length at least <code>Nsk</code>, and <span class="bcp14">SHOULD</span> have at least <code>Nsk</code> bytes of entropy.<a href="#section-7.1.3-1" class="pilcrow">¶</a></p>
2713 <p id="section-7.1.3-2">All invocations of KDF functions (such as <code>LabeledExtract</code> or <code>LabeledExpand</code>) in any
2714 DHKEM's <code>DeriveKeyPair()</code> function use the DHKEM's associated KDF (as opposed to
2715 the ciphersuite's KDF).<a href="#section-7.1.3-2" class="pilcrow">¶</a></p>
2716 <p id="section-7.1.3-3">For P-256, P-384, and P-521, the <code>DeriveKeyPair()</code> function of the KEM performs
2717 rejection sampling over field elements:<a href="#section-7.1.3-3" class="pilcrow">¶</a></p>
2718 <div id="section-7.1.3-4">
2719 <pre class="lang-pseudocode sourcecode">
2720 def DeriveKeyPair(ikm):
2721 dkp_prk = LabeledExtract("", "dkp_prk", ikm)
2722 sk = 0
2723 counter = 0
2724 while sk == 0 or sk &gt;= order:
2725 if counter &gt; 255:
2726 raise DeriveKeyPairError
2727 bytes = LabeledExpand(dkp_prk, "candidate",
2728 I2OSP(counter, 1), Nsk)
2729 bytes[0] = bytes[0] &amp; bitmask
2730 sk = OS2IP(bytes)
2731 counter = counter + 1
2732 return (sk, pk(sk))
2733 </pre><a href="#section-7.1.3-4" class="pilcrow">¶</a>
2734 </div>
2735 <p id="section-7.1.3-5"><code>order</code> is the order of the curve being used (see Section D.1.2 of <span>[<a href="#NISTCurves" class="xref">NISTCurves</a>]</span>), and
2736 is listed below for completeness.<a href="#section-7.1.3-5" class="pilcrow">¶</a></p>
2737 <div class="alignLeft art-text artwork" id="section-7.1.3-6">
2738 <pre>
2739 P-256:
2740 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551
2741
2742 P-384:
2743 0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf
2744 581a0db248b0a77aecec196accc52973
2745
2746 P-521:
2747 0x01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
2748 fa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409
2749 </pre><a href="#section-7.1.3-6" class="pilcrow">¶</a>
2750 </div>
2751 <p id="section-7.1.3-7"><code>bitmask</code> is defined to be 0xFF for P-256 and P-384, and 0x01 for P-521.
2752 The precise likelihood of <code>DeriveKeyPair()</code> failing with DeriveKeyPairError
2753 depends on the group being used, but it is negligibly small in all cases.
2754 See <a href="#api-errors" class="xref">Section 8.2</a> for information about dealing with such failures.<a href="#section-7.1.3-7" class="pilcrow">¶</a></p>
2755 <p id="section-7.1.3-8">For X25519 and X448, the <code>DeriveKeyPair()</code> function applies a KDF to the input:<a href="#section-7.1.3-8" class="pilcrow">¶</a></p>
2756 <div id="section-7.1.3-9">
2757 <pre class="lang-pseudocode sourcecode">
2758 def DeriveKeyPair(ikm):
2759 dkp_prk = LabeledExtract("", "dkp_prk", ikm)
2760 sk = LabeledExpand(dkp_prk, "sk", "", Nsk)
2761 return (sk, pk(sk))
2762 </pre><a href="#section-7.1.3-9" class="pilcrow">¶</a>
2763 </div>
2764 </section>
2765 </div>
2766 <div id="validation">
2767 <section id="section-7.1.4">
2768 <h4 id="name-validation-of-inputs-and-ou">
2769 <a href="#section-7.1.4" class="section-number selfRef">7.1.4. </a><a href="#name-validation-of-inputs-and-ou" class="section-name selfRef">Validation of Inputs and Outputs</a>
2770 </h4>
2771 <p id="section-7.1.4-1">The following public keys are subject to validation if the group
2772 requires public key validation: the sender <span class="bcp14">MUST</span> validate the recipient's
2773 public key <code>pkR</code>; the recipient <span class="bcp14">MUST</span> validate the ephemeral public key
2774 <code>pkE</code>; in authenticated modes, the recipient <span class="bcp14">MUST</span> validate the sender's
2775 static public key <code>pkS</code>. Validation failure yields a <code>ValidationError</code>.<a href="#section-7.1.4-1" class="pilcrow">¶</a></p>
2776 <p id="section-7.1.4-2">For P-256, P-384, and P-521, senders and recipients <span class="bcp14">MUST</span> perform partial
2777 public key validation on all public key inputs, as defined in Section 5.6.2.3.4 of <span>[<a href="#keyagreement" class="xref">keyagreement</a>]</span>. This includes checking that the coordinates are in the
2778 correct range, that the point is on the curve, and that the point is not the
2779 point at infinity. Additionally, senders and recipients <span class="bcp14">MUST</span> ensure the
2780 Diffie-Hellman shared secret is not the point at infinity.<a href="#section-7.1.4-2" class="pilcrow">¶</a></p>
2781 <p id="section-7.1.4-3">For X25519 and X448, public keys and Diffie-Hellman outputs <span class="bcp14">MUST</span> be validated
2782 as described in <span>[<a href="#RFC7748" class="xref">RFC7748</a>]</span>. In particular, recipients <span class="bcp14">MUST</span> check whether
2783 the Diffie-Hellman shared secret is the all-zero value and abort if so.<a href="#section-7.1.4-3" class="pilcrow">¶</a></p>
2784 </section>
2785 </div>
2786 <div id="future-kems">
2787 <section id="section-7.1.5">
2788 <h4 id="name-future-kems">
2789 <a href="#section-7.1.5" class="section-number selfRef">7.1.5. </a><a href="#name-future-kems" class="section-name selfRef">Future KEMs</a>
2790 </h4>
2791 <p id="section-7.1.5-1"><a href="#kem-security" class="xref">Section 9.2</a> lists security requirements on a KEM used within HPKE.<a href="#section-7.1.5-1" class="pilcrow">¶</a></p>
2792 <p id="section-7.1.5-2">The <code>AuthEncap()</code> and <code>AuthDecap()</code> functions are <span class="bcp14">OPTIONAL</span>. If a KEM algorithm
2793 does not provide them, only the Base and PSK modes of HPKE are supported.
2794 Future specifications that define new KEMs <span class="bcp14">MUST</span> indicate whether or not
2795 Auth and AuthPSK modes are supported.<a href="#section-7.1.5-2" class="pilcrow">¶</a></p>
2796 <p id="section-7.1.5-3">A KEM algorithm may support different encoding algorithms, with different output
2797 lengths, for KEM public keys. Such KEM algorithms <span class="bcp14">MUST</span> specify only one encoding
2798 algorithm whose output length is <code>Npk</code>.<a href="#section-7.1.5-3" class="pilcrow">¶</a></p>
2799 </section>
2800 </div>
2801 </section>
2802 </div>
2803 <div id="kdf-ids">
2804 <section id="section-7.2">
2805 <h3 id="name-key-derivation-functions-kd">
2806 <a href="#section-7.2" class="section-number selfRef">7.2. </a><a href="#name-key-derivation-functions-kd" class="section-name selfRef">Key Derivation Functions (KDFs)</a>
2807 </h3>
2808 <span id="name-kdf-ids"></span><div id="kdfid-values">
2809 <table class="center" id="table-3">
2810 <caption>
2811 <a href="#table-3" class="selfRef">Table 3</a>:
2812 <a href="#name-kdf-ids" class="selfRef">KDF IDs</a>
2813 </caption>
2814 <thead>
2815 <tr>
2816 <th class="text-left" rowspan="1" colspan="1">Value</th>
2817 <th class="text-left" rowspan="1" colspan="1">KDF</th>
2818 <th class="text-left" rowspan="1" colspan="1">Nh</th>
2819 <th class="text-left" rowspan="1" colspan="1">Reference</th>
2820 </tr>
2821 </thead>
2822 <tbody>
2823 <tr>
2824 <td class="text-left" rowspan="1" colspan="1">0x0000</td>
2825 <td class="text-left" rowspan="1" colspan="1">Reserved</td>
2826 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2827 <td class="text-left" rowspan="1" colspan="1">RFC 9180</td>
2828 </tr>
2829 <tr>
2830 <td class="text-left" rowspan="1" colspan="1">0x0001</td>
2831 <td class="text-left" rowspan="1" colspan="1">HKDF-SHA256</td>
2832 <td class="text-left" rowspan="1" colspan="1">32</td>
2833 <td class="text-left" rowspan="1" colspan="1">
2834 <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>
2835 </td>
2836 </tr>
2837 <tr>
2838 <td class="text-left" rowspan="1" colspan="1">0x0002</td>
2839 <td class="text-left" rowspan="1" colspan="1">HKDF-SHA384</td>
2840 <td class="text-left" rowspan="1" colspan="1">48</td>
2841 <td class="text-left" rowspan="1" colspan="1">
2842 <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>
2843 </td>
2844 </tr>
2845 <tr>
2846 <td class="text-left" rowspan="1" colspan="1">0x0003</td>
2847 <td class="text-left" rowspan="1" colspan="1">HKDF-SHA512</td>
2848 <td class="text-left" rowspan="1" colspan="1">64</td>
2849 <td class="text-left" rowspan="1" colspan="1">
2850 <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>
2851 </td>
2852 </tr>
2853 </tbody>
2854 </table>
2855 </div>
2856 <div id="kdf-input-length">
2857 <section id="section-7.2.1">
2858 <h4 id="name-input-length-restrictions">
2859 <a href="#section-7.2.1" class="section-number selfRef">7.2.1. </a><a href="#name-input-length-restrictions" class="section-name selfRef">Input Length Restrictions</a>
2860 </h4>
2861 <p id="section-7.2.1-1">This document defines <code>LabeledExtract()</code> and <code>LabeledExpand()</code> based on the
2862 KDFs listed above. These functions add prefixes to their respective
2863 inputs <code>ikm</code> and <code>info</code> before calling the KDF's <code>Extract()</code> and <code>Expand()</code>
2864 functions. This leads to a reduction of the maximum input length that
2865 is available for the inputs <code>psk</code>, <code>psk_id</code>, <code>info</code>, <code>exporter_context</code>,
2866 <code>ikm</code>, i.e., the variable-length parameters provided by HPKE applications.
2867 The following table lists the maximum allowed lengths of these fields
2868 for the KDFs defined in this document, as inclusive bounds in bytes:<a href="#section-7.2.1-1" class="pilcrow">¶</a></p>
2869 <span id="name-application-input-limits"></span><div id="input-limits">
2870 <table class="center" id="table-4">
2871 <caption>
2872 <a href="#table-4" class="selfRef">Table 4</a>:
2873 <a href="#name-application-input-limits" class="selfRef">Application Input Limits</a>
2874 </caption>
2875 <thead>
2876 <tr>
2877 <th class="text-left" rowspan="1" colspan="1">Input</th>
2878 <th class="text-left" rowspan="1" colspan="1">HKDF-SHA256</th>
2879 <th class="text-left" rowspan="1" colspan="1">HKDF-SHA384</th>
2880 <th class="text-left" rowspan="1" colspan="1">HKDF-SHA512</th>
2881 </tr>
2882 </thead>
2883 <tbody>
2884 <tr>
2885 <td class="text-left" rowspan="1" colspan="1">psk</td>
2886 <td class="text-left" rowspan="1" colspan="1">2^{61} - 88</td>
2887 <td class="text-left" rowspan="1" colspan="1">2^{125} - 152</td>
2888 <td class="text-left" rowspan="1" colspan="1">2^{125} - 152</td>
2889 </tr>
2890 <tr>
2891 <td class="text-left" rowspan="1" colspan="1">psk_id</td>
2892 <td class="text-left" rowspan="1" colspan="1">2^{61} - 93</td>
2893 <td class="text-left" rowspan="1" colspan="1">2^{125} - 157</td>
2894 <td class="text-left" rowspan="1" colspan="1">2^{125} - 157</td>
2895 </tr>
2896 <tr>
2897 <td class="text-left" rowspan="1" colspan="1">info</td>
2898 <td class="text-left" rowspan="1" colspan="1">2^{61} - 91</td>
2899 <td class="text-left" rowspan="1" colspan="1">2^{125} - 155</td>
2900 <td class="text-left" rowspan="1" colspan="1">2^{125} - 155</td>
2901 </tr>
2902 <tr>
2903 <td class="text-left" rowspan="1" colspan="1">exporter_context</td>
2904 <td class="text-left" rowspan="1" colspan="1">2^{61} - 120</td>
2905 <td class="text-left" rowspan="1" colspan="1">2^{125} - 200</td>
2906 <td class="text-left" rowspan="1" colspan="1">2^{125} - 216</td>
2907 </tr>
2908 <tr>
2909 <td class="text-left" rowspan="1" colspan="1">ikm (DeriveKeyPair)</td>
2910 <td class="text-left" rowspan="1" colspan="1">2^{61} - 84</td>
2911 <td class="text-left" rowspan="1" colspan="1">2^{125} - 148</td>
2912 <td class="text-left" rowspan="1" colspan="1">2^{125} - 148</td>
2913 </tr>
2914 </tbody>
2915 </table>
2916 </div>
2917 <p id="section-7.2.1-3">This shows that the limits are only marginally smaller than the maximum
2918 input length of the underlying hash function; these limits are large and
2919 unlikely to be reached in practical applications. Future specifications
2920 that define new KDFs <span class="bcp14">MUST</span> specify bounds for these variable-length
2921 parameters.<a href="#section-7.2.1-3" class="pilcrow">¶</a></p>
2922 <p id="section-7.2.1-4">The <span class="bcp14">RECOMMENDED</span> limit for these values is 64 bytes. This would enable
2923 interoperability with implementations that statically allocate memory
2924 for these inputs to avoid memory allocations.<a href="#section-7.2.1-4" class="pilcrow">¶</a></p>
2925 <p id="section-7.2.1-5">The values for <code>psk</code>, <code>psk_id</code>, <code>info</code>, and <code>ikm</code>, which are inputs to
2926 <code>LabeledExtract()</code>, were computed with the following expression:<a href="#section-7.2.1-5" class="pilcrow">¶</a></p>
2927 <div class="alignLeft art-pseudocode art-text artwork" id="section-7.2.1-6">
2928 <pre>
2929 max_size_hash_input - Nb - size_version_label -
2930 size_suite_id - size_input_label
2931 </pre><a href="#section-7.2.1-6" class="pilcrow">¶</a>
2932 </div>
2933 <p id="section-7.2.1-7">The value for <code>exporter_context</code>, which is an input to <code>LabeledExpand()</code>,
2934 was computed with the following expression:<a href="#section-7.2.1-7" class="pilcrow">¶</a></p>
2935 <div class="alignLeft art-pseudocode art-text artwork" id="section-7.2.1-8">
2936 <pre>
2937 max_size_hash_input - Nb - Nh - size_version_label -
2938 size_suite_id - size_input_label - 2 - 1
2939 </pre><a href="#section-7.2.1-8" class="pilcrow">¶</a>
2940 </div>
2941 <p id="section-7.2.1-9">In these equations, <code>max_size_hash_input</code> is the maximum input length
2942 of the underlying hash function in bytes, <code>Nb</code> is the block size of the
2943 underlying hash function in bytes, <code>size_version_label</code> is the size
2944 of "HPKE-v1" in bytes and equals 7, <code>size_suite_id</code> is the size of the
2945 <code>suite_id</code> in bytes and equals 5 for DHKEM (relevant for <code>ikm</code>) and 10 for the
2946 remainder of HPKE (relevant for <code>psk</code>, <code>psk_id</code>, <code>info</code>, and <code>exporter_context</code>),
2947 and <code>size_input_label</code> is the size in bytes of the label used as parameter to
2948 <code>LabeledExtract()</code> or <code>LabeledExpand()</code>, the maximum of which is 13
2949 across all labels in this document.<a href="#section-7.2.1-9" class="pilcrow">¶</a></p>
2950 </section>
2951 </div>
2952 </section>
2953 </div>
2954 <div id="aead-ids">
2955 <section id="section-7.3">
2956 <h3 id="name-authenticated-encryption-wi">
2957 <a href="#section-7.3" class="section-number selfRef">7.3. </a><a href="#name-authenticated-encryption-wi" class="section-name selfRef">Authenticated Encryption with Associated Data (AEAD)
2958 Functions</a>
2959 </h3>
2960 <span id="name-aead-ids"></span><div id="aeadid-values">
2961 <table class="center" id="table-5">
2962 <caption>
2963 <a href="#table-5" class="selfRef">Table 5</a>:
2964 <a href="#name-aead-ids" class="selfRef">AEAD IDs</a>
2965 </caption>
2966 <thead>
2967 <tr>
2968 <th class="text-left" rowspan="1" colspan="1">Value</th>
2969 <th class="text-left" rowspan="1" colspan="1">AEAD</th>
2970 <th class="text-left" rowspan="1" colspan="1">Nk</th>
2971 <th class="text-left" rowspan="1" colspan="1">Nn</th>
2972 <th class="text-left" rowspan="1" colspan="1">Nt</th>
2973 <th class="text-left" rowspan="1" colspan="1">Reference</th>
2974 </tr>
2975 </thead>
2976 <tbody>
2977 <tr>
2978 <td class="text-left" rowspan="1" colspan="1">0x0000</td>
2979 <td class="text-left" rowspan="1" colspan="1">Reserved</td>
2980 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2981 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2982 <td class="text-left" rowspan="1" colspan="1">N/A</td>
2983 <td class="text-left" rowspan="1" colspan="1">RFC 9180</td>
2984 </tr>
2985 <tr>
2986 <td class="text-left" rowspan="1" colspan="1">0x0001</td>
2987 <td class="text-left" rowspan="1" colspan="1">AES-128-GCM</td>
2988 <td class="text-left" rowspan="1" colspan="1">16</td>
2989 <td class="text-left" rowspan="1" colspan="1">12</td>
2990 <td class="text-left" rowspan="1" colspan="1">16</td>
2991 <td class="text-left" rowspan="1" colspan="1">
2992 <span>[<a href="#GCM" class="xref">GCM</a>]</span>
2993 </td>
2994 </tr>
2995 <tr>
2996 <td class="text-left" rowspan="1" colspan="1">0x0002</td>
2997 <td class="text-left" rowspan="1" colspan="1">AES-256-GCM</td>
2998 <td class="text-left" rowspan="1" colspan="1">32</td>
2999 <td class="text-left" rowspan="1" colspan="1">12</td>
3000 <td class="text-left" rowspan="1" colspan="1">16</td>
3001 <td class="text-left" rowspan="1" colspan="1">
3002 <span>[<a href="#GCM" class="xref">GCM</a>]</span>
3003 </td>
3004 </tr>
3005 <tr>
3006 <td class="text-left" rowspan="1" colspan="1">0x0003</td>
3007 <td class="text-left" rowspan="1" colspan="1">ChaCha20Poly1305</td>
3008 <td class="text-left" rowspan="1" colspan="1">32</td>
3009 <td class="text-left" rowspan="1" colspan="1">12</td>
3010 <td class="text-left" rowspan="1" colspan="1">16</td>
3011 <td class="text-left" rowspan="1" colspan="1">
3012 <span>[<a href="#RFC8439" class="xref">RFC8439</a>]</span>
3013 </td>
3014 </tr>
3015 <tr>
3016 <td class="text-left" rowspan="1" colspan="1">0xFFFF</td>
3017 <td class="text-left" rowspan="1" colspan="1">Export-only</td>
3018 <td class="text-left" rowspan="1" colspan="1">N/A</td>
3019 <td class="text-left" rowspan="1" colspan="1">N/A</td>
3020 <td class="text-left" rowspan="1" colspan="1">N/A</td>
3021 <td class="text-left" rowspan="1" colspan="1">RFC 9180</td>
3022 </tr>
3023 </tbody>
3024 </table>
3025 </div>
3026 <p id="section-7.3-2">The <code>0xFFFF</code> AEAD ID is reserved for applications that only use the Export
3027 interface; see <a href="#hpke-export" class="xref">Section 5.3</a> for more details.<a href="#section-7.3-2" class="pilcrow">¶</a></p>
3028 </section>
3029 </div>
3030 </section>
3031 </div>
3032 <div id="api-considerations">
3033 <section id="section-8">
3034 <h2 id="name-api-considerations">
3035 <a href="#section-8" class="section-number selfRef">8. </a><a href="#name-api-considerations" class="section-name selfRef">API Considerations</a>
3036 </h2>
3037 <p id="section-8-1">This section documents considerations for interfaces to implementations of HPKE.
3038 This includes error handling considerations and recommendations that improve
3039 interoperability when HPKE is used in applications.<a href="#section-8-1" class="pilcrow">¶</a></p>
3040 <div id="auxiliary-authenticated-application-information">
3041 <section id="section-8.1">
3042 <h3 id="name-auxiliary-authenticated-app">
3043 <a href="#section-8.1" class="section-number selfRef">8.1. </a><a href="#name-auxiliary-authenticated-app" class="section-name selfRef">Auxiliary Authenticated Application Information</a>
3044 </h3>
3045 <p id="section-8.1-1">HPKE has two places at which applications can specify auxiliary authenticated information:
3046 (1) during context construction via the Setup <code>info</code> parameter, and (2) during Context
3047 operations, i.e., with the <code>aad</code> parameter for <code>Open()</code> and <code>Seal()</code>, and the <code>exporter_context</code> parameter
3048 for <code>Export()</code>. Application information applicable to multiple operations on a single Context
3049 should use the Setup <code>info</code> parameter. This avoids redundantly processing this information for
3050 each Context operation. In contrast, application information that varies on a per-message basis
3051 should be specified via the Context APIs (<code>Seal()</code>, <code>Open()</code>, or <code>Export()</code>).<a href="#section-8.1-1" class="pilcrow">¶</a></p>
3052 <p id="section-8.1-2">Applications that only use the single-shot APIs described in <a href="#single-shot-apis" class="xref">Section 6</a> should use the
3053 Setup <code>info</code> parameter for specifying auxiliary authenticated information. Implementations which
3054 only expose single-shot APIs should not allow applications to use both Setup <code>info</code> and Context
3055 <code>aad</code> or <code>exporter_context</code> auxiliary information parameters.<a href="#section-8.1-2" class="pilcrow">¶</a></p>
3056 </section>
3057 </div>
3058 <div id="api-errors">
3059 <section id="section-8.2">
3060 <h3 id="name-errors">
3061 <a href="#section-8.2" class="section-number selfRef">8.2. </a><a href="#name-errors" class="section-name selfRef">Errors</a>
3062 </h3>
3063 <p id="section-8.2-1">The high-level, public HPKE APIs specified in this document are all fallible.
3064 These include the Setup functions and all encryption context functions.
3065 For example, <code>Decap()</code> can fail if the encapsulated key <code>enc</code> is invalid,
3066 and <code>Open()</code> may fail if ciphertext decryption fails. The explicit errors
3067 generated throughout this specification, along with the conditions that
3068 lead to each error, are as follows:<a href="#section-8.2-1" class="pilcrow">¶</a></p>
3069 <ul class="normal">
3070 <li class="normal" id="section-8.2-2.1">
3071 <code>ValidationError</code>: KEM input or output validation failure;
3072 <a href="#dhkem" class="xref">Section 4.1</a>.<a href="#section-8.2-2.1" class="pilcrow">¶</a>
3073 </li>
3074 <li class="normal" id="section-8.2-2.2">
3075 <code>DeserializeError</code>: Public or private key deserialization
3076 failure; <a href="#base-crypto" class="xref">Section 4</a>.<a href="#section-8.2-2.2" class="pilcrow">¶</a>
3077 </li>
3078 <li class="normal" id="section-8.2-2.3">
3079 <code>EncapError</code>: <code>Encap()</code> failure; <a href="#base-crypto" class="xref">Section 4</a>.<a href="#section-8.2-2.3" class="pilcrow">¶</a>
3080 </li>
3081 <li class="normal" id="section-8.2-2.4">
3082 <code>DecapError</code>: <code>Decap()</code> failure; <a href="#base-crypto" class="xref">Section 4</a>.<a href="#section-8.2-2.4" class="pilcrow">¶</a>
3083 </li>
3084 <li class="normal" id="section-8.2-2.5">
3085 <code>OpenError</code>: Context AEAD <code>Open()</code> failure; Sections
3086 <a href="#base-crypto" class="xref">4</a> and <a href="#hpke-dem" class="xref">5.2</a>.<a href="#section-8.2-2.5" class="pilcrow">¶</a>
3087 </li>
3088 <li class="normal" id="section-8.2-2.6">
3089 <code>MessageLimitReachedError</code>: Context AEAD sequence number
3090 overflow; Sections <a href="#base-crypto" class="xref">4</a> and <a href="#hpke-dem" class="xref">5.2</a>.<a href="#section-8.2-2.6" class="pilcrow">¶</a>
3091 </li>
3092 <li class="normal" id="section-8.2-2.7">
3093 <code>DeriveKeyPairError</code>: Key pair derivation failure; <a href="#derive-key-pair" class="xref">Section 7.1.3</a>.<a href="#section-8.2-2.7" class="pilcrow">¶</a>
3094 </li>
3095 </ul>
3096 <p id="section-8.2-3">Implicit errors may also occur. As an example, certain classes of failures,
3097 e.g., malformed recipient public keys, may not yield explicit errors.
3098 For example, for the DHKEM variant described in this specification,
3099 the <code>Encap()</code> algorithm fails when given an invalid recipient public key.
3100 However, other KEM algorithms may not have an efficient algorithm for verifying
3101 the validity of public keys. As a result, an equivalent error may not manifest
3102 until AEAD decryption at the recipient. As another example, DHKEM's <code>AuthDecap()</code>
3103 function will produce invalid output if given the wrong sender public key.
3104 This error is not detectable until subsequent AEAD decryption.<a href="#section-8.2-3" class="pilcrow">¶</a></p>
3105 <p id="section-8.2-4">The errors in this document are meant as a guide for implementors. They are not
3106 an exhaustive list of all the errors an implementation might emit. For example,
3107 future KEMs might have internal failure cases, or an implementation might run
3108 out of memory.<a href="#section-8.2-4" class="pilcrow">¶</a></p>
3109 <p id="section-8.2-5">How these errors are expressed in an API or handled by applications is an
3110 implementation-specific detail. For example, some implementations may abort or
3111 panic upon a <code>DeriveKeyPairError</code> failure given that it only occurs with
3112 negligible probability, whereas other implementations may retry the failed
3113 DeriveKeyPair operation. See <a href="#derive-key-pair" class="xref">Section 7.1.3</a> for more information.
3114 As another example, some implementations of the DHKEM specified in this document
3115 may choose to transform <code>ValidationError</code> from <code>DH()</code> into an <code>EncapError</code> or
3116 <code>DecapError</code> from <code>Encap()</code> or <code>Decap()</code>, respectively, whereas others may choose
3117 to raise <code>ValidationError</code> unmodified.<a href="#section-8.2-5" class="pilcrow">¶</a></p>
3118 <p id="section-8.2-6">Applications using HPKE APIs should not assume that the errors here are complete,
3119 nor should they assume certain classes of errors will always manifest the same way
3120 for all ciphersuites. For example, the DHKEM specified in this document will emit
3121 a <code>DeserializationError</code> or <code>ValidationError</code> if a KEM public key is invalid. However,
3122 a new KEM might not have an efficient algorithm for determining whether or not a
3123 public key is valid. In this case, an invalid public key might instead yield an
3124 <code>OpenError</code> when trying to decrypt a ciphertext.<a href="#section-8.2-6" class="pilcrow">¶</a></p>
3125 </section>
3126 </div>
3127 </section>
3128 </div>
3129 <div id="sec-considerations">
3130 <section id="section-9">
3131 <h2 id="name-security-considerations">
3132 <a href="#section-9" class="section-number selfRef">9. </a><a href="#name-security-considerations" class="section-name selfRef">Security Considerations</a>
3133 </h2>
3134 <div id="sec-properties">
3135 <section id="section-9.1">
3136 <h3 id="name-security-properties">
3137 <a href="#section-9.1" class="section-number selfRef">9.1. </a><a href="#name-security-properties" class="section-name selfRef">Security Properties</a>
3138 </h3>
3139 <p id="section-9.1-1">HPKE has several security goals, depending on the mode of operation,
3140 against active and adaptive attackers that can compromise partial
3141 secrets of senders and recipients. The desired security goals are
3142 detailed below:<a href="#section-9.1-1" class="pilcrow">¶</a></p>
3143 <ul class="normal">
3144 <li class="normal" id="section-9.1-2.1">Message secrecy: Confidentiality of the sender's messages against
3145 chosen ciphertext attacks<a href="#section-9.1-2.1" class="pilcrow">¶</a>
3146 </li>
3147 <li class="normal" id="section-9.1-2.2">Export key secrecy: Indistinguishability of each export secret from
3148 a uniformly random bitstring of equal length, i.e.,
3149 <code>Context.Export</code> is a variable-length PRF<a href="#section-9.1-2.2" class="pilcrow">¶</a>
3150 </li>
3151 <li class="normal" id="section-9.1-2.3">Sender authentication: Proof of sender origin for PSK, Auth, and
3152 AuthPSK modes<a href="#section-9.1-2.3" class="pilcrow">¶</a>
3153 </li>
3154 </ul>
3155 <p id="section-9.1-3">These security goals are expected to hold for any honest sender and
3156 honest recipient keys, as well as if the honest sender and honest
3157 recipient keys are the same.<a href="#section-9.1-3" class="pilcrow">¶</a></p>
3158 <p id="section-9.1-4">HPKE mitigates malleability problems (called benign malleability <span>[<a href="#SECG" class="xref">SECG</a>]</span>) in prior
3159 public key encryption standards based on ECIES by including all public keys in the
3160 context of the key schedule.<a href="#section-9.1-4" class="pilcrow">¶</a></p>
3161 <p id="section-9.1-5">HPKE does not provide forward secrecy with respect to recipient compromise.
3162 In the Base and Auth modes, the secrecy properties are only expected to
3163 hold if the recipient private key <code>skR</code> is not compromised at any point
3164 in time. In the PSK and AuthPSK modes, the secrecy properties are
3165 expected to hold if the recipient private key <code>skR</code> and the pre-shared key
3166 are not both compromised at any point in time. See <a href="#non-goals" class="xref">Section 9.7</a> for more
3167 details.<a href="#section-9.1-5" class="pilcrow">¶</a></p>
3168 <p id="section-9.1-6">In the Auth mode, sender authentication is generally expected to hold if
3169 the sender private key <code>skS</code> is not compromised at the time of message
3170 reception. In the AuthPSK mode, sender authentication is generally
3171 expected to hold if, at the time of message reception, the sender private
3172 key skS and the pre-shared key are not both compromised.<a href="#section-9.1-6" class="pilcrow">¶</a></p>
3173 <p id="section-9.1-7">Besides forward secrecy and key-compromise impersonation, which are highlighted
3174 in this section because of their particular cryptographic importance, HPKE
3175 has other non-goals that are described in <a href="#non-goals" class="xref">Section 9.7</a>: no tolerance of
3176 message reordering or loss, no downgrade or replay prevention, no hiding of the
3177 plaintext length, and no protection against bad ephemeral randomness. <a href="#non-goals" class="xref">Section 9.7</a>
3178 suggests application-level mitigations for some of them.<a href="#section-9.1-7" class="pilcrow">¶</a></p>
3179 <div id="kci">
3180 <section id="section-9.1.1">
3181 <h4 id="name-key-compromise-impersonatio">
3182 <a href="#section-9.1.1" class="section-number selfRef">9.1.1. </a><a href="#name-key-compromise-impersonatio" class="section-name selfRef">Key-Compromise Impersonation</a>
3183 </h4>
3184 <p id="section-9.1.1-1">The DHKEM variants defined in this document are
3185 vulnerable to key-compromise impersonation attacks <span>[<a href="#BJM97" class="xref">BJM97</a>]</span>,
3186 which means that sender authentication cannot be expected to hold in the
3187 Auth mode if the recipient private key <code>skR</code> is compromised, and in the
3188 AuthPSK mode if the pre-shared key and the recipient private key <code>skR</code> are
3189 both compromised.
3190
3191 NaCl's <code>box</code> interface <span>[<a href="#NaCl" class="xref">NaCl</a>]</span> has the same issue. At
3192 the same time, this enables repudiability.<a href="#section-9.1.1-1" class="pilcrow">¶</a></p>
3193 <p id="section-9.1.1-2">As shown by <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span>, key-compromise impersonation attacks are generally possible on HPKE
3194 because KEM ciphertexts are not bound to HPKE messages. An adversary who
3195 knows a recipient's private key can decapsulate an observed KEM ciphertext,
3196 compute the key schedule, and encrypt an arbitrary message that the recipient
3197 will accept as coming from the original sender. Importantly, this is possible even
3198 with a KEM that is resistant to key-compromise impersonation attacks. As a
3199 result, mitigating this issue requires fundamental changes that are out of scope
3200 of this specification.<a href="#section-9.1.1-2" class="pilcrow">¶</a></p>
3201 <p id="section-9.1.1-3">Applications that require resistance against key-compromise impersonation
3202 <span class="bcp14">SHOULD</span> take extra steps to prevent this attack. One possibility is to
3203 produce a digital signature over <code>(enc, ct)</code> tuples using a sender's
3204 private key -- where <code>ct</code> is an AEAD ciphertext produced by the single-shot
3205 or multi-shot API and <code>enc</code> is the corresponding KEM encapsulated key.<a href="#section-9.1.1-3" class="pilcrow">¶</a></p>
3206 <p id="section-9.1.1-4">Given these properties, pre-shared keys strengthen both the authentication and the
3207 secrecy properties in certain adversary models. One particular example in which
3208 this can be useful is a hybrid quantum setting: if a
3209 non-quantum-resistant KEM used with HPKE is broken by a
3210 quantum computer, the security properties are preserved through the use
3211 of a pre-shared key. As described in <span><a href="https://www.rfc-editor.org/rfc/rfc8696#section-7" class="relref">Section 7</a> of [<a href="#RFC8696" class="xref">RFC8696</a>]</span> this
3212 assumes that the pre-shared key has not been compromised.<a href="#section-9.1.1-4" class="pilcrow">¶</a></p>
3213 </section>
3214 </div>
3215 <div id="computational-analysis">
3216 <section id="section-9.1.2">
3217 <h4 id="name-computational-analysis">
3218 <a href="#section-9.1.2" class="section-number selfRef">9.1.2. </a><a href="#name-computational-analysis" class="section-name selfRef">Computational Analysis</a>
3219 </h4>
3220 <p id="section-9.1.2-1">It is shown in <span>[<a href="#CS01" class="xref">CS01</a>]</span> that a hybrid public key encryption scheme of
3221 essentially the same form as the Base mode described here is
3222 IND-CCA2-secure as long as the underlying KEM and AEAD schemes are
3223 IND-CCA2-secure. Moreover, it is shown in <span>[<a href="#HHK06" class="xref">HHK06</a>]</span> that IND-CCA2 security
3224 of the KEM and the data encapsulation mechanism are necessary conditions
3225 to achieve IND-CCA2 security for hybrid public key encryption.
3226 The main difference between the scheme proposed in <span>[<a href="#CS01" class="xref">CS01</a>]</span>
3227 and the Base mode in this document (both named HPKE) is that we interpose
3228 some KDF calls between the KEM and the AEAD. Analyzing the HPKE Base mode
3229 instantiation in this document therefore requires verifying that the
3230 additional KDF calls do not cause the IND-CCA2 property to fail, as
3231 well as verifying the additional export key secrecy property.<a href="#section-9.1.2-1" class="pilcrow">¶</a></p>
3232 <p id="section-9.1.2-2">Analysis of the PSK, Auth, and AuthPSK modes defined in this document
3233 additionally requires verifying the sender authentication property.
3234 While the PSK mode just adds supplementary keying material to the key
3235 schedule, the Auth and AuthPSK modes make use of a non-standard
3236 authenticated KEM construction. Generally, the authenticated modes of
3237 HPKE can be viewed and analyzed as flavors of signcryption <span>[<a href="#SigncryptionDZ10" class="xref">SigncryptionDZ10</a>]</span>.<a href="#section-9.1.2-2" class="pilcrow">¶</a></p>
3238 <p id="section-9.1.2-3">A preliminary computational analysis of all HPKE modes has been done
3239 in <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span>, indicating asymptotic security for the case where
3240 the KEM is DHKEM, the AEAD is any IND-CPA-secure and INT-CTXT-secure scheme,
3241 and the DH group and KDF satisfy the following conditions:<a href="#section-9.1.2-3" class="pilcrow">¶</a></p>
3242 <ul class="normal">
3243 <li class="normal" id="section-9.1.2-4.1">DH group: The gap Diffie-Hellman (GDH) problem is hard in the
3244 appropriate subgroup <span>[<a href="#GAP" class="xref">GAP</a>]</span>.<a href="#section-9.1.2-4.1" class="pilcrow">¶</a>
3245 </li>
3246 <li class="normal" id="section-9.1.2-4.2">
3247 <code>Extract()</code> and <code>Expand()</code>: <code>Extract()</code> can
3248 be modeled as a random oracle. <code>Expand()</code> can be modeled as a
3249 pseudorandom function, wherein the first argument is the key.<a href="#section-9.1.2-4.2" class="pilcrow">¶</a>
3250 </li>
3251 </ul>
3252 <p id="section-9.1.2-5">In particular, the KDFs and DH groups defined in this document (see Sections
3253 <a href="#kdf-ids" class="xref">7.2</a> and <a href="#kem-ids" class="xref">7.1</a>) satisfy these properties when used as
3254 specified. The analysis in <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span> demonstrates that under these
3255 constraints, HPKE continues to provide IND-CCA2 security, and provides
3256 the additional properties noted above. Also, the analysis confirms the
3257 expected properties hold under the different key compromise cases
3258 mentioned above. The analysis considers a sender that sends one message
3259 using the encryption context, and additionally exports two independent
3260 secrets using the secret export interface.<a href="#section-9.1.2-5" class="pilcrow">¶</a></p>
3261 <p id="section-9.1.2-6">The table below summarizes the main results from <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span>. N/A
3262 means that a property does not apply for the given mode, whereas <code>Y</code> means
3263 the given mode satisfies the property.<a href="#section-9.1.2-6" class="pilcrow">¶</a></p>
3264 <span id="name-hpke-mode-security-properti"></span><table class="center" id="table-6">
3265 <caption>
3266 <a href="#table-6" class="selfRef">Table 6</a>:
3267 <a href="#name-hpke-mode-security-properti" class="selfRef">HPKE Mode Security Properties</a>
3268 </caption>
3269 <thead>
3270 <tr>
3271 <th class="text-left" rowspan="1" colspan="1">Variant</th>
3272 <th class="text-center" rowspan="1" colspan="1">Message Sec.</th>
3273 <th class="text-center" rowspan="1" colspan="1">Export Sec.</th>
3274 <th class="text-center" rowspan="1" colspan="1">Sender Auth.</th>
3275 </tr>
3276 </thead>
3277 <tbody>
3278 <tr>
3279 <td class="text-left" rowspan="1" colspan="1">Base</td>
3280 <td class="text-center" rowspan="1" colspan="1">Y</td>
3281 <td class="text-center" rowspan="1" colspan="1">Y</td>
3282 <td class="text-center" rowspan="1" colspan="1">N/A</td>
3283 </tr>
3284 <tr>
3285 <td class="text-left" rowspan="1" colspan="1">PSK</td>
3286 <td class="text-center" rowspan="1" colspan="1">Y</td>
3287 <td class="text-center" rowspan="1" colspan="1">Y</td>
3288 <td class="text-center" rowspan="1" colspan="1">Y</td>
3289 </tr>
3290 <tr>
3291 <td class="text-left" rowspan="1" colspan="1">Auth</td>
3292 <td class="text-center" rowspan="1" colspan="1">Y</td>
3293 <td class="text-center" rowspan="1" colspan="1">Y</td>
3294 <td class="text-center" rowspan="1" colspan="1">Y</td>
3295 </tr>
3296 <tr>
3297 <td class="text-left" rowspan="1" colspan="1">AuthPSK</td>
3298 <td class="text-center" rowspan="1" colspan="1">Y</td>
3299 <td class="text-center" rowspan="1" colspan="1">Y</td>
3300 <td class="text-center" rowspan="1" colspan="1">Y</td>
3301 </tr>
3302 </tbody>
3303 </table>
3304 <p id="section-9.1.2-8">If non-DH-based KEMs are to be used with HPKE, further analysis will be
3305 necessary to prove their security. The results from <span>[<a href="#CS01" class="xref">CS01</a>]</span> provide
3306 some indication that any IND-CCA2-secure KEM will suffice here, but are
3307 not conclusive given the differences in the schemes.<a href="#section-9.1.2-8" class="pilcrow">¶</a></p>
3308 <p id="section-9.1.2-9">A detailed computational analysis of HPKE's Auth mode single-shot
3309 encryption API has been done in <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span>.
3310 The paper defines security notions for authenticated
3311 KEMs and for authenticated public key encryption, using the outsider and
3312 insider security terminology known from signcryption <span>[<a href="#SigncryptionDZ10" class="xref">SigncryptionDZ10</a>]</span>.
3313 The analysis proves that DHKEM's <code>AuthEncap()</code>/<code>AuthDecap()</code> interface
3314 fulfills these notions for all Diffie-Hellman groups specified in this document.
3315 The analysis also provides exact security bounds, under the assumptions that the
3316 gap Diffie-Hellman (GDH) problem is hard in the appropriate subgroup <span>[<a href="#GAP" class="xref">GAP</a>]</span>,
3317 and that HKDF can be modeled as a random oracle.<a href="#section-9.1.2-9" class="pilcrow">¶</a></p>
3318 <p id="section-9.1.2-10">Further, <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span> proves composition theorems, showing that HPKE's
3319 Auth mode fulfills the security notions of authenticated public key encryption
3320 for all KDFs and AEAD schemes specified in this document, given any
3321 authenticated KEM satisfying the previously defined security notions
3322 for authenticated KEMs. The theorems assume that the KEM is perfectly correct;
3323 they could easily be adapted to work with KEMs that have a nonzero but negligible
3324 probability for decryption failure. The assumptions on the KDF are that <code>Extract()</code>
3325 and <code>Expand()</code> can be modeled as pseudorandom functions wherein the first
3326 argument is the key, respectively. The assumption for the AEAD is
3327 IND-CPA and IND-CTXT security.<a href="#section-9.1.2-10" class="pilcrow">¶</a></p>
3328 <p id="section-9.1.2-11">In summary, the analysis in <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span> proves that the single-shot encryption API of HPKE's
3329 Auth mode satisfies the desired message confidentiality and sender
3330 authentication properties listed at the beginning of this section;
3331 it does not consider multiple messages, nor the secret export API.<a href="#section-9.1.2-11" class="pilcrow">¶</a></p>
3332 </section>
3333 </div>
3334 <div id="post-quantum-security">
3335 <section id="section-9.1.3">
3336 <h4 id="name-post-quantum-security">
3337 <a href="#section-9.1.3" class="section-number selfRef">9.1.3. </a><a href="#name-post-quantum-security" class="section-name selfRef">Post-Quantum Security</a>
3338 </h4>
3339 <p id="section-9.1.3-1">All of <span>[<a href="#CS01" class="xref">CS01</a>]</span>, <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span>, and <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span> are premised on
3340 classical security models and assumptions, and do not consider
3341 adversaries capable of quantum computation. A full proof of post-quantum
3342 security would need to take appropriate security models and assumptions
3343 into account, in addition to simply using a post-quantum KEM. However,
3344 the composition theorems from <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span> for HPKE's Auth mode only make
3345 standard assumptions (i.e., no random oracle assumption) that are expected
3346 to hold against quantum adversaries (although with slightly worse bounds).
3347 Thus, these composition theorems, in combination with a post-quantum-secure
3348 authenticated KEM, guarantee the post-quantum security of HPKE's Auth mode.<a href="#section-9.1.3-1" class="pilcrow">¶</a></p>
3349 <p id="section-9.1.3-2">In future work, the analysis from <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span> can be extended to cover
3350 HPKE's other modes and desired security properties.
3351 The hybrid quantum-resistance property described above, which is achieved
3352 by using the PSK or AuthPSK mode, is not proven in <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span> because
3353 this analysis requires the random oracle model; in a quantum
3354 setting, this model needs adaption to, for example, the quantum random
3355 oracle model.<a href="#section-9.1.3-2" class="pilcrow">¶</a></p>
3356 </section>
3357 </div>
3358 </section>
3359 </div>
3360 <div id="kem-security">
3361 <section id="section-9.2">
3362 <h3 id="name-security-requirements-on-a-">
3363 <a href="#section-9.2" class="section-number selfRef">9.2. </a><a href="#name-security-requirements-on-a-" class="section-name selfRef">Security Requirements on a KEM Used within HPKE</a>
3364 </h3>
3365 <p id="section-9.2-1">A KEM used within HPKE <span class="bcp14">MUST</span> allow HPKE to satisfy its desired security
3366 properties described in <a href="#sec-properties" class="xref">Section 9.1</a>. <a href="#domain-separation" class="xref">Section 9.6</a> lists
3367 requirements concerning domain separation.<a href="#section-9.2-1" class="pilcrow">¶</a></p>
3368 <p id="section-9.2-2">In particular, the KEM
3369 shared secret <span class="bcp14">MUST</span> be a uniformly random byte string of length <code>Nsecret</code>.
3370 This means, for instance, that it would not be sufficient if the KEM
3371 shared secret is only uniformly random as an element of some set prior
3372 to its encoding as a byte string.<a href="#section-9.2-2" class="pilcrow">¶</a></p>
3373 <div id="encapdecap-interface">
3374 <section id="section-9.2.1">
3375 <h4 id="name-encap-decap-interface">
3376 <a href="#section-9.2.1" class="section-number selfRef">9.2.1. </a><a href="#name-encap-decap-interface" class="section-name selfRef">Encap/Decap Interface</a>
3377 </h4>
3378 <p id="section-9.2.1-1">As mentioned in <a href="#sec-considerations" class="xref">Section 9</a>, <span>[<a href="#CS01" class="xref">CS01</a>]</span> provides some indications
3379 that if the KEM's <code>Encap()</code>/<code>Decap()</code> interface (which is used in the Base
3380 and PSK modes) is IND-CCA2-secure, HPKE is able to satisfy its desired
3381 security properties. An appropriate definition of IND-CCA2 security for
3382 KEMs can be found in <span>[<a href="#CS01" class="xref">CS01</a>]</span> and <span>[<a href="#BHK09" class="xref">BHK09</a>]</span>.<a href="#section-9.2.1-1" class="pilcrow">¶</a></p>
3383 </section>
3384 </div>
3385 <div id="authencapauthdecap-interface">
3386 <section id="section-9.2.2">
3387 <h4 id="name-authencap-authdecap-interfa">
3388 <a href="#section-9.2.2" class="section-number selfRef">9.2.2. </a><a href="#name-authencap-authdecap-interfa" class="section-name selfRef">AuthEncap/AuthDecap Interface</a>
3389 </h4>
3390 <p id="section-9.2.2-1">The analysis of HPKE's Auth mode single-shot encryption API in <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span>
3391 provides composition theorems that guarantee that HPKE's Auth mode achieves
3392 its desired security properties if the KEM's <code>AuthEncap()</code>/<code>AuthDecap()</code>
3393 interface satisfies multi-user Outsider-CCA, Outsider-Auth, and
3394 Insider-CCA security, as defined in the same paper.<a href="#section-9.2.2-1" class="pilcrow">¶</a></p>
3395 <p id="section-9.2.2-2">Intuitively, Outsider-CCA security formalizes confidentiality, and
3396 Outsider-Auth security formalizes authentication of the KEM shared secret
3397 in case none of the sender or recipient private keys are compromised.
3398 Insider-CCA security formalizes confidentiality of the KEM shared secret
3399 in case the sender private key is known or chosen by the adversary.
3400 (If the recipient private key is known or chosen by the adversary,
3401 confidentiality is trivially broken, because then the adversary knows
3402 all secrets on the recipient's side).<a href="#section-9.2.2-2" class="pilcrow">¶</a></p>
3403 <p id="section-9.2.2-3">An Insider-Auth security notion would formalize authentication of the
3404 KEM shared secret in case the recipient private key is known or chosen
3405 by the adversary. (If the sender private key is known or chosen by the
3406 adversary, it can create KEM ciphertexts in the name of the sender).
3407 Because of the generic attack on an analogous Insider-Auth security
3408 notion of HPKE described in <a href="#sec-properties" class="xref">Section 9.1</a>, a definition of
3409 Insider-Auth security for KEMs used within HPKE is not useful.<a href="#section-9.2.2-3" class="pilcrow">¶</a></p>
3410 </section>
3411 </div>
3412 <div id="kem-key-reuse">
3413 <section id="section-9.2.3">
3414 <h4 id="name-kem-key-reuse">
3415 <a href="#section-9.2.3" class="section-number selfRef">9.2.3. </a><a href="#name-kem-key-reuse" class="section-name selfRef">KEM Key Reuse</a>
3416 </h4>
3417 <p id="section-9.2.3-1">An <code>ikm</code> input to <code>DeriveKeyPair()</code> (<a href="#derive-key-pair" class="xref">Section 7.1.3</a>) <span class="bcp14">MUST NOT</span> be
3418 reused elsewhere, in particular not with <code>DeriveKeyPair()</code> of a
3419 different KEM.<a href="#section-9.2.3-1" class="pilcrow">¶</a></p>
3420 <p id="section-9.2.3-2">The randomness used in <code>Encap()</code> and <code>AuthEncap()</code> to generate the
3421 KEM shared secret or its encapsulation <span class="bcp14">MUST NOT</span> be reused elsewhere.<a href="#section-9.2.3-2" class="pilcrow">¶</a></p>
3422 <p id="section-9.2.3-3">Since a KEM key pair belonging to a sender or recipient works with all modes, it can
3423 be used with multiple modes in parallel. HPKE is constructed to be
3424 secure in such settings due to domain separation using the <code>suite_id</code>
3425 variable. However, there is no formal proof of security at the time of
3426 writing for using multiple modes in parallel; <span>[<a href="#HPKEAnalysis" class="xref">HPKEAnalysis</a>]</span> and
3427 <span>[<a href="#ABHKLR20" class="xref">ABHKLR20</a>]</span> only analyze isolated modes.<a href="#section-9.2.3-3" class="pilcrow">¶</a></p>
3428 </section>
3429 </div>
3430 </section>
3431 </div>
3432 <div id="kdf-choice">
3433 <section id="section-9.3">
3434 <h3 id="name-security-requirements-on-a-k">
3435 <a href="#section-9.3" class="section-number selfRef">9.3. </a><a href="#name-security-requirements-on-a-k" class="section-name selfRef">Security Requirements on a KDF</a>
3436 </h3>
3437 <p id="section-9.3-1">The choice of the KDF for HPKE <span class="bcp14">SHOULD</span> be made based on the security
3438 level provided by the KEM and, if applicable, by the PSK. The KDF
3439 <span class="bcp14">SHOULD</span> at least have the security level of the KEM and <span class="bcp14">SHOULD</span>
3440 at least have the security level provided by the PSK.<a href="#section-9.3-1" class="pilcrow">¶</a></p>
3441 </section>
3442 </div>
3443 <div id="aead-security">
3444 <section id="section-9.4">
3445 <h3 id="name-security-requirements-on-an">
3446 <a href="#section-9.4" class="section-number selfRef">9.4. </a><a href="#name-security-requirements-on-an" class="section-name selfRef">Security Requirements on an AEAD</a>
3447 </h3>
3448 <p id="section-9.4-1">All AEADs <span class="bcp14">MUST</span> be IND-CCA2-secure, as is currently true for all AEADs
3449 listed in <a href="#aead-ids" class="xref">Section 7.3</a>.<a href="#section-9.4-1" class="pilcrow">¶</a></p>
3450 </section>
3451 </div>
3452 <div id="security-psk">
3453 <section id="section-9.5">
3454 <h3 id="name-pre-shared-key-recommendati">
3455 <a href="#section-9.5" class="section-number selfRef">9.5. </a><a href="#name-pre-shared-key-recommendati" class="section-name selfRef">Pre-Shared Key Recommendations</a>
3456 </h3>
3457 <p id="section-9.5-1">In the PSK and AuthPSK modes, the PSK <span class="bcp14">MUST</span> have at least 32 bytes of
3458 entropy and <span class="bcp14">SHOULD</span> be of length <code>Nh</code> bytes or longer. Using a PSK longer than
3459 32 bytes but shorter than <code>Nh</code> bytes is permitted.<a href="#section-9.5-1" class="pilcrow">¶</a></p>
3460 <p id="section-9.5-2">HPKE is specified to use HKDF as its key derivation function. HKDF is not
3461 designed to slow down dictionary attacks (see <span>[<a href="#RFC5869" class="xref">RFC5869</a>]</span>). Thus, HPKE's
3462 PSK mechanism is not suitable for use with a low-entropy password as the
3463 PSK: In scenarios in which the adversary knows the KEM shared secret
3464 <code>shared_secret</code> and has access to an oracle that distinguishes between
3465 a good and a wrong PSK, it can perform PSK-recovering attacks. This oracle
3466 can be the decryption operation on a captured HPKE ciphertext or any other
3467 recipient behavior that is observably different when using a wrong PSK.
3468 The adversary knows the KEM shared secret <code>shared_secret</code> if it knows all
3469 KEM private keys of one participant. In the PSK mode, this is trivially
3470 the case if the adversary acts as the sender.<a href="#section-9.5-2" class="pilcrow">¶</a></p>
3471 <p id="section-9.5-3">To recover a lower entropy PSK, an attacker in this scenario can trivially
3472 perform a dictionary attack. Given a set <code>S</code> of possible PSK values, the
3473 attacker generates an HPKE ciphertext for each value in <code>S</code>, and submits
3474 the resulting ciphertexts to the oracle to learn which PSK is being used by
3475 the recipient. Further, because HPKE uses AEAD schemes that are not key-committing,
3476 an attacker can mount a partitioning oracle attack <span>[<a href="#LGR20" class="xref">LGR20</a>]</span> that can recover
3477 the PSK from a set of <code>S</code> possible PSK values, with |S| = m*k, in roughly
3478 m + log k queries to the oracle using ciphertexts of length proportional to
3479 k, the maximum message length in blocks. (Applying the multi-collision algorithm from
3480 <span>[<a href="#LGR20" class="xref">LGR20</a>]</span> requires a small adaptation to the algorithm wherein the appropriate nonce
3481 is computed for each candidate key. This modification adds one call to HKDF per key.
3482 The number of partitioning oracle queries remains unchanged.) As a result, the PSK
3483 must therefore be chosen with sufficient entropy so that m + log k is prohibitive for
3484 attackers (e.g., 2^128). Future specifications can define new AEAD algorithms that
3485 are key-committing.<a href="#section-9.5-3" class="pilcrow">¶</a></p>
3486 </section>
3487 </div>
3488 <div id="domain-separation">
3489 <section id="section-9.6">
3490 <h3 id="name-domain-separation">
3491 <a href="#section-9.6" class="section-number selfRef">9.6. </a><a href="#name-domain-separation" class="section-name selfRef">Domain Separation</a>
3492 </h3>
3493 <p id="section-9.6-1">HPKE allows combining a DHKEM variant <code>DHKEM(Group, KDF')</code> and a KDF
3494 such that both KDFs are instantiated by the same KDF. By design, the
3495 calls to <code>Extract()</code> and <code>Expand()</code> inside DHKEM and the remainder of
3496 HPKE use separate input domains. This justifies modeling them as
3497 independent functions even if instantiated by the same KDF.
3498 This domain separation between DHKEM and the remainder of HPKE is achieved by
3499 using prefix-free sets of <code>suite_id</code> values in <code>LabeledExtract()</code> and <code>LabeledExpand()</code> (<code>KEM...</code> in DHKEM and <code>HPKE...</code> in the remainder of HPKE). Recall that a set is prefix-free if no element is a prefix of
3500 another within the set.<a href="#section-9.6-1" class="pilcrow">¶</a></p>
3501 <p id="section-9.6-2">Future KEM instantiations <span class="bcp14">MUST</span> ensure, should <code>Extract()</code> and
3502 <code>Expand()</code> be used internally, that they can be modeled as functions
3503 independent from the invocations of <code>Extract()</code> and <code>Expand()</code> in the
3504 remainder of HPKE. One way to ensure this is by using <code>LabeledExtract()</code>
3505 and <code>LabeledExpand()</code> with a <code>suite_id</code> as defined in <a href="#base-crypto" class="xref">Section 4</a>,
3506 which will ensure input domain separation, as outlined above.
3507 Particular attention needs to
3508 be paid if the KEM directly invokes functions that are used internally
3509 in HPKE's <code>Extract()</code> or <code>Expand()</code>, such as <code>Hash()</code> and <code>HMAC()</code> in the case of HKDF.
3510 It <span class="bcp14">MUST</span> be ensured that inputs to these invocations cannot collide with
3511 inputs to the internal invocations of these functions inside <code>Extract()</code> or
3512 <code>Expand()</code>. In HPKE's <code>KeySchedule()</code> this is avoided by using <code>Extract()</code> instead of
3513 <code>Hash()</code> on the arbitrary-length inputs <code>info</code> and <code>psk_id</code>.<a href="#section-9.6-2" class="pilcrow">¶</a></p>
3514 <p id="section-9.6-3">The string literal "HPKE-v1" used in <code>LabeledExtract()</code> and <code>LabeledExpand()</code>
3515 ensures that any secrets derived in HPKE are bound to the scheme's name
3516 and version, even when possibly derived from the same Diffie-Hellman or
3517 KEM shared secret as in another scheme or version.<a href="#section-9.6-3" class="pilcrow">¶</a></p>
3518 </section>
3519 </div>
3520 <div id="non-goals">
3521 <section id="section-9.7">
3522 <h3 id="name-application-embedding-and-n">
3523 <a href="#section-9.7" class="section-number selfRef">9.7. </a><a href="#name-application-embedding-and-n" class="section-name selfRef">Application Embedding and Non-Goals</a>
3524 </h3>
3525 <p id="section-9.7-1">HPKE is designed to be a fairly low-level mechanism. As a result, it assumes
3526 that certain properties are provided by the application in which HPKE is
3527 embedded and leaves certain security properties to be provided by other
3528 mechanisms. Otherwise said, certain properties are out of scope for HPKE.<a href="#section-9.7-1" class="pilcrow">¶</a></p>
3529 <div id="message-order-and-message-loss">
3530 <section id="section-9.7.1">
3531 <h4 id="name-message-order-and-message-l">
3532 <a href="#section-9.7.1" class="section-number selfRef">9.7.1. </a><a href="#name-message-order-and-message-l" class="section-name selfRef">Message Order and Message Loss</a>
3533 </h4>
3534 <p id="section-9.7.1-1">The primary requirement that HPKE imposes on applications is the requirement
3535 that ciphertexts <span class="bcp14">MUST</span> be presented to <code>ContextR.Open()</code> in the same order in
3536 which they were generated by <code>ContextS.Seal()</code>. When the single-shot API is
3537 used (see <a href="#single-shot-apis" class="xref">Section 6</a>), this is trivially true (since there is only
3538 ever one ciphertext). Applications that allow for multiple invocations of
3539 <code>Open()</code> / <code>Seal()</code> on the same context <span class="bcp14">MUST</span> enforce the ordering property
3540 described above.<a href="#section-9.7.1-1" class="pilcrow">¶</a></p>
3541 <p id="section-9.7.1-2">Ordering requirements of this character are usually fulfilled by providing a
3542 sequence number in the framing of encrypted messages. Whatever information is
3543 used to determine the ordering of HPKE-encrypted messages <span class="bcp14">SHOULD</span> be included in
3544 the associated data passed to <code>ContextS.Seal()</code> and <code>ContextR.Open()</code>. The specifics of
3545 this scheme are up to the application.<a href="#section-9.7.1-2" class="pilcrow">¶</a></p>
3546 <p id="section-9.7.1-3">HPKE is not tolerant of lost messages. Applications <span class="bcp14">MUST</span> be able to detect when
3547 a message has been lost. When an unrecoverable loss is detected, the application <span class="bcp14">MUST</span> discard
3548 any associated HPKE context.<a href="#section-9.7.1-3" class="pilcrow">¶</a></p>
3549 </section>
3550 </div>
3551 <div id="downgrade-prevention">
3552 <section id="section-9.7.2">
3553 <h4 id="name-downgrade-prevention">
3554 <a href="#section-9.7.2" class="section-number selfRef">9.7.2. </a><a href="#name-downgrade-prevention" class="section-name selfRef">Downgrade Prevention</a>
3555 </h4>
3556 <p id="section-9.7.2-1">HPKE assumes that the sender and recipient agree on what algorithms to use.
3557 Depending on how these algorithms are negotiated, it may be possible for an
3558 intermediary to force the two parties to use suboptimal algorithms.<a href="#section-9.7.2-1" class="pilcrow">¶</a></p>
3559 </section>
3560 </div>
3561 <div id="replay-protection">
3562 <section id="section-9.7.3">
3563 <h4 id="name-replay-protection">
3564 <a href="#section-9.7.3" class="section-number selfRef">9.7.3. </a><a href="#name-replay-protection" class="section-name selfRef">Replay Protection</a>
3565 </h4>
3566 <p id="section-9.7.3-1">The requirement that ciphertexts be presented to the <code>ContextR.Open()</code> function
3567 in the same order they were generated by <code>ContextS.Seal()</code> provides a degree of
3568 replay protection within a stream of ciphertexts resulting from a given context.
3569 HPKE provides no other replay protection.<a href="#section-9.7.3-1" class="pilcrow">¶</a></p>
3570 </section>
3571 </div>
3572 <div id="forward-secrecy">
3573 <section id="section-9.7.4">
3574 <h4 id="name-forward-secrecy">
3575 <a href="#section-9.7.4" class="section-number selfRef">9.7.4. </a><a href="#name-forward-secrecy" class="section-name selfRef">Forward Secrecy</a>
3576 </h4>
3577 <p id="section-9.7.4-1">HPKE ciphertexts are not forward secret with respect to recipient compromise
3578 in any mode. This means that compromise of long-term recipient secrets allows
3579 an attacker to decrypt past ciphertexts encrypted under said secrets. This is because
3580 only long-term secrets are used on the side of the recipient.<a href="#section-9.7.4-1" class="pilcrow">¶</a></p>
3581 <p id="section-9.7.4-2">HPKE ciphertexts are forward secret with respect to sender compromise in all
3582 modes. This is because ephemeral randomness is used on the sender's side, which
3583 is supposed to be erased directly after computation of the KEM shared secret and
3584 ciphertext.<a href="#section-9.7.4-2" class="pilcrow">¶</a></p>
3585 </section>
3586 </div>
3587 <div id="bad-ephemeral-randomness">
3588 <section id="section-9.7.5">
3589 <h4 id="name-bad-ephemeral-randomness">
3590 <a href="#section-9.7.5" class="section-number selfRef">9.7.5. </a><a href="#name-bad-ephemeral-randomness" class="section-name selfRef">Bad Ephemeral Randomness</a>
3591 </h4>
3592 <p id="section-9.7.5-1">If the randomness used for KEM encapsulation is bad -- i.e., of low entropy or
3593 compromised because of a broken or subverted random number generator -- the
3594 confidentiality guarantees of HPKE degrade significantly. In Base mode,
3595 confidentiality guarantees can be lost completely; in the other modes, at least forward secrecy with
3596 respect to sender compromise can be lost completely.<a href="#section-9.7.5-1" class="pilcrow">¶</a></p>
3597 <p id="section-9.7.5-2">Such a situation could also lead to the reuse of the same KEM shared secret
3598 and thus to the reuse of same key-nonce pairs for the AEAD.
3599 The AEADs specified in this document are not secure
3600 in case of nonce reuse. This attack vector is particularly relevant in
3601 authenticated modes because knowledge of the ephemeral randomness is not
3602 enough to derive <code>shared_secret</code> in these modes.<a href="#section-9.7.5-2" class="pilcrow">¶</a></p>
3603 <p id="section-9.7.5-3">One way for applications to mitigate the impacts of bad ephemeral randomness is
3604 to combine ephemeral randomness with a local long-term secret that has been
3605 generated securely, as described in <span>[<a href="#RFC8937" class="xref">RFC8937</a>]</span>.<a href="#section-9.7.5-3" class="pilcrow">¶</a></p>
3606 </section>
3607 </div>
3608 <div id="hiding-plaintext-length">
3609 <section id="section-9.7.6">
3610 <h4 id="name-hiding-plaintext-length">
3611 <a href="#section-9.7.6" class="section-number selfRef">9.7.6. </a><a href="#name-hiding-plaintext-length" class="section-name selfRef">Hiding Plaintext Length</a>
3612 </h4>
3613 <p id="section-9.7.6-1">AEAD ciphertexts produced by HPKE do not hide the plaintext length. Applications
3614 requiring this level of privacy should use a suitable padding mechanism. See
3615 <span>[<a href="#I-D.ietf-tls-esni" class="xref">TLS-ECH</a>]</span> and <span>[<a href="#RFC8467" class="xref">RFC8467</a>]</span> for examples of protocol-specific
3616 padding policies.<a href="#section-9.7.6-1" class="pilcrow">¶</a></p>
3617 </section>
3618 </div>
3619 </section>
3620 </div>
3621 <div id="bidirectional">
3622 <section id="section-9.8">
3623 <h3 id="name-bidirectional-encryption">
3624 <a href="#section-9.8" class="section-number selfRef">9.8. </a><a href="#name-bidirectional-encryption" class="section-name selfRef">Bidirectional Encryption</a>
3625 </h3>
3626 <p id="section-9.8-1">As discussed in <a href="#hpke-dem" class="xref">Section 5.2</a>, HPKE encryption is unidirectional from sender
3627 to recipient. Applications that require bidirectional encryption can derive
3628 necessary keying material with the secret export interface (<a href="#hpke-export" class="xref">Section 5.3</a>).
3629 The type and length of such keying material depends on the application use
3630 case.<a href="#section-9.8-1" class="pilcrow">¶</a></p>
3631 <p id="section-9.8-2">As an example, if an application needs AEAD encryption from the recipient to the
3632 sender, it can derive a key and nonce from the corresponding HPKE context
3633 as follows:<a href="#section-9.8-2" class="pilcrow">¶</a></p>
3634 <div id="section-9.8-3">
3635 <pre class="lang-pseudocode sourcecode">
3636 key = context.Export("response key", Nk)
3637 nonce = context.Export("response nonce", Nn)
3638 </pre><a href="#section-9.8-3" class="pilcrow">¶</a>
3639 </div>
3640 <p id="section-9.8-4">In this example, the length of each secret is based on the AEAD algorithm
3641 used for the corresponding HPKE context.<a href="#section-9.8-4" class="pilcrow">¶</a></p>
3642 <p id="section-9.8-5">Note that HPKE's limitations with regard to sender authentication become limits
3643 on recipient authentication in this context. In particular, in the Base mode,
3644 there is no authentication of the remote party at all. Even in the Auth mode,
3645 where the remote party has proven that they hold a specific private key, this
3646 authentication is still subject to key-compromise impersonation, as discussed
3647 in <a href="#kci" class="xref">Section 9.1.1</a>.<a href="#section-9.8-5" class="pilcrow">¶</a></p>
3648 </section>
3649 </div>
3650 <div id="metadata-protection">
3651 <section id="section-9.9">
3652 <h3 id="name-metadata-protection">
3653 <a href="#section-9.9" class="section-number selfRef">9.9. </a><a href="#name-metadata-protection" class="section-name selfRef">Metadata Protection</a>
3654 </h3>
3655 <p id="section-9.9-1">The authenticated modes of HPKE (PSK, Auth, and AuthPSK) require that the recipient
3656 know what key material to use for the sender. This can be signaled in
3657 applications by sending the PSK ID (<code>psk_id</code> above) and/or the sender's public
3658 key (<code>pkS</code>). However, these values themselves might be considered sensitive,
3659 since, in a given application context, they might identify the sender.<a href="#section-9.9-1" class="pilcrow">¶</a></p>
3660 <p id="section-9.9-2">An application that wishes to protect these metadata values without requiring
3661 further provisioning of keys can use an additional instance of HPKE, using the
3662 unauthenticated Base mode. Where the application might have sent <code>(psk_id, pkS,
3663 enc, ciphertext)</code> before, it would now send <code>(enc2, ciphertext2, enc, ciphertext)</code>,
3664 where <code>(enc2, ciphertext2)</code> represent the encryption of the <code>psk_id</code> and <code>pkS</code>
3665 values.<a href="#section-9.9-2" class="pilcrow">¶</a></p>
3666 <p id="section-9.9-3">The cost of this approach is an additional KEM operation each for the sender and
3667 the recipient. A potential lower-cost approach (involving only symmetric
3668 operations) would be available if the nonce-protection schemes in <span>[<a href="#BNT19" class="xref">BNT19</a>]</span>
3669 could be extended to cover other metadata. However, this construction would
3670 require further analysis.<a href="#section-9.9-3" class="pilcrow">¶</a></p>
3671 </section>
3672 </div>
3673 </section>
3674 </div>
3675 <div id="message-encoding">
3676 <section id="section-10">
3677 <h2 id="name-message-encoding">
3678 <a href="#section-10" class="section-number selfRef">10. </a><a href="#name-message-encoding" class="section-name selfRef">Message Encoding</a>
3679 </h2>
3680 <p id="section-10-1">This document does not specify a wire format encoding for HPKE messages. Applications
3681 that adopt HPKE must therefore specify an unambiguous encoding mechanism that includes,
3682 minimally: the encapsulated value <code>enc</code>, ciphertext value(s) (and order if there are
3683 multiple), and any info values that are not implicit. One example of a non-implicit
3684 value is the recipient public key used for encapsulation, which may be needed if a
3685 recipient has more than one public key.<a href="#section-10-1" class="pilcrow">¶</a></p>
3686 <p id="section-10-2">The AEAD interface used in this document is based on <span>[<a href="#RFC5116" class="xref">RFC5116</a>]</span>, which produces and
3687 consumes a single ciphertext value. As discussed in <span>[<a href="#RFC5116" class="xref">RFC5116</a>]</span>, this ciphertext value
3688 contains the encrypted plaintext as well as any authentication data, encoded in a manner
3689 described by the individual AEAD scheme. Some implementations are not structured in this
3690 way, instead providing a separate ciphertext and authentication tag. When such
3691 AEAD implementations are used in HPKE implementations, the HPKE implementation must combine
3692 these inputs into a single ciphertext value within <code>Seal()</code> and parse them out within
3693 <code>Open()</code>, where the parsing details are defined by the AEAD scheme. For example, with
3694 the AES-GCM schemes specified in this document, the GCM authentication tag is placed in
3695 the last Nt bytes of the ciphertext output.<a href="#section-10-2" class="pilcrow">¶</a></p>
3696 </section>
3697 </div>
3698 <div id="iana">
3699 <section id="section-11">
3700 <h2 id="name-iana-considerations">
3701 <a href="#section-11" class="section-number selfRef">11. </a><a href="#name-iana-considerations" class="section-name selfRef">IANA Considerations</a>
3702 </h2>
3703 <p id="section-11-1">IANA has created three new registries:<a href="#section-11-1" class="pilcrow">¶</a></p>
3704 <ul class="normal">
3705 <li class="normal" id="section-11-2.1">HPKE KEM Identifiers<a href="#section-11-2.1" class="pilcrow">¶</a>
3706 </li>
3707 <li class="normal" id="section-11-2.2">HPKE KDF Identifiers<a href="#section-11-2.2" class="pilcrow">¶</a>
3708 </li>
3709 <li class="normal" id="section-11-2.3">HPKE AEAD Identifiers<a href="#section-11-2.3" class="pilcrow">¶</a>
3710 </li>
3711 </ul>
3712 <p id="section-11-3">All these registries are under "Hybrid Public Key
3713 Encryption", and administered under a Specification Required policy <span>[<a href="#RFC8126" class="xref">RFC8126</a>]</span>.<a href="#section-11-3" class="pilcrow">¶</a></p>
3714 <div id="kem-template">
3715 <section id="section-11.1">
3716 <h3 id="name-kem-identifiers">
3717 <a href="#section-11.1" class="section-number selfRef">11.1. </a><a href="#name-kem-identifiers" class="section-name selfRef">KEM Identifiers</a>
3718 </h3>
3719 <p id="section-11.1-1">The "HPKE KEM Identifiers" registry lists identifiers for key encapsulation
3720 algorithms defined for use with HPKE. These identifiers are two-byte values,
3721 so the maximum possible value is 0xFFFF = 65535.<a href="#section-11.1-1" class="pilcrow">¶</a></p>
3722 <span class="break"></span><dl class="dlNewline" id="section-11.1-2">
3723 <dt id="section-11.1-2.1">Template:</dt>
3724 <dd style="margin-left: 1.5em" id="section-11.1-2.2">
3725 <span class="break"></span><dl class="dlParallel" id="section-11.1-2.2.1">
3726 <dt id="section-11.1-2.2.1.1">Value:</dt>
3727 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.2">The two-byte identifier for the algorithm<a href="#section-11.1-2.2.1.2" class="pilcrow">¶</a>
3728 </dd>
3729 <dd class="break"></dd>
3730 <dt id="section-11.1-2.2.1.3">KEM:</dt>
3731 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.4">The name of the algorithm<a href="#section-11.1-2.2.1.4" class="pilcrow">¶</a>
3732 </dd>
3733 <dd class="break"></dd>
3734 <dt id="section-11.1-2.2.1.5">Nsecret:</dt>
3735 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.6">The length in bytes of a KEM shared secret produced by the algorithm<a href="#section-11.1-2.2.1.6" class="pilcrow">¶</a>
3736 </dd>
3737 <dd class="break"></dd>
3738 <dt id="section-11.1-2.2.1.7">Nenc:</dt>
3739 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.8">The length in bytes of an encoded encapsulated key produced by the
3740 algorithm<a href="#section-11.1-2.2.1.8" class="pilcrow">¶</a>
3741 </dd>
3742 <dd class="break"></dd>
3743 <dt id="section-11.1-2.2.1.9">Npk:</dt>
3744 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.10">The length in bytes of an encoded public key for the algorithm<a href="#section-11.1-2.2.1.10" class="pilcrow">¶</a>
3745 </dd>
3746 <dd class="break"></dd>
3747 <dt id="section-11.1-2.2.1.11">Nsk:</dt>
3748 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.12">The length in bytes of an encoded private key for the algorithm<a href="#section-11.1-2.2.1.12" class="pilcrow">¶</a>
3749 </dd>
3750 <dd class="break"></dd>
3751 <dt id="section-11.1-2.2.1.13">Auth:</dt>
3752 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.14">A boolean indicating if this algorithm provides the
3753 <code>AuthEncap()</code>/<code>AuthDecap()</code> interface<a href="#section-11.1-2.2.1.14" class="pilcrow">¶</a>
3754 </dd>
3755 <dd class="break"></dd>
3756 <dt id="section-11.1-2.2.1.15">Reference:</dt>
3757 <dd style="margin-left: 1.5em" id="section-11.1-2.2.1.16">Where this algorithm is defined<a href="#section-11.1-2.2.1.16" class="pilcrow">¶</a>
3758 </dd>
3759 <dd class="break"></dd>
3760 </dl>
3761 </dd>
3762 <dd class="break"></dd>
3763 </dl>
3764 <span class="break"></span><dl class="dlParallel" id="section-11.1-3">
3765 <dt id="section-11.1-3.1">Initial contents:</dt>
3766 <dd style="margin-left: 1.5em" id="section-11.1-3.2">Provided in <a href="#kemid-values" class="xref">Table 2</a><a href="#section-11.1-3.2" class="pilcrow">¶</a>
3767 </dd>
3768 <dd class="break"></dd>
3769 </dl>
3770 </section>
3771 </div>
3772 <div id="kdf-identifiers">
3773 <section id="section-11.2">
3774 <h3 id="name-kdf-identifiers">
3775 <a href="#section-11.2" class="section-number selfRef">11.2. </a><a href="#name-kdf-identifiers" class="section-name selfRef">KDF Identifiers</a>
3776 </h3>
3777 <p id="section-11.2-1">The "HPKE KDF Identifiers" registry lists identifiers for key derivation
3778 functions defined for use with HPKE. These identifiers are two-byte values,
3779 so the maximum possible value is 0xFFFF = 65535.<a href="#section-11.2-1" class="pilcrow">¶</a></p>
3780 <span class="break"></span><dl class="dlNewline" id="section-11.2-2">
3781 <dt id="section-11.2-2.1">Template:</dt>
3782 <dd style="margin-left: 1.5em" id="section-11.2-2.2">
3783 <span class="break"></span><dl class="dlParallel" id="section-11.2-2.2.1">
3784 <dt id="section-11.2-2.2.1.1">Value:</dt>
3785 <dd style="margin-left: 1.5em" id="section-11.2-2.2.1.2">The two-byte identifier for the algorithm<a href="#section-11.2-2.2.1.2" class="pilcrow">¶</a>
3786 </dd>
3787 <dd class="break"></dd>
3788 <dt id="section-11.2-2.2.1.3">KDF:</dt>
3789 <dd style="margin-left: 1.5em" id="section-11.2-2.2.1.4">The name of the algorithm<a href="#section-11.2-2.2.1.4" class="pilcrow">¶</a>
3790 </dd>
3791 <dd class="break"></dd>
3792 <dt id="section-11.2-2.2.1.5">Nh:</dt>
3793 <dd style="margin-left: 1.5em" id="section-11.2-2.2.1.6">The output size of the Extract function in bytes<a href="#section-11.2-2.2.1.6" class="pilcrow">¶</a>
3794 </dd>
3795 <dd class="break"></dd>
3796 <dt id="section-11.2-2.2.1.7">Reference:</dt>
3797 <dd style="margin-left: 1.5em" id="section-11.2-2.2.1.8">Where this algorithm is defined<a href="#section-11.2-2.2.1.8" class="pilcrow">¶</a>
3798 </dd>
3799 <dd class="break"></dd>
3800 </dl>
3801 </dd>
3802 <dd class="break"></dd>
3803 </dl>
3804 <span class="break"></span><dl class="dlParallel" id="section-11.2-3">
3805 <dt id="section-11.2-3.1">Initial contents:</dt>
3806 <dd style="margin-left: 1.5em" id="section-11.2-3.2">Provided in <a href="#kdfid-values" class="xref">Table 3</a><a href="#section-11.2-3.2" class="pilcrow">¶</a>
3807 </dd>
3808 <dd class="break"></dd>
3809 </dl>
3810 </section>
3811 </div>
3812 <div id="aead-identifiers">
3813 <section id="section-11.3">
3814 <h3 id="name-aead-identifiers">
3815 <a href="#section-11.3" class="section-number selfRef">11.3. </a><a href="#name-aead-identifiers" class="section-name selfRef">AEAD Identifiers</a>
3816 </h3>
3817 <p id="section-11.3-1">The "HPKE AEAD Identifiers" registry lists identifiers for authenticated
3818 encryption with associated data (AEAD) algorithms defined for use with HPKE.
3819 These identifiers are two-byte values, so the maximum possible value is
3820 0xFFFF = 65535.<a href="#section-11.3-1" class="pilcrow">¶</a></p>
3821 <span class="break"></span><dl class="dlNewline" id="section-11.3-2">
3822 <dt id="section-11.3-2.1">Template:</dt>
3823 <dd style="margin-left: 1.5em" id="section-11.3-2.2">
3824 <span class="break"></span><dl class="dlParallel" id="section-11.3-2.2.1">
3825 <dt id="section-11.3-2.2.1.1">Value:</dt>
3826 <dd style="margin-left: 1.5em" id="section-11.3-2.2.1.2">The two-byte identifier for the algorithm<a href="#section-11.3-2.2.1.2" class="pilcrow">¶</a>
3827 </dd>
3828 <dd class="break"></dd>
3829 <dt id="section-11.3-2.2.1.3">AEAD:</dt>
3830 <dd style="margin-left: 1.5em" id="section-11.3-2.2.1.4">The name of the algorithm<a href="#section-11.3-2.2.1.4" class="pilcrow">¶</a>
3831 </dd>
3832 <dd class="break"></dd>
3833 <dt id="section-11.3-2.2.1.5">Nk:</dt>
3834 <dd style="margin-left: 1.5em" id="section-11.3-2.2.1.6">The length in bytes of a key for this algorithm<a href="#section-11.3-2.2.1.6" class="pilcrow">¶</a>
3835 </dd>
3836 <dd class="break"></dd>
3837 <dt id="section-11.3-2.2.1.7">Nn:</dt>
3838 <dd style="margin-left: 1.5em" id="section-11.3-2.2.1.8">The length in bytes of a nonce for this algorithm<a href="#section-11.3-2.2.1.8" class="pilcrow">¶</a>
3839 </dd>
3840 <dd class="break"></dd>
3841 <dt id="section-11.3-2.2.1.9">Nt:</dt>
3842 <dd style="margin-left: 1.5em" id="section-11.3-2.2.1.10">The length in bytes of an authentication tag for this algorithm<a href="#section-11.3-2.2.1.10" class="pilcrow">¶</a>
3843 </dd>
3844 <dd class="break"></dd>
3845 <dt id="section-11.3-2.2.1.11">Reference:</dt>
3846 <dd style="margin-left: 1.5em" id="section-11.3-2.2.1.12">Where this algorithm is defined<a href="#section-11.3-2.2.1.12" class="pilcrow">¶</a>
3847 </dd>
3848 <dd class="break"></dd>
3849 </dl>
3850 </dd>
3851 <dd class="break"></dd>
3852 </dl>
3853 <span class="break"></span><dl class="dlParallel" id="section-11.3-3">
3854 <dt id="section-11.3-3.1">Initial contents:</dt>
3855 <dd style="margin-left: 1.5em" id="section-11.3-3.2">Provided in <a href="#aeadid-values" class="xref">Table 5</a><a href="#section-11.3-3.2" class="pilcrow">¶</a>
3856 </dd>
3857 <dd class="break"></dd>
3858 </dl>
3859 </section>
3860 </div>
3861 </section>
3862 </div>
3863 <section id="section-12">
3864 <h2 id="name-references">
3865 <a href="#section-12" class="section-number selfRef">12. </a><a href="#name-references" class="section-name selfRef">References</a>
3866 </h2>
3867 <section id="section-12.1">
3868 <h3 id="name-normative-references">
3869 <a href="#section-12.1" class="section-number selfRef">12.1. </a><a href="#name-normative-references" class="section-name selfRef">Normative References</a>
3870 </h3>
3871 <dl class="references">
3872 <dt id="RFC2119">[RFC2119]</dt>
3873 <dd>
3874 <span class="refAuthor">Bradner, S.</span>, <span class="refTitle">"Key words for use in RFCs to Indicate Requirement Levels"</span>, <span class="seriesInfo">BCP 14</span>, <span class="seriesInfo">RFC 2119</span>, <span class="seriesInfo">DOI 10.17487/RFC2119</span>, <time datetime="1997-03" class="refDate">March 1997</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>&gt;</span>. </dd>
3875 <dd class="break"></dd>
3876 <dt id="RFC5116">[RFC5116]</dt>
3877 <dd>
3878 <span class="refAuthor">McGrew, D.</span>, <span class="refTitle">"An Interface and Algorithms for Authenticated Encryption"</span>, <span class="seriesInfo">RFC 5116</span>, <span class="seriesInfo">DOI 10.17487/RFC5116</span>, <time datetime="2008-01" class="refDate">January 2008</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc5116">https://www.rfc-editor.org/info/rfc5116</a>&gt;</span>. </dd>
3879 <dd class="break"></dd>
3880 <dt id="RFC8017">[RFC8017]</dt>
3881 <dd>
3882 <span class="refAuthor">Moriarty, K., Ed.</span>, <span class="refAuthor">Kaliski, B.</span>, <span class="refAuthor">Jonsson, J.</span>, and <span class="refAuthor">A. Rusch</span>, <span class="refTitle">"PKCS #1: RSA Cryptography Specifications Version 2.2"</span>, <span class="seriesInfo">RFC 8017</span>, <span class="seriesInfo">DOI 10.17487/RFC8017</span>, <time datetime="2016-11" class="refDate">November 2016</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8017">https://www.rfc-editor.org/info/rfc8017</a>&gt;</span>. </dd>
3883 <dd class="break"></dd>
3884 <dt id="RFC8126">[RFC8126]</dt>
3885 <dd>
3886 <span class="refAuthor">Cotton, M.</span>, <span class="refAuthor">Leiba, B.</span>, and <span class="refAuthor">T. Narten</span>, <span class="refTitle">"Guidelines for Writing an IANA Considerations Section in RFCs"</span>, <span class="seriesInfo">BCP 26</span>, <span class="seriesInfo">RFC 8126</span>, <span class="seriesInfo">DOI 10.17487/RFC8126</span>, <time datetime="2017-06" class="refDate">June 2017</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8126">https://www.rfc-editor.org/info/rfc8126</a>&gt;</span>. </dd>
3887 <dd class="break"></dd>
3888 <dt id="RFC8174">[RFC8174]</dt>
3889 <dd>
3890 <span class="refAuthor">Leiba, B.</span>, <span class="refTitle">"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"</span>, <span class="seriesInfo">BCP 14</span>, <span class="seriesInfo">RFC 8174</span>, <span class="seriesInfo">DOI 10.17487/RFC8174</span>, <time datetime="2017-05" class="refDate">May 2017</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>&gt;</span>. </dd>
3891 <dd class="break"></dd>
3892 </dl>
3893 </section>
3894 <section id="section-12.2">
3895 <h3 id="name-informative-references">
3896 <a href="#section-12.2" class="section-number selfRef">12.2. </a><a href="#name-informative-references" class="section-name selfRef">Informative References</a>
3897 </h3>
3898 <dl class="references">
3899 <dt id="ABHKLR20">[ABHKLR20]</dt>
3900 <dd>
3901 <span class="refAuthor">Alwen, J.</span>, <span class="refAuthor">Blanchet, B.</span>, <span class="refAuthor">Hauck, E.</span>, <span class="refAuthor">Kiltz, E.</span>, <span class="refAuthor">Lipp, B.</span>, and <span class="refAuthor">D. Riepel</span>, <span class="refTitle">"Analysing the HPKE Standard"</span>, <time datetime="2020-11" class="refDate">November 2020</time>, <span>&lt;<a href="https://eprint.iacr.org/2020/1499">https://eprint.iacr.org/2020/1499</a>&gt;</span>. </dd>
3902 <dd class="break"></dd>
3903 <dt id="ANSI">[ANSI]</dt>
3904 <dd>
3905 <span class="refAuthor">American National Standards Institute (ANSI)</span>, <span class="refTitle">"ANSI - X9.63 Public Key Cryptography for the Financial Services Industry Key Agreement and Key Transport Using Elliptic Curve Cryptography"</span>, <time datetime="2001-11" class="refDate">November 2001</time>. </dd>
3906 <dd class="break"></dd>
3907 <dt id="BHK09">[BHK09]</dt>
3908 <dd>
3909 <span class="refAuthor">Bellare, M.</span>, <span class="refAuthor">Hofheinz, D.</span>, and <span class="refAuthor">E. Kiltz</span>, <span class="refTitle">"Subtleties in the Definition of IND-CCA: When and How Should Challenge-Decryption be Disallowed?"</span>, <time datetime="2009-08" class="refDate">August 2009</time>, <span>&lt;<a href="https://eprint.iacr.org/2009/418">https://eprint.iacr.org/2009/418</a>&gt;</span>. </dd>
3910 <dd class="break"></dd>
3911 <dt id="BJM97">[BJM97]</dt>
3912 <dd>
3913 <span class="refAuthor">Blake-Wilson, S.</span>, <span class="refAuthor">Johnson, D.</span>, and <span class="refAuthor">A. Menezes</span>, <span class="refTitle">"Key agreement protocols and their security analysis: Extended Abstract"</span>, <span class="refContent">Crytography and Coding, pp. 30-45</span>, <span class="seriesInfo">DOI 10.1007/bfb0024447</span>, <time datetime="2005-06" class="refDate">June 2005</time>, <span>&lt;<a href="https://doi.org/10.1007/bfb0024447">https://doi.org/10.1007/bfb0024447</a>&gt;</span>. </dd>
3914 <dd class="break"></dd>
3915 <dt id="BNT19">[BNT19]</dt>
3916 <dd>
3917 <span class="refAuthor">Bellare, M.</span>, <span class="refAuthor">Ng, R.</span>, and <span class="refAuthor">B. Tackmann</span>, <span class="refTitle">"Nonces Are Noticed: AEAD Revisited"</span>, <time datetime="2019-08" class="refDate">August 2019</time>, <span>&lt;<a href="http://dx.doi.org/10.1007/978-3-030-26948-7_9">http://dx.doi.org/10.1007/978-3-030-26948-7_9</a>&gt;</span>. </dd>
3918 <dd class="break"></dd>
3919 <dt id="CS01">[CS01]</dt>
3920 <dd>
3921 <span class="refAuthor">Cramer, R.</span> and <span class="refAuthor">V. Shoup</span>, <span class="refTitle">"Design and Analysis of Practical Public-Key Encryption Schemes Secure against Adaptive Chosen Ciphertext Attack"</span>, <time datetime="2001-12" class="refDate">December 2001</time>, <span>&lt;<a href="https://eprint.iacr.org/2001/108">https://eprint.iacr.org/2001/108</a>&gt;</span>. </dd>
3922 <dd class="break"></dd>
3923 <dt id="GAP">[GAP]</dt>
3924 <dd>
3925 <span class="refAuthor">Okamoto, T.</span> and <span class="refAuthor">D. Pointcheval</span>, <span class="refTitle">"The Gap-Problems: A New Class of Problems for the Security of Cryptographic Schemes"</span>, <span class="seriesInfo">ISBN 978-3-540-44586-9</span>, <time datetime="2001-06" class="refDate">June 2001</time>, <span>&lt;<a href="https://link.springer.com/content/pdf/10.1007/3-540-44586-2_8.pdf">https://link.springer.com/content/pdf/10.1007/3-540-44586-2_8.pdf</a>&gt;</span>. </dd>
3926 <dd class="break"></dd>
3927 <dt id="GCM">[GCM]</dt>
3928 <dd>
3929 <span class="refAuthor">Dworkin, M.</span>, <span class="refTitle">"Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC"</span>, <span class="seriesInfo">DOI 10.6028/nist.sp.800-38d</span>, <span class="seriesInfo">SP 800-38D</span>, <time datetime="2007-11" class="refDate">November 2007</time>, <span>&lt;<a href="https://doi.org/10.6028/nist.sp.800-38d">https://doi.org/10.6028/nist.sp.800-38d</a>&gt;</span>. </dd>
3930 <dd class="break"></dd>
3931 <dt id="HHK06">[HHK06]</dt>
3932 <dd>
3933 <span class="refAuthor">Herranz, J.</span>, <span class="refAuthor">Hofheinz, D.</span>, and <span class="refAuthor">E. Kiltz</span>, <span class="refTitle">"Some (in)sufficient conditions for secure hybrid encryption."</span>, <time datetime="2006-08" class="refDate">August 2006</time>, <span>&lt;<a href="https://eprint.iacr.org/2006/265">https://eprint.iacr.org/2006/265</a>&gt;</span>. </dd>
3934 <dd class="break"></dd>
3935 <dt id="HPKEAnalysis">[HPKEAnalysis]</dt>
3936 <dd>
3937 <span class="refAuthor">Lipp, B.</span>, <span class="refTitle">"An Analysis of Hybrid Public Key Encryption"</span>, <time datetime="2020-02" class="refDate">February 2020</time>, <span>&lt;<a href="https://eprint.iacr.org/2020/243">https://eprint.iacr.org/2020/243</a>&gt;</span>. </dd>
3938 <dd class="break"></dd>
3939 <dt id="IEEE1363">[IEEE1363]</dt>
3940 <dd>
3941 <span class="refAuthor">IEEE</span>, <span class="refTitle">"IEEE Standard Specifications for Public-Key Cryptography - Amendment 1: Additional Techniques"</span>, <span class="seriesInfo">IEEE Std 1363a-2004</span>. </dd>
3942 <dd class="break"></dd>
3943 <dt id="IMB">[IMB]</dt>
3944 <dd>
3945 <span class="refAuthor">Diffie, W.</span>, <span class="refAuthor">Van Oorschot, P.</span>, and <span class="refAuthor">M. Wiener</span>, <span class="refTitle">"Authentication and authenticated key exchanges"</span>, <span class="refContent">Designs, Codes and Cryptography, Vol. 2, pp. 107-125</span>, <span class="seriesInfo">DOI 10.1007/bf00124891</span>, <time datetime="1992-06" class="refDate">June 1992</time>, <span>&lt;<a href="https://doi.org/10.1007/bf00124891">https://doi.org/10.1007/bf00124891</a>&gt;</span>. </dd>
3946 <dd class="break"></dd>
3947 <dt id="ISO">[ISO]</dt>
3948 <dd>
3949 <span class="refAuthor">International Organization for Standardization</span>, <span class="refTitle">"Information technology - Security techniques - Encryption algorithms - Part 2: Asymmetric ciphers"</span>, <span class="seriesInfo">ISO/IEC 18033-2:2006</span>, <time datetime="2006-05" class="refDate">May 2006</time>. </dd>
3950 <dd class="break"></dd>
3951 <dt id="keyagreement">[keyagreement]</dt>
3952 <dd>
3953 <span class="refAuthor">Barker, E.</span>, <span class="refAuthor">Chen, L.</span>, <span class="refAuthor">Roginsky, A.</span>, <span class="refAuthor">Vassilev, A.</span>, and <span class="refAuthor">R. Davis</span>, <span class="refTitle">"Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography"</span>, <span class="refContent">NIST Special Publication 800-56A Revision 3</span>, <span class="seriesInfo">DOI 10.6028/nist.sp.800-56ar3</span>, <time datetime="2018-04" class="refDate">April 2018</time>, <span>&lt;<a href="https://doi.org/10.6028/nist.sp.800-56ar3">https://doi.org/10.6028/nist.sp.800-56ar3</a>&gt;</span>. </dd>
3954 <dd class="break"></dd>
3955 <dt id="LGR20">[LGR20]</dt>
3956 <dd>
3957 <span class="refAuthor">Len, J.</span>, <span class="refAuthor">Grubbs, P.</span>, and <span class="refAuthor">T. Ristenpart</span>, <span class="refTitle">"Partitioning Oracle Attacks"</span>. </dd>
3958 <dd class="break"></dd>
3959 <dt id="MAEA10">[MAEA10]</dt>
3960 <dd>
3961 <span class="refAuthor">Gayoso Martinez, V.</span>, <span class="refAuthor">Hernandez Alvarez, F.</span>, <span class="refAuthor">Hernandez Encinas, L.</span>, and <span class="refAuthor">C. Sanchez Avila</span>, <span class="refTitle">"A comparison of the standardized versions of ECIES"</span>, <time datetime="2010-10" class="refDate">October 2010</time>, <span>&lt;<a href="https://ieeexplore.ieee.org/abstract/document/5604194/">https://ieeexplore.ieee.org/abstract/document/5604194/</a>&gt;</span>. </dd>
3962 <dd class="break"></dd>
3963 <dt id="I-D.ietf-mls-protocol">[MLS-PROTOCOL]</dt>
3964 <dd>
3965 <span class="refAuthor">Barnes, R.</span>, <span class="refAuthor">Beurdouche, B.</span>, <span class="refAuthor">Robert, R.</span>, <span class="refAuthor">Millican, J.</span>, <span class="refAuthor">Omara, E.</span>, and <span class="refAuthor">K. Cohn-Gordon</span>, <span class="refTitle">"The Messaging Layer Security (MLS) Protocol"</span>, <span class="refContent">Work in Progress</span>, <span class="seriesInfo">Internet-Draft, draft-ietf-mls-protocol-12</span>, <time datetime="2021-10-11" class="refDate">11 October 2021</time>, <span>&lt;<a href="https://datatracker.ietf.org/doc/html/draft-ietf-mls-protocol-12">https://datatracker.ietf.org/doc/html/draft-ietf-mls-protocol-12</a>&gt;</span>. </dd>
3966 <dd class="break"></dd>
3967 <dt id="NaCl">[NaCl]</dt>
3968 <dd>
3969 <span class="refTitle">"Public-key authenticated encryption: crypto_box"</span>, <time datetime="2019-03" class="refDate">March 2019</time>, <span>&lt;<a href="https://nacl.cr.yp.to/box.html">https://nacl.cr.yp.to/box.html</a>&gt;</span>. </dd>
3970 <dd class="break"></dd>
3971 <dt id="NISTCurves">[NISTCurves]</dt>
3972 <dd>
3973 <span class="refAuthor">National Institute of Standards and Technology (NIST)</span>, <span class="refTitle">"Digital Signature Standard (DSS)"</span>, <span class="seriesInfo">DOI 10.6028/nist.fips.186-4</span>, <span class="seriesInfo">FIPS PUB 186-4</span>, <time datetime="2013-07" class="refDate">July 2013</time>, <span>&lt;<a href="https://doi.org/10.6028/nist.fips.186-4">https://doi.org/10.6028/nist.fips.186-4</a>&gt;</span>. </dd>
3974 <dd class="break"></dd>
3975 <dt id="RFC1421">[RFC1421]</dt>
3976 <dd>
3977 <span class="refAuthor">Linn, J.</span>, <span class="refTitle">"Privacy Enhancement for Internet Electronic Mail: Part I: Message Encryption and Authentication Procedures"</span>, <span class="seriesInfo">RFC 1421</span>, <span class="seriesInfo">DOI 10.17487/RFC1421</span>, <time datetime="1993-02" class="refDate">February 1993</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc1421">https://www.rfc-editor.org/info/rfc1421</a>&gt;</span>. </dd>
3978 <dd class="break"></dd>
3979 <dt id="RFC5869">[RFC5869]</dt>
3980 <dd>
3981 <span class="refAuthor">Krawczyk, H.</span> and <span class="refAuthor">P. Eronen</span>, <span class="refTitle">"HMAC-based Extract-and-Expand Key Derivation Function (HKDF)"</span>, <span class="seriesInfo">RFC 5869</span>, <span class="seriesInfo">DOI 10.17487/RFC5869</span>, <time datetime="2010-05" class="refDate">May 2010</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc5869">https://www.rfc-editor.org/info/rfc5869</a>&gt;</span>. </dd>
3982 <dd class="break"></dd>
3983 <dt id="RFC7748">[RFC7748]</dt>
3984 <dd>
3985 <span class="refAuthor">Langley, A.</span>, <span class="refAuthor">Hamburg, M.</span>, and <span class="refAuthor">S. Turner</span>, <span class="refTitle">"Elliptic Curves for Security"</span>, <span class="seriesInfo">RFC 7748</span>, <span class="seriesInfo">DOI 10.17487/RFC7748</span>, <time datetime="2016-01" class="refDate">January 2016</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc7748">https://www.rfc-editor.org/info/rfc7748</a>&gt;</span>. </dd>
3986 <dd class="break"></dd>
3987 <dt id="RFC8439">[RFC8439]</dt>
3988 <dd>
3989 <span class="refAuthor">Nir, Y.</span> and <span class="refAuthor">A. Langley</span>, <span class="refTitle">"ChaCha20 and Poly1305 for IETF Protocols"</span>, <span class="seriesInfo">RFC 8439</span>, <span class="seriesInfo">DOI 10.17487/RFC8439</span>, <time datetime="2018-06" class="refDate">June 2018</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8439">https://www.rfc-editor.org/info/rfc8439</a>&gt;</span>. </dd>
3990 <dd class="break"></dd>
3991 <dt id="RFC8446">[RFC8446]</dt>
3992 <dd>
3993 <span class="refAuthor">Rescorla, E.</span>, <span class="refTitle">"The Transport Layer Security (TLS) Protocol Version 1.3"</span>, <span class="seriesInfo">RFC 8446</span>, <span class="seriesInfo">DOI 10.17487/RFC8446</span>, <time datetime="2018-08" class="refDate">August 2018</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8446">https://www.rfc-editor.org/info/rfc8446</a>&gt;</span>. </dd>
3994 <dd class="break"></dd>
3995 <dt id="RFC8467">[RFC8467]</dt>
3996 <dd>
3997 <span class="refAuthor">Mayrhofer, A.</span>, <span class="refTitle">"Padding Policies for Extension Mechanisms for DNS (EDNS(0))"</span>, <span class="seriesInfo">RFC 8467</span>, <span class="seriesInfo">DOI 10.17487/RFC8467</span>, <time datetime="2018-10" class="refDate">October 2018</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8467">https://www.rfc-editor.org/info/rfc8467</a>&gt;</span>. </dd>
3998 <dd class="break"></dd>
3999 <dt id="RFC8696">[RFC8696]</dt>
4000 <dd>
4001 <span class="refAuthor">Housley, R.</span>, <span class="refTitle">"Using Pre-Shared Key (PSK) in the Cryptographic Message Syntax (CMS)"</span>, <span class="seriesInfo">RFC 8696</span>, <span class="seriesInfo">DOI 10.17487/RFC8696</span>, <time datetime="2019-12" class="refDate">December 2019</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8696">https://www.rfc-editor.org/info/rfc8696</a>&gt;</span>. </dd>
4002 <dd class="break"></dd>
4003 <dt id="RFC8937">[RFC8937]</dt>
4004 <dd>
4005 <span class="refAuthor">Cremers, C.</span>, <span class="refAuthor">Garratt, L.</span>, <span class="refAuthor">Smyshlyaev, S.</span>, <span class="refAuthor">Sullivan, N.</span>, and <span class="refAuthor">C. Wood</span>, <span class="refTitle">"Randomness Improvements for Security Protocols"</span>, <span class="seriesInfo">RFC 8937</span>, <span class="seriesInfo">DOI 10.17487/RFC8937</span>, <time datetime="2020-10" class="refDate">October 2020</time>, <span>&lt;<a href="https://www.rfc-editor.org/info/rfc8937">https://www.rfc-editor.org/info/rfc8937</a>&gt;</span>. </dd>
4006 <dd class="break"></dd>
4007 <dt id="SECG">[SECG]</dt>
4008 <dd>
4009 <span class="refAuthor">Standards for Efficient Cryptography Group</span>, <span class="refTitle">"SEC 1: Elliptic Curve Cryptography,"</span>, <span class="refContent">Version 2</span>, <time datetime="2009-05" class="refDate">May 2009</time>, <span>&lt;<a href="https://secg.org/sec1-v2.pdf">https://secg.org/sec1-v2.pdf</a>&gt;</span>. </dd>
4010 <dd class="break"></dd>
4011 <dt id="SigncryptionDZ10">[SigncryptionDZ10]</dt>
4012 <dd>
4013 <span class="refAuthor">Dent, A.</span> and <span class="refAuthor">Y. Zheng</span>, <span class="refTitle">"Practical Signcryption"</span>, <span class="refContent">Information Security and Cryptography</span>, <span class="seriesInfo">DOI 10.1007/978-3-540-89411-7</span>, <time datetime="2010-11" class="refDate">November 2010</time>, <span>&lt;<a href="https://doi.org/10.1007/978-3-540-89411-7">https://doi.org/10.1007/978-3-540-89411-7</a>&gt;</span>. </dd>
4014 <dd class="break"></dd>
4015 <dt id="TestVectors">[TestVectors]</dt>
4016 <dd>
4017 <span class="refTitle">"HPKE Test Vectors"</span>, <span>&lt;<a href="https://github.com/cfrg/draft-irtf-cfrg-hpke/blob/5f503c564da00b0687b3de75f1dfbdfc4079ad31/test-vectors.json">https://github.com/cfrg/draft-irtf-cfrg-hpke/blob/5f503c564da00b0687b3de75f1dfbdfc4079ad31/test-vectors.json</a>&gt;</span>. </dd>
4018 <dd class="break"></dd>
4019 <dt id="I-D.ietf-tls-esni">[TLS-ECH]</dt>
4020 <dd>
4021 <span class="refAuthor">Rescorla, E.</span>, <span class="refAuthor">Oku, K.</span>, <span class="refAuthor">Sullivan, N.</span>, and <span class="refAuthor">C. A. Wood</span>, <span class="refTitle">"TLS Encrypted Client Hello"</span>, <span class="refContent">Work in Progress</span>, <span class="seriesInfo">Internet-Draft, draft-ietf-tls-esni-14</span>, <time datetime="2022-02-13" class="refDate">13 February 2022</time>, <span>&lt;<a href="https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-14">https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-14</a>&gt;</span>. </dd>
4022 <dd class="break"></dd>
4023 </dl>
4024 </section>
4025 </section>
4026 <div id="test-vectors">
4027 <section id="appendix-A">
4028 <h2 id="name-test-vectors">
4029 <a href="#appendix-A" class="section-number selfRef">Appendix A. </a><a href="#name-test-vectors" class="section-name selfRef">Test Vectors</a>
4030 </h2>
4031 <p id="appendix-A-1">Each section below contains test vectors for a single HPKE ciphersuite and
4032 contains the following values:<a href="#appendix-A-1" class="pilcrow">¶</a></p>
4033 <ol start="1" type="1" class="normal type-1" id="appendix-A-2">
4034 <li id="appendix-A-2.1">Configuration information and private key material: This includes the
4035 <code>mode</code>, <code>info</code> string, HPKE ciphersuite
4036 identifiers (<code>kem_id</code>, <code>kdf_id</code>, <code>aead_id</code>), and all
4037 sender, recipient, and ephemeral key material. For each role X, where X is one of
4038 S, R, or E, as sender, recipient, and ephemeral, respectively, key pairs are
4039 generated as <code>(skX, pkX) = DeriveKeyPair(ikmX)</code>. Each key pair <code>(skX,
4040 pkX)</code> is written in its serialized form, where <code>skXm =
4041 SerializePrivateKey(skX)</code> and <code>pkXm = SerializePublicKey(pkX)</code>. For
4042 applicable modes, the shared PSK and PSK identifier are also included.<a href="#appendix-A-2.1" class="pilcrow">¶</a>
4043 </li>
4044 <li id="appendix-A-2.2">Context creation intermediate values and outputs: This includes the KEM outputs
4045 <code>enc</code> and <code>shared_secret</code> used to
4046 create the context, along with intermediate values <code>key_schedule_context</code>
4047 and <code>secret</code> computed in the KeySchedule function in <a href="#encryption-context" class="xref">Section 5.1</a>. The outputs include the context
4048 values <code>key</code>, <code>base_nonce</code>, and <code>exporter_secret</code>.<a href="#appendix-A-2.2" class="pilcrow">¶</a>
4049 </li>
4050 <li id="appendix-A-2.3">Encryption test vectors: A fixed plaintext message is encrypted using
4051 different sequence numbers and associated data values using the context computed in (2).
4052 Each test vector lists the sequence number and corresponding nonce computed
4053 with <code>base_nonce</code>, the plaintext message <code>pt</code>, associated data <code>aad</code>, and
4054 output ciphertext <code>ct</code>.<a href="#appendix-A-2.3" class="pilcrow">¶</a>
4055 </li>
4056 <li id="appendix-A-2.4">Export test vectors: Several exported values of the same length with differing
4057 context parameters are computed using the context computed in (2). Each test
4058 vector lists the <code>exporter_context</code>, output length <code>L</code>, and resulting export
4059 value.<a href="#appendix-A-2.4" class="pilcrow">¶</a>
4060 </li>
4061 </ol>
4062 <p id="appendix-A-3">These test vectors are also available in JSON format at <span>[<a href="#TestVectors" class="xref">TestVectors</a>]</span>.<a href="#appendix-A-3" class="pilcrow">¶</a></p>
4063 <div id="dhkemx25519-hkdf-sha256-hkdf-sha256-aes-128-gcm">
4064 <section id="appendix-A.1">
4065 <h3 id="name-dhkemx25519-hkdf-sha256-hkd">
4066 <a href="#appendix-A.1" class="section-number selfRef">A.1. </a><a href="#name-dhkemx25519-hkdf-sha256-hkd" class="section-name selfRef">DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM</a>
4067 </h3>
4068 <div id="base-setup-information">
4069 <section id="appendix-A.1.1">
4070 <h4 id="name-base-setup-information">
4071 <a href="#appendix-A.1.1" class="section-number selfRef">A.1.1. </a><a href="#name-base-setup-information" class="section-name selfRef">Base Setup Information</a>
4072 </h4>
4073 <div id="appendix-A.1.1-1">
4074 <pre class="lang-test-vectors sourcecode">
4075 mode: 0
4076 kem_id: 32
4077 kdf_id: 1
4078 aead_id: 1
4079 info: 4f6465206f6e2061204772656369616e2055726e
4080 ikmE:
4081 7268600d403fce431561aef583ee1613527cff655c1343f29812e66706df3234
4082 pkEm:
4083 37fda3567bdbd628e88668c3c8d7e97d1d1253b6d4ea6d44c150f741f1bf4431
4084 skEm:
4085 52c4a758a802cd8b936eceea314432798d5baf2d7e9235dc084ab1b9cfa2f736
4086 ikmR:
4087 6db9df30aa07dd42ee5e8181afdb977e538f5e1fec8a06223f33f7013e525037
4088 pkRm:
4089 3948cfe0ad1ddb695d780e59077195da6c56506b027329794ab02bca80815c4d
4090 skRm:
4091 4612c550263fc8ad58375df3f557aac531d26850903e55a9f23f21d8534e8ac8
4092 enc:
4093 37fda3567bdbd628e88668c3c8d7e97d1d1253b6d4ea6d44c150f741f1bf4431
4094 shared_secret:
4095 fe0e18c9f024ce43799ae393c7e8fe8fce9d218875e8227b0187c04e7d2ea1fc
4096 key_schedule_context: 00725611c9d98c07c03f60095cd32d400d8347d45ed670
4097 97bbad50fc56da742d07cb6cffde367bb0565ba28bb02c90744a20f5ef37f3052352
4098 6106f637abb05449
4099 secret:
4100 12fff91991e93b48de37e7daddb52981084bd8aa64289c3788471d9a9712f397
4101 key: 4531685d41d65f03dc48f6b8302c05b0
4102 base_nonce: 56d890e5accaaf011cff4b7d
4103 exporter_secret:
4104 45ff1c2e220db587171952c0592d5f5ebe103f1561a2614e38f2ffd47e99e3f8
4105 </pre><a href="#appendix-A.1.1-1" class="pilcrow">¶</a>
4106 </div>
4107 <div id="encryptions">
4108 <section id="appendix-A.1.1.1">
4109 <h5 id="name-encryptions">
4110 <a href="#appendix-A.1.1.1" class="section-number selfRef">A.1.1.1. </a><a href="#name-encryptions" class="section-name selfRef">Encryptions</a>
4111 </h5>
4112 <div id="appendix-A.1.1.1-1">
4113 <pre class="lang-test-vectors sourcecode">
4114 sequence number: 0
4115 pt: 4265617574792069732074727574682c20747275746820626561757479
4116 aad: 436f756e742d30
4117 nonce: 56d890e5accaaf011cff4b7d
4118 ct: f938558b5d72f1a23810b4be2ab4f84331acc02fc97babc53a52ae8218a355a9
4119 6d8770ac83d07bea87e13c512a
4120
4121 sequence number: 1
4122 pt: 4265617574792069732074727574682c20747275746820626561757479
4123 aad: 436f756e742d31
4124 nonce: 56d890e5accaaf011cff4b7c
4125 ct: af2d7e9ac9ae7e270f46ba1f975be53c09f8d875bdc8535458c2494e8a6eab25
4126 1c03d0c22a56b8ca42c2063b84
4127
4128 sequence number: 2
4129 pt: 4265617574792069732074727574682c20747275746820626561757479
4130 aad: 436f756e742d32
4131 nonce: 56d890e5accaaf011cff4b7f
4132 ct: 498dfcabd92e8acedc281e85af1cb4e3e31c7dc394a1ca20e173cb7251649158
4133 8d96a19ad4a683518973dcc180
4134
4135 sequence number: 4
4136 pt: 4265617574792069732074727574682c20747275746820626561757479
4137 aad: 436f756e742d34
4138 nonce: 56d890e5accaaf011cff4b79
4139 ct: 583bd32bc67a5994bb8ceaca813d369bca7b2a42408cddef5e22f880b631215a
4140 09fc0012bc69fccaa251c0246d
4141
4142 sequence number: 255
4143 pt: 4265617574792069732074727574682c20747275746820626561757479
4144 aad: 436f756e742d323535
4145 nonce: 56d890e5accaaf011cff4b82
4146 ct: 7175db9717964058640a3a11fb9007941a5d1757fda1a6935c805c21af32505b
4147 f106deefec4a49ac38d71c9e0a
4148
4149 sequence number: 256
4150 pt: 4265617574792069732074727574682c20747275746820626561757479
4151 aad: 436f756e742d323536
4152 nonce: 56d890e5accaaf011cff4a7d
4153 ct: 957f9800542b0b8891badb026d79cc54597cb2d225b54c00c5238c25d05c30e3
4154 fbeda97d2e0e1aba483a2df9f2
4155 </pre><a href="#appendix-A.1.1.1-1" class="pilcrow">¶</a>
4156 </div>
4157 </section>
4158 </div>
4159 <div id="exported-values">
4160 <section id="appendix-A.1.1.2">
4161 <h5 id="name-exported-values">
4162 <a href="#appendix-A.1.1.2" class="section-number selfRef">A.1.1.2. </a><a href="#name-exported-values" class="section-name selfRef">Exported Values</a>
4163 </h5>
4164 <div id="appendix-A.1.1.2-1">
4165 <pre class="lang-test-vectors sourcecode">
4166 exporter_context:
4167 L: 32
4168 exported_value:
4169 3853fe2b4035195a573ffc53856e77058e15d9ea064de3e59f4961d0095250ee
4170
4171 exporter_context: 00
4172 L: 32
4173 exported_value:
4174 2e8f0b54673c7029649d4eb9d5e33bf1872cf76d623ff164ac185da9e88c21a5
4175
4176 exporter_context: 54657374436f6e74657874
4177 L: 32
4178 exported_value:
4179 e9e43065102c3836401bed8c3c3c75ae46be1639869391d62c61f1ec7af54931
4180 </pre><a href="#appendix-A.1.1.2-1" class="pilcrow">¶</a>
4181 </div>
4182 </section>
4183 </div>
4184 </section>
4185 </div>
4186 <div id="psk-setup-information">
4187 <section id="appendix-A.1.2">
4188 <h4 id="name-psk-setup-information">
4189 <a href="#appendix-A.1.2" class="section-number selfRef">A.1.2. </a><a href="#name-psk-setup-information" class="section-name selfRef">PSK Setup Information</a>
4190 </h4>
4191 <div id="appendix-A.1.2-1">
4192 <pre class="lang-test-vectors sourcecode">
4193 mode: 1
4194 kem_id: 32
4195 kdf_id: 1
4196 aead_id: 1
4197 info: 4f6465206f6e2061204772656369616e2055726e
4198 ikmE:
4199 78628c354e46f3e169bd231be7b2ff1c77aa302460a26dbfa15515684c00130b
4200 pkEm:
4201 0ad0950d9fb9588e59690b74f1237ecdf1d775cd60be2eca57af5a4b0471c91b
4202 skEm:
4203 463426a9ffb42bb17dbe6044b9abd1d4e4d95f9041cef0e99d7824eef2b6f588
4204 ikmR:
4205 d4a09d09f575fef425905d2ab396c1449141463f698f8efdb7accfaff8995098
4206 pkRm:
4207 9fed7e8c17387560e92cc6462a68049657246a09bfa8ade7aefe589672016366
4208 skRm:
4209 c5eb01eb457fe6c6f57577c5413b931550a162c71a03ac8d196babbd4e5ce0fd
4210 psk:
4211 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
4212 psk_id: 456e6e796e20447572696e206172616e204d6f726961
4213 enc:
4214 0ad0950d9fb9588e59690b74f1237ecdf1d775cd60be2eca57af5a4b0471c91b
4215 shared_secret:
4216 727699f009ffe3c076315019c69648366b69171439bd7dd0807743bde76986cd
4217 key_schedule_context: 01e78d5cf6190d275863411ff5edd0dece5d39fa48e04e
4218 ec1ed9b71be34729d18ccb6cffde367bb0565ba28bb02c90744a20f5ef37f3052352
4219 6106f637abb05449
4220 secret:
4221 3728ab0b024b383b0381e432b47cced1496d2516957a76e2a9f5c8cb947afca4
4222 key: 15026dba546e3ae05836fc7de5a7bb26
4223 base_nonce: 9518635eba129d5ce0914555
4224 exporter_secret:
4225 3d76025dbbedc49448ec3f9080a1abab6b06e91c0b11ad23c912f043a0ee7655
4226 </pre><a href="#appendix-A.1.2-1" class="pilcrow">¶</a>
4227 </div>
4228 <div id="encryptions-1">
4229 <section id="appendix-A.1.2.1">
4230 <h5 id="name-encryptions-2">
4231 <a href="#appendix-A.1.2.1" class="section-number selfRef">A.1.2.1. </a><a href="#name-encryptions-2" class="section-name selfRef">Encryptions</a>
4232 </h5>
4233 <div id="appendix-A.1.2.1-1">
4234 <pre class="lang-test-vectors sourcecode">
4235 sequence number: 0
4236 pt: 4265617574792069732074727574682c20747275746820626561757479
4237 aad: 436f756e742d30
4238 nonce: 9518635eba129d5ce0914555
4239 ct: e52c6fed7f758d0cf7145689f21bc1be6ec9ea097fef4e959440012f4feb73fb
4240 611b946199e681f4cfc34db8ea
4241
4242 sequence number: 1
4243 pt: 4265617574792069732074727574682c20747275746820626561757479
4244 aad: 436f756e742d31
4245 nonce: 9518635eba129d5ce0914554
4246 ct: 49f3b19b28a9ea9f43e8c71204c00d4a490ee7f61387b6719db765e948123b45
4247 b61633ef059ba22cd62437c8ba
4248
4249 sequence number: 2
4250 pt: 4265617574792069732074727574682c20747275746820626561757479
4251 aad: 436f756e742d32
4252 nonce: 9518635eba129d5ce0914557
4253 ct: 257ca6a08473dc851fde45afd598cc83e326ddd0abe1ef23baa3baa4dd8cde99
4254 fce2c1e8ce687b0b47ead1adc9
4255
4256 sequence number: 4
4257 pt: 4265617574792069732074727574682c20747275746820626561757479
4258 aad: 436f756e742d34
4259 nonce: 9518635eba129d5ce0914551
4260 ct: a71d73a2cd8128fcccbd328b9684d70096e073b59b40b55e6419c9c68ae21069
4261 c847e2a70f5d8fb821ce3dfb1c
4262
4263 sequence number: 255
4264 pt: 4265617574792069732074727574682c20747275746820626561757479
4265 aad: 436f756e742d323535
4266 nonce: 9518635eba129d5ce09145aa
4267 ct: 55f84b030b7f7197f7d7d552365b6b932df5ec1abacd30241cb4bc4ccea27bd2
4268 b518766adfa0fb1b71170e9392
4269
4270 sequence number: 256
4271 pt: 4265617574792069732074727574682c20747275746820626561757479
4272 aad: 436f756e742d323536
4273 nonce: 9518635eba129d5ce0914455
4274 ct: c5bf246d4a790a12dcc9eed5eae525081e6fb541d5849e9ce8abd92a3bc15517
4275 76bea16b4a518f23e237c14b59
4276 </pre><a href="#appendix-A.1.2.1-1" class="pilcrow">¶</a>
4277 </div>
4278 </section>
4279 </div>
4280 <div id="exported-values-1">
4281 <section id="appendix-A.1.2.2">
4282 <h5 id="name-exported-values-2">
4283 <a href="#appendix-A.1.2.2" class="section-number selfRef">A.1.2.2. </a><a href="#name-exported-values-2" class="section-name selfRef">Exported Values</a>
4284 </h5>
4285 <div id="appendix-A.1.2.2-1">
4286 <pre class="lang-test-vectors sourcecode">
4287 exporter_context:
4288 L: 32
4289 exported_value:
4290 dff17af354c8b41673567db6259fd6029967b4e1aad13023c2ae5df8f4f43bf6
4291
4292 exporter_context: 00
4293 L: 32
4294 exported_value:
4295 6a847261d8207fe596befb52928463881ab493da345b10e1dcc645e3b94e2d95
4296
4297 exporter_context: 54657374436f6e74657874
4298 L: 32
4299 exported_value:
4300 8aff52b45a1be3a734bc7a41e20b4e055ad4c4d22104b0c20285a7c4302401cd
4301 </pre><a href="#appendix-A.1.2.2-1" class="pilcrow">¶</a>
4302 </div>
4303 </section>
4304 </div>
4305 </section>
4306 </div>
4307 <div id="auth-setup-information">
4308 <section id="appendix-A.1.3">
4309 <h4 id="name-auth-setup-information">
4310 <a href="#appendix-A.1.3" class="section-number selfRef">A.1.3. </a><a href="#name-auth-setup-information" class="section-name selfRef">Auth Setup Information</a>
4311 </h4>
4312 <div id="appendix-A.1.3-1">
4313 <pre class="lang-test-vectors sourcecode">
4314 mode: 2
4315 kem_id: 32
4316 kdf_id: 1
4317 aead_id: 1
4318 info: 4f6465206f6e2061204772656369616e2055726e
4319 ikmE:
4320 6e6d8f200ea2fb20c30b003a8b4f433d2f4ed4c2658d5bc8ce2fef718059c9f7
4321 pkEm:
4322 23fb952571a14a25e3d678140cd0e5eb47a0961bb18afcf85896e5453c312e76
4323 skEm:
4324 ff4442ef24fbc3c1ff86375b0be1e77e88a0de1e79b30896d73411c5ff4c3518
4325 ikmR:
4326 f1d4a30a4cef8d6d4e3b016e6fd3799ea057db4f345472ed302a67ce1c20cdec
4327 pkRm:
4328 1632d5c2f71c2b38d0a8fcc359355200caa8b1ffdf28618080466c909cb69b2e
4329 skRm:
4330 fdea67cf831f1ca98d8e27b1f6abeb5b7745e9d35348b80fa407ff6958f9137e
4331 ikmS:
4332 94b020ce91d73fca4649006c7e7329a67b40c55e9e93cc907d282bbbff386f58
4333 pkSm:
4334 8b0c70873dc5aecb7f9ee4e62406a397b350e57012be45cf53b7105ae731790b
4335 skSm:
4336 dc4a146313cce60a278a5323d321f051c5707e9c45ba21a3479fecdf76fc69dd
4337 enc:
4338 23fb952571a14a25e3d678140cd0e5eb47a0961bb18afcf85896e5453c312e76
4339 shared_secret:
4340 2d6db4cf719dc7293fcbf3fa64690708e44e2bebc81f84608677958c0d4448a7
4341 key_schedule_context: 02725611c9d98c07c03f60095cd32d400d8347d45ed670
4342 97bbad50fc56da742d07cb6cffde367bb0565ba28bb02c90744a20f5ef37f3052352
4343 6106f637abb05449
4344 secret:
4345 56c62333d9d9f7767f5b083fdfce0aa7e57e301b74029bb0cffa7331385f1dda
4346 key: b062cb2c4dd4bca0ad7c7a12bbc341e6
4347 base_nonce: a1bc314c1942ade7051ffed0
4348 exporter_secret:
4349 ee1a093e6e1c393c162ea98fdf20560c75909653550540a2700511b65c88c6f1
4350 </pre><a href="#appendix-A.1.3-1" class="pilcrow">¶</a>
4351 </div>
4352 <div id="encryptions-2">
4353 <section id="appendix-A.1.3.1">
4354 <h5 id="name-encryptions-3">
4355 <a href="#appendix-A.1.3.1" class="section-number selfRef">A.1.3.1. </a><a href="#name-encryptions-3" class="section-name selfRef">Encryptions</a>
4356 </h5>
4357 <div id="appendix-A.1.3.1-1">
4358 <pre class="lang-test-vectors sourcecode">
4359 sequence number: 0
4360 pt: 4265617574792069732074727574682c20747275746820626561757479
4361 aad: 436f756e742d30
4362 nonce: a1bc314c1942ade7051ffed0
4363 ct: 5fd92cc9d46dbf8943e72a07e42f363ed5f721212cd90bcfd072bfd9f44e06b8
4364 0fd17824947496e21b680c141b
4365
4366 sequence number: 1
4367 pt: 4265617574792069732074727574682c20747275746820626561757479
4368 aad: 436f756e742d31
4369 nonce: a1bc314c1942ade7051ffed1
4370 ct: d3736bb256c19bfa93d79e8f80b7971262cb7c887e35c26370cfed62254369a1
4371 b52e3d505b79dd699f002bc8ed
4372
4373 sequence number: 2
4374 pt: 4265617574792069732074727574682c20747275746820626561757479
4375 aad: 436f756e742d32
4376 nonce: a1bc314c1942ade7051ffed2
4377 ct: 122175cfd5678e04894e4ff8789e85dd381df48dcaf970d52057df2c9acc3b12
4378 1313a2bfeaa986050f82d93645
4379
4380 sequence number: 4
4381 pt: 4265617574792069732074727574682c20747275746820626561757479
4382 aad: 436f756e742d34
4383 nonce: a1bc314c1942ade7051ffed4
4384 ct: dae12318660cf963c7bcbef0f39d64de3bf178cf9e585e756654043cc5059873
4385 bc8af190b72afc43d1e0135ada
4386
4387 sequence number: 255
4388 pt: 4265617574792069732074727574682c20747275746820626561757479
4389 aad: 436f756e742d323535
4390 nonce: a1bc314c1942ade7051ffe2f
4391 ct: 55d53d85fe4d9e1e97903101eab0b4865ef20cef28765a47f840ff99625b7d69
4392 dee927df1defa66a036fc58ff2
4393
4394 sequence number: 256
4395 pt: 4265617574792069732074727574682c20747275746820626561757479
4396 aad: 436f756e742d323536
4397 nonce: a1bc314c1942ade7051fffd0
4398 ct: 42fa248a0e67ccca688f2b1d13ba4ba84755acf764bd797c8f7ba3b9b1dc3330
4399 326f8d172fef6003c79ec72319
4400 </pre><a href="#appendix-A.1.3.1-1" class="pilcrow">¶</a>
4401 </div>
4402 </section>
4403 </div>
4404 <div id="exported-values-2">
4405 <section id="appendix-A.1.3.2">
4406 <h5 id="name-exported-values-3">
4407 <a href="#appendix-A.1.3.2" class="section-number selfRef">A.1.3.2. </a><a href="#name-exported-values-3" class="section-name selfRef">Exported Values</a>
4408 </h5>
4409 <div id="appendix-A.1.3.2-1">
4410 <pre class="lang-test-vectors sourcecode">
4411 exporter_context:
4412 L: 32
4413 exported_value:
4414 28c70088017d70c896a8420f04702c5a321d9cbf0279fba899b59e51bac72c85
4415
4416 exporter_context: 00
4417 L: 32
4418 exported_value:
4419 25dfc004b0892be1888c3914977aa9c9bbaf2c7471708a49e1195af48a6f29ce
4420
4421 exporter_context: 54657374436f6e74657874
4422 L: 32
4423 exported_value:
4424 5a0131813abc9a522cad678eb6bafaabc43389934adb8097d23c5ff68059eb64
4425 </pre><a href="#appendix-A.1.3.2-1" class="pilcrow">¶</a>
4426 </div>
4427 </section>
4428 </div>
4429 </section>
4430 </div>
4431 <div id="authpsk-setup-information">
4432 <section id="appendix-A.1.4">
4433 <h4 id="name-authpsk-setup-information">
4434 <a href="#appendix-A.1.4" class="section-number selfRef">A.1.4. </a><a href="#name-authpsk-setup-information" class="section-name selfRef">AuthPSK Setup Information</a>
4435 </h4>
4436 <div id="appendix-A.1.4-1">
4437 <pre class="lang-test-vectors sourcecode">
4438 mode: 3
4439 kem_id: 32
4440 kdf_id: 1
4441 aead_id: 1
4442 info: 4f6465206f6e2061204772656369616e2055726e
4443 ikmE:
4444 4303619085a20ebcf18edd22782952b8a7161e1dbae6e46e143a52a96127cf84
4445 pkEm:
4446 820818d3c23993492cc5623ab437a48a0a7ca3e9639c140fe1e33811eb844b7c
4447 skEm:
4448 14de82a5897b613616a00c39b87429df35bc2b426bcfd73febcb45e903490768
4449 ikmR:
4450 4b16221f3b269a88e207270b5e1de28cb01f847841b344b8314d6a622fe5ee90
4451 pkRm:
4452 1d11a3cd247ae48e901939659bd4d79b6b959e1f3e7d66663fbc9412dd4e0976
4453 skRm:
4454 cb29a95649dc5656c2d054c1aa0d3df0493155e9d5da6d7e344ed8b6a64a9423
4455 ikmS:
4456 62f77dcf5df0dd7eac54eac9f654f426d4161ec850cc65c54f8b65d2e0b4e345
4457 pkSm:
4458 2bfb2eb18fcad1af0e4f99142a1c474ae74e21b9425fc5c589382c69b50cc57e
4459 skSm:
4460 fc1c87d2f3832adb178b431fce2ac77c7ca2fd680f3406c77b5ecdf818b119f4
4461 psk:
4462 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
4463 psk_id: 456e6e796e20447572696e206172616e204d6f726961
4464 enc:
4465 820818d3c23993492cc5623ab437a48a0a7ca3e9639c140fe1e33811eb844b7c
4466 shared_secret:
4467 f9d0e870aba28d04709b2680cb8185466c6a6ff1d6e9d1091d5bf5e10ce3a577
4468 key_schedule_context: 03e78d5cf6190d275863411ff5edd0dece5d39fa48e04e
4469 ec1ed9b71be34729d18ccb6cffde367bb0565ba28bb02c90744a20f5ef37f3052352
4470 6106f637abb05449
4471 secret:
4472 5f96c55e4108c6691829aaabaa7d539c0b41d7c72aae94ae289752f056b6cec4
4473 key: 1364ead92c47aa7becfa95203037b19a
4474 base_nonce: 99d8b5c54669807e9fc70df1
4475 exporter_secret:
4476 f048d55eacbf60f9c6154bd4021774d1075ebf963c6adc71fa846f183ab2dde6
4477 </pre><a href="#appendix-A.1.4-1" class="pilcrow">¶</a>
4478 </div>
4479 <div id="encryptions-3">
4480 <section id="appendix-A.1.4.1">
4481 <h5 id="name-encryptions-4">
4482 <a href="#appendix-A.1.4.1" class="section-number selfRef">A.1.4.1. </a><a href="#name-encryptions-4" class="section-name selfRef">Encryptions</a>
4483 </h5>
4484 <div id="appendix-A.1.4.1-1">
4485 <pre class="lang-test-vectors sourcecode">
4486 sequence number: 0
4487 pt: 4265617574792069732074727574682c20747275746820626561757479
4488 aad: 436f756e742d30
4489 nonce: 99d8b5c54669807e9fc70df1
4490 ct: a84c64df1e11d8fd11450039d4fe64ff0c8a99fca0bd72c2d4c3e0400bc14a40
4491 f27e45e141a24001697737533e
4492
4493 sequence number: 1
4494 pt: 4265617574792069732074727574682c20747275746820626561757479
4495 aad: 436f756e742d31
4496 nonce: 99d8b5c54669807e9fc70df0
4497 ct: 4d19303b848f424fc3c3beca249b2c6de0a34083b8e909b6aa4c3688505c05ff
4498 e0c8f57a0a4c5ab9da127435d9
4499
4500 sequence number: 2
4501 pt: 4265617574792069732074727574682c20747275746820626561757479
4502 aad: 436f756e742d32
4503 nonce: 99d8b5c54669807e9fc70df3
4504 ct: 0c085a365fbfa63409943b00a3127abce6e45991bc653f182a80120868fc507e
4505 9e4d5e37bcc384fc8f14153b24
4506
4507 sequence number: 4
4508 pt: 4265617574792069732074727574682c20747275746820626561757479
4509 aad: 436f756e742d34
4510 nonce: 99d8b5c54669807e9fc70df5
4511 ct: 000a3cd3a3523bf7d9796830b1cd987e841a8bae6561ebb6791a3f0e34e89a4f
4512 b539faeee3428b8bbc082d2c1a
4513
4514 sequence number: 255
4515 pt: 4265617574792069732074727574682c20747275746820626561757479
4516 aad: 436f756e742d323535
4517 nonce: 99d8b5c54669807e9fc70d0e
4518 ct: 576d39dd2d4cc77d1a14a51d5c5f9d5e77586c3d8d2ab33bdec6379e28ce5c50
4519 2f0b1cbd09047cf9eb9269bb52
4520
4521 sequence number: 256
4522 pt: 4265617574792069732074727574682c20747275746820626561757479
4523 aad: 436f756e742d323536
4524 nonce: 99d8b5c54669807e9fc70cf1
4525 ct: 13239bab72e25e9fd5bb09695d23c90a24595158b99127505c8a9ff9f127e0d6
4526 57f71af59d67d4f4971da028f9
4527 </pre><a href="#appendix-A.1.4.1-1" class="pilcrow">¶</a>
4528 </div>
4529 </section>
4530 </div>
4531 <div id="exported-values-3">
4532 <section id="appendix-A.1.4.2">
4533 <h5 id="name-exported-values-4">
4534 <a href="#appendix-A.1.4.2" class="section-number selfRef">A.1.4.2. </a><a href="#name-exported-values-4" class="section-name selfRef">Exported Values</a>
4535 </h5>
4536 <div id="appendix-A.1.4.2-1">
4537 <pre class="lang-test-vectors sourcecode">
4538 exporter_context:
4539 L: 32
4540 exported_value:
4541 08f7e20644bb9b8af54ad66d2067457c5f9fcb2a23d9f6cb4445c0797b330067
4542
4543 exporter_context: 00
4544 L: 32
4545 exported_value:
4546 52e51ff7d436557ced5265ff8b94ce69cf7583f49cdb374e6aad801fc063b010
4547
4548 exporter_context: 54657374436f6e74657874
4549 L: 32
4550 exported_value:
4551 a30c20370c026bbea4dca51cb63761695132d342bae33a6a11527d3e7679436d
4552 </pre><a href="#appendix-A.1.4.2-1" class="pilcrow">¶</a>
4553 </div>
4554 </section>
4555 </div>
4556 </section>
4557 </div>
4558 </section>
4559 </div>
4560 <div id="dhkemx25519-hkdf-sha256-hkdf-sha256-chacha20poly1305">
4561 <section id="appendix-A.2">
4562 <h3 id="name-dhkemx25519-hkdf-sha256-hkdf">
4563 <a href="#appendix-A.2" class="section-number selfRef">A.2. </a><a href="#name-dhkemx25519-hkdf-sha256-hkdf" class="section-name selfRef">DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305</a>
4564 </h3>
4565 <div id="base-setup-information-1">
4566 <section id="appendix-A.2.1">
4567 <h4 id="name-base-setup-information-2">
4568 <a href="#appendix-A.2.1" class="section-number selfRef">A.2.1. </a><a href="#name-base-setup-information-2" class="section-name selfRef">Base Setup Information</a>
4569 </h4>
4570 <div id="appendix-A.2.1-1">
4571 <pre class="lang-test-vectors sourcecode">
4572 mode: 0
4573 kem_id: 32
4574 kdf_id: 1
4575 aead_id: 3
4576 info: 4f6465206f6e2061204772656369616e2055726e
4577 ikmE:
4578 909a9b35d3dc4713a5e72a4da274b55d3d3821a37e5d099e74a647db583a904b
4579 pkEm:
4580 1afa08d3dec047a643885163f1180476fa7ddb54c6a8029ea33f95796bf2ac4a
4581 skEm:
4582 f4ec9b33b792c372c1d2c2063507b684ef925b8c75a42dbcbf57d63ccd381600
4583 ikmR:
4584 1ac01f181fdf9f352797655161c58b75c656a6cc2716dcb66372da835542e1df
4585 pkRm:
4586 4310ee97d88cc1f088a5576c77ab0cf5c3ac797f3d95139c6c84b5429c59662a
4587 skRm:
4588 8057991eef8f1f1af18f4a9491d16a1ce333f695d4db8e38da75975c4478e0fb
4589 enc:
4590 1afa08d3dec047a643885163f1180476fa7ddb54c6a8029ea33f95796bf2ac4a
4591 shared_secret:
4592 0bbe78490412b4bbea4812666f7916932b828bba79942424abb65244930d69a7
4593 key_schedule_context: 00431df6cd95e11ff49d7013563baf7f11588c75a6611e
4594 e2a4404a49306ae4cfc5b69c5718a60cc5876c358d3f7fc31ddb598503f67be58ea1
4595 e798c0bb19eb9796
4596 secret:
4597 5b9cd775e64b437a2335cf499361b2e0d5e444d5cb41a8a53336d8fe402282c6
4598 key:
4599 ad2744de8e17f4ebba575b3f5f5a8fa1f69c2a07f6e7500bc60ca6e3e3ec1c91
4600 base_nonce: 5c4d98150661b848853b547f
4601 exporter_secret:
4602 a3b010d4994890e2c6968a36f64470d3c824c8f5029942feb11e7a74b2921922
4603 </pre><a href="#appendix-A.2.1-1" class="pilcrow">¶</a>
4604 </div>
4605 <div id="encryptions-4">
4606 <section id="appendix-A.2.1.1">
4607 <h5 id="name-encryptions-5">
4608 <a href="#appendix-A.2.1.1" class="section-number selfRef">A.2.1.1. </a><a href="#name-encryptions-5" class="section-name selfRef">Encryptions</a>
4609 </h5>
4610 <div id="appendix-A.2.1.1-1">
4611 <pre class="lang-test-vectors sourcecode">
4612 sequence number: 0
4613 pt: 4265617574792069732074727574682c20747275746820626561757479
4614 aad: 436f756e742d30
4615 nonce: 5c4d98150661b848853b547f
4616 ct: 1c5250d8034ec2b784ba2cfd69dbdb8af406cfe3ff938e131f0def8c8b60b4db
4617 21993c62ce81883d2dd1b51a28
4618
4619 sequence number: 1
4620 pt: 4265617574792069732074727574682c20747275746820626561757479
4621 aad: 436f756e742d31
4622 nonce: 5c4d98150661b848853b547e
4623 ct: 6b53c051e4199c518de79594e1c4ab18b96f081549d45ce015be002090bb119e
4624 85285337cc95ba5f59992dc98c
4625
4626 sequence number: 2
4627 pt: 4265617574792069732074727574682c20747275746820626561757479
4628 aad: 436f756e742d32
4629 nonce: 5c4d98150661b848853b547d
4630 ct: 71146bd6795ccc9c49ce25dda112a48f202ad220559502cef1f34271e0cb4b02
4631 b4f10ecac6f48c32f878fae86b
4632
4633 sequence number: 4
4634 pt: 4265617574792069732074727574682c20747275746820626561757479
4635 aad: 436f756e742d34
4636 nonce: 5c4d98150661b848853b547b
4637 ct: 63357a2aa291f5a4e5f27db6baa2af8cf77427c7c1a909e0b37214dd47db122b
4638 b153495ff0b02e9e54a50dbe16
4639
4640 sequence number: 255
4641 pt: 4265617574792069732074727574682c20747275746820626561757479
4642 aad: 436f756e742d323535
4643 nonce: 5c4d98150661b848853b5480
4644 ct: 18ab939d63ddec9f6ac2b60d61d36a7375d2070c9b683861110757062c52b888
4645 0a5f6b3936da9cd6c23ef2a95c
4646
4647 sequence number: 256
4648 pt: 4265617574792069732074727574682c20747275746820626561757479
4649 aad: 436f756e742d323536
4650 nonce: 5c4d98150661b848853b557f
4651 ct: 7a4a13e9ef23978e2c520fd4d2e757514ae160cd0cd05e556ef692370ca53076
4652 214c0c40d4c728d6ed9e727a5b
4653 </pre><a href="#appendix-A.2.1.1-1" class="pilcrow">¶</a>
4654 </div>
4655 </section>
4656 </div>
4657 <div id="exported-values-4">
4658 <section id="appendix-A.2.1.2">
4659 <h5 id="name-exported-values-5">
4660 <a href="#appendix-A.2.1.2" class="section-number selfRef">A.2.1.2. </a><a href="#name-exported-values-5" class="section-name selfRef">Exported Values</a>
4661 </h5>
4662 <div id="appendix-A.2.1.2-1">
4663 <pre class="lang-test-vectors sourcecode">
4664 exporter_context:
4665 L: 32
4666 exported_value:
4667 4bbd6243b8bb54cec311fac9df81841b6fd61f56538a775e7c80a9f40160606e
4668
4669 exporter_context: 00
4670 L: 32
4671 exported_value:
4672 8c1df14732580e5501b00f82b10a1647b40713191b7c1240ac80e2b68808ba69
4673
4674 exporter_context: 54657374436f6e74657874
4675 L: 32
4676 exported_value:
4677 5acb09211139c43b3090489a9da433e8a30ee7188ba8b0a9a1ccf0c229283e53
4678 </pre><a href="#appendix-A.2.1.2-1" class="pilcrow">¶</a>
4679 </div>
4680 </section>
4681 </div>
4682 </section>
4683 </div>
4684 <div id="psk-setup-information-1">
4685 <section id="appendix-A.2.2">
4686 <h4 id="name-psk-setup-information-2">
4687 <a href="#appendix-A.2.2" class="section-number selfRef">A.2.2. </a><a href="#name-psk-setup-information-2" class="section-name selfRef">PSK Setup Information</a>
4688 </h4>
4689 <div id="appendix-A.2.2-1">
4690 <pre class="lang-test-vectors sourcecode">
4691 mode: 1
4692 kem_id: 32
4693 kdf_id: 1
4694 aead_id: 3
4695 info: 4f6465206f6e2061204772656369616e2055726e
4696 ikmE:
4697 35706a0b09fb26fb45c39c2f5079c709c7cf98e43afa973f14d88ece7e29c2e3
4698 pkEm:
4699 2261299c3f40a9afc133b969a97f05e95be2c514e54f3de26cbe5644ac735b04
4700 skEm:
4701 0c35fdf49df7aa01cd330049332c40411ebba36e0c718ebc3edf5845795f6321
4702 ikmR:
4703 26b923eade72941c8a85b09986cdfa3f1296852261adedc52d58d2930269812b
4704 pkRm:
4705 13640af826b722fc04feaa4de2f28fbd5ecc03623b317834e7ff4120dbe73062
4706 skRm:
4707 77d114e0212be51cb1d76fa99dd41cfd4d0166b08caa09074430a6c59ef17879
4708 psk:
4709 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
4710 psk_id: 456e6e796e20447572696e206172616e204d6f726961
4711 enc:
4712 2261299c3f40a9afc133b969a97f05e95be2c514e54f3de26cbe5644ac735b04
4713 shared_secret:
4714 4be079c5e77779d0215b3f689595d59e3e9b0455d55662d1f3666ec606e50ea7
4715 key_schedule_context: 016870c4c76ca38ae43efbec0f2377d109499d7ce73f4a
4716 9e1ec37f21d3d063b97cb69c5718a60cc5876c358d3f7fc31ddb598503f67be58ea1
4717 e798c0bb19eb9796
4718 secret:
4719 16974354c497c9bd24c000ceed693779b604f1944975b18c442d373663f4a8cc
4720 key:
4721 600d2fdb0313a7e5c86a9ce9221cd95bed069862421744cfb4ab9d7203a9c019
4722 base_nonce: 112e0465562045b7368653e7
4723 exporter_secret:
4724 73b506dc8b6b4269027f80b0362def5cbb57ee50eed0c2873dac9181f453c5ac
4725 </pre><a href="#appendix-A.2.2-1" class="pilcrow">¶</a>
4726 </div>
4727 <div id="encryptions-5">
4728 <section id="appendix-A.2.2.1">
4729 <h5 id="name-encryptions-6">
4730 <a href="#appendix-A.2.2.1" class="section-number selfRef">A.2.2.1. </a><a href="#name-encryptions-6" class="section-name selfRef">Encryptions</a>
4731 </h5>
4732 <div id="appendix-A.2.2.1-1">
4733 <pre class="lang-test-vectors sourcecode">
4734 sequence number: 0
4735 pt: 4265617574792069732074727574682c20747275746820626561757479
4736 aad: 436f756e742d30
4737 nonce: 112e0465562045b7368653e7
4738 ct: 4a177f9c0d6f15cfdf533fb65bf84aecdc6ab16b8b85b4cf65a370e07fc1d78d
4739 28fb073214525276f4a89608ff
4740
4741 sequence number: 1
4742 pt: 4265617574792069732074727574682c20747275746820626561757479
4743 aad: 436f756e742d31
4744 nonce: 112e0465562045b7368653e6
4745 ct: 5c3cabae2f0b3e124d8d864c116fd8f20f3f56fda988c3573b40b09997fd6c76
4746 9e77c8eda6cda4f947f5b704a8
4747
4748 sequence number: 2
4749 pt: 4265617574792069732074727574682c20747275746820626561757479
4750 aad: 436f756e742d32
4751 nonce: 112e0465562045b7368653e5
4752 ct: 14958900b44bdae9cbe5a528bf933c5c990dbb8e282e6e495adf8205d19da9eb
4753 270e3a6f1e0613ab7e757962a4
4754
4755 sequence number: 4
4756 pt: 4265617574792069732074727574682c20747275746820626561757479
4757 aad: 436f756e742d34
4758 nonce: 112e0465562045b7368653e3
4759 ct: c2a7bc09ddb853cf2effb6e8d058e346f7fe0fb3476528c80db6b698415c5f8c
4760 50b68a9a355609e96d2117f8d3
4761
4762 sequence number: 255
4763 pt: 4265617574792069732074727574682c20747275746820626561757479
4764 aad: 436f756e742d323535
4765 nonce: 112e0465562045b736865318
4766 ct: 2414d0788e4bc39a59a26d7bd5d78e111c317d44c37bd5a4c2a1235f2ddc2085
4767 c487d406490e75210c958724a7
4768
4769 sequence number: 256
4770 pt: 4265617574792069732074727574682c20747275746820626561757479
4771 aad: 436f756e742d323536
4772 nonce: 112e0465562045b7368652e7
4773 ct: c567ae1c3f0f75abe1dd9e4532b422600ed4a6e5b9484dafb1e43ab9f5fd662b
4774 28c00e2e81d3cde955dae7e218
4775 </pre><a href="#appendix-A.2.2.1-1" class="pilcrow">¶</a>
4776 </div>
4777 </section>
4778 </div>
4779 <div id="exported-values-5">
4780 <section id="appendix-A.2.2.2">
4781 <h5 id="name-exported-values-6">
4782 <a href="#appendix-A.2.2.2" class="section-number selfRef">A.2.2.2. </a><a href="#name-exported-values-6" class="section-name selfRef">Exported Values</a>
4783 </h5>
4784 <div id="appendix-A.2.2.2-1">
4785 <pre class="lang-test-vectors sourcecode">
4786 exporter_context:
4787 L: 32
4788 exported_value:
4789 813c1bfc516c99076ae0f466671f0ba5ff244a41699f7b2417e4c59d46d39f40
4790
4791 exporter_context: 00
4792 L: 32
4793 exported_value:
4794 2745cf3d5bb65c333658732954ee7af49eb895ce77f8022873a62a13c94cb4e1
4795
4796 exporter_context: 54657374436f6e74657874
4797 L: 32
4798 exported_value:
4799 ad40e3ae14f21c99bfdebc20ae14ab86f4ca2dc9a4799d200f43a25f99fa78ae
4800 </pre><a href="#appendix-A.2.2.2-1" class="pilcrow">¶</a>
4801 </div>
4802 </section>
4803 </div>
4804 </section>
4805 </div>
4806 <div id="auth-setup-information-1">
4807 <section id="appendix-A.2.3">
4808 <h4 id="name-auth-setup-information-2">
4809 <a href="#appendix-A.2.3" class="section-number selfRef">A.2.3. </a><a href="#name-auth-setup-information-2" class="section-name selfRef">Auth Setup Information</a>
4810 </h4>
4811 <div id="appendix-A.2.3-1">
4812 <pre class="lang-test-vectors sourcecode">
4813 mode: 2
4814 kem_id: 32
4815 kdf_id: 1
4816 aead_id: 3
4817 info: 4f6465206f6e2061204772656369616e2055726e
4818 ikmE:
4819 938d3daa5a8904540bc24f48ae90eed3f4f7f11839560597b55e7c9598c996c0
4820 pkEm:
4821 f7674cc8cd7baa5872d1f33dbaffe3314239f6197ddf5ded1746760bfc847e0e
4822 skEm:
4823 c94619e1af28971c8fa7957192b7e62a71ca2dcdde0a7cc4a8a9e741d600ab13
4824 ikmR:
4825 64835d5ee64aa7aad57c6f2e4f758f7696617f8829e70bc9ac7a5ef95d1c756c
4826 pkRm:
4827 1a478716d63cb2e16786ee93004486dc151e988b34b475043d3e0175bdb01c44
4828 skRm:
4829 3ca22a6d1cda1bb9480949ec5329d3bf0b080ca4c45879c95eddb55c70b80b82
4830 ikmS:
4831 9d8f94537d5a3ddef71234c0baedfad4ca6861634d0b94c3007fed557ad17df6
4832 pkSm:
4833 f0f4f9e96c54aeed3f323de8534fffd7e0577e4ce269896716bcb95643c8712b
4834 skSm:
4835 2def0cb58ffcf83d1062dd085c8aceca7f4c0c3fd05912d847b61f3e54121f05
4836 enc:
4837 f7674cc8cd7baa5872d1f33dbaffe3314239f6197ddf5ded1746760bfc847e0e
4838 shared_secret:
4839 d2d67828c8bc9fa661cf15a31b3ebf1febe0cafef7abfaaca580aaf6d471e3eb
4840 key_schedule_context: 02431df6cd95e11ff49d7013563baf7f11588c75a6611e
4841 e2a4404a49306ae4cfc5b69c5718a60cc5876c358d3f7fc31ddb598503f67be58ea1
4842 e798c0bb19eb9796
4843 secret:
4844 3022dfc0a81d6e09a2e6daeeb605bb1ebb9ac49535540d9a4c6560064a6c6da8
4845 key:
4846 b071fd1136680600eb447a845a967d35e9db20749cdf9ce098bcc4deef4b1356
4847 base_nonce: d20577dff16d7cea2c4bf780
4848 exporter_secret:
4849 be2d93b82071318cdb88510037cf504344151f2f9b9da8ab48974d40a2251dd7
4850 </pre><a href="#appendix-A.2.3-1" class="pilcrow">¶</a>
4851 </div>
4852 <div id="encryptions-6">
4853 <section id="appendix-A.2.3.1">
4854 <h5 id="name-encryptions-7">
4855 <a href="#appendix-A.2.3.1" class="section-number selfRef">A.2.3.1. </a><a href="#name-encryptions-7" class="section-name selfRef">Encryptions</a>
4856 </h5>
4857 <div id="appendix-A.2.3.1-1">
4858 <pre class="lang-test-vectors sourcecode">
4859 sequence number: 0
4860 pt: 4265617574792069732074727574682c20747275746820626561757479
4861 aad: 436f756e742d30
4862 nonce: d20577dff16d7cea2c4bf780
4863 ct: ab1a13c9d4f01a87ec3440dbd756e2677bd2ecf9df0ce7ed73869b98e00c09be
4864 111cb9fdf077347aeb88e61bdf
4865
4866 sequence number: 1
4867 pt: 4265617574792069732074727574682c20747275746820626561757479
4868 aad: 436f756e742d31
4869 nonce: d20577dff16d7cea2c4bf781
4870 ct: 3265c7807ffff7fdace21659a2c6ccffee52a26d270c76468ed74202a65478bf
4871 aedfff9c2b7634e24f10b71016
4872
4873 sequence number: 2
4874 pt: 4265617574792069732074727574682c20747275746820626561757479
4875 aad: 436f756e742d32
4876 nonce: d20577dff16d7cea2c4bf782
4877 ct: 3aadee86ad2a05081ea860033a9d09dbccb4acac2ded0891da40f51d4df19925
4878 f7a767b076a5cbc9355c8fd35e
4879
4880 sequence number: 4
4881 pt: 4265617574792069732074727574682c20747275746820626561757479
4882 aad: 436f756e742d34
4883 nonce: d20577dff16d7cea2c4bf784
4884 ct: 502ecccd5c2be3506a081809cc58b43b94f77cbe37b8b31712d9e21c9e61aa69
4885 46a8e922f54eae630f88eb8033
4886
4887 sequence number: 255
4888 pt: 4265617574792069732074727574682c20747275746820626561757479
4889 aad: 436f756e742d323535
4890 nonce: d20577dff16d7cea2c4bf77f
4891 ct: 652e597ba20f3d9241cda61f33937298b1169e6adf72974bbe454297502eb4be
4892 132e1c5064702fc165c2ddbde8
4893
4894 sequence number: 256
4895 pt: 4265617574792069732074727574682c20747275746820626561757479
4896 aad: 436f756e742d323536
4897 nonce: d20577dff16d7cea2c4bf680
4898 ct: 3be14e8b3bbd1028cf2b7d0a691dbbeff71321e7dec92d3c2cfb30a0994ab246
4899 af76168480285a60037b4ba13a
4900 </pre><a href="#appendix-A.2.3.1-1" class="pilcrow">¶</a>
4901 </div>
4902 </section>
4903 </div>
4904 <div id="exported-values-6">
4905 <section id="appendix-A.2.3.2">
4906 <h5 id="name-exported-values-7">
4907 <a href="#appendix-A.2.3.2" class="section-number selfRef">A.2.3.2. </a><a href="#name-exported-values-7" class="section-name selfRef">Exported Values</a>
4908 </h5>
4909 <div id="appendix-A.2.3.2-1">
4910 <pre class="lang-test-vectors sourcecode">
4911 exporter_context:
4912 L: 32
4913 exported_value:
4914 070cffafd89b67b7f0eeb800235303a223e6ff9d1e774dce8eac585c8688c872
4915
4916 exporter_context: 00
4917 L: 32
4918 exported_value:
4919 2852e728568d40ddb0edde284d36a4359c56558bb2fb8837cd3d92e46a3a14a8
4920
4921 exporter_context: 54657374436f6e74657874
4922 L: 32
4923 exported_value:
4924 1df39dc5dd60edcbf5f9ae804e15ada66e885b28ed7929116f768369a3f950ee
4925 </pre><a href="#appendix-A.2.3.2-1" class="pilcrow">¶</a>
4926 </div>
4927 </section>
4928 </div>
4929 </section>
4930 </div>
4931 <div id="authpsk-setup-information-1">
4932 <section id="appendix-A.2.4">
4933 <h4 id="name-authpsk-setup-information-2">
4934 <a href="#appendix-A.2.4" class="section-number selfRef">A.2.4. </a><a href="#name-authpsk-setup-information-2" class="section-name selfRef">AuthPSK Setup Information</a>
4935 </h4>
4936 <div id="appendix-A.2.4-1">
4937 <pre class="lang-test-vectors sourcecode">
4938 mode: 3
4939 kem_id: 32
4940 kdf_id: 1
4941 aead_id: 3
4942 info: 4f6465206f6e2061204772656369616e2055726e
4943 ikmE:
4944 49d6eac8c6c558c953a0a252929a818745bb08cd3d29e15f9f5db5eb2e7d4b84
4945 pkEm:
4946 656a2e00dc9990fd189e6e473459392df556e9a2758754a09db3f51179a3fc02
4947 skEm:
4948 5e6dd73e82b856339572b7245d3cbb073a7561c0bee52873490e305cbb710410
4949 ikmR:
4950 f3304ddcf15848488271f12b75ecaf72301faabf6ad283654a14c398832eb184
4951 pkRm:
4952 a5099431c35c491ec62ca91df1525d6349cb8aa170c51f9581f8627be6334851
4953 skRm:
4954 7b36a42822e75bf3362dfabbe474b3016236408becb83b859a6909e22803cb0c
4955 ikmS:
4956 20ade1d5203de1aadfb261c4700b6432e260d0d317be6ebbb8d7fffb1f86ad9d
4957 pkSm:
4958 3ac5bd4dd66ff9f2740bef0d6ccb66daa77bff7849d7895182b07fb74d087c45
4959 skSm:
4960 90761c5b0a7ef0985ed66687ad708b921d9803d51637c8d1cb72d03ed0f64418
4961 psk:
4962 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
4963 psk_id: 456e6e796e20447572696e206172616e204d6f726961
4964 enc:
4965 656a2e00dc9990fd189e6e473459392df556e9a2758754a09db3f51179a3fc02
4966 shared_secret:
4967 86a6c0ed17714f11d2951747e660857a5fd7616c933ef03207808b7a7123fe67
4968 key_schedule_context: 036870c4c76ca38ae43efbec0f2377d109499d7ce73f4a
4969 9e1ec37f21d3d063b97cb69c5718a60cc5876c358d3f7fc31ddb598503f67be58ea1
4970 e798c0bb19eb9796
4971 secret:
4972 22670daee17530c9564001d0a7e740e80d0bcc7ae15349f472fcc9e057cbc259
4973 key:
4974 49c7e6d7d2d257aded2a746fe6a9bf12d4de8007c4862b1fdffe8c35fb65054c
4975 base_nonce: abac79931e8c1bcb8a23960a
4976 exporter_secret:
4977 7c6cc1bb98993cd93e2599322247a58fd41fdecd3db895fb4c5fd8d6bbe606b5
4978 </pre><a href="#appendix-A.2.4-1" class="pilcrow">¶</a>
4979 </div>
4980 <div id="encryptions-7">
4981 <section id="appendix-A.2.4.1">
4982 <h5 id="name-encryptions-8">
4983 <a href="#appendix-A.2.4.1" class="section-number selfRef">A.2.4.1. </a><a href="#name-encryptions-8" class="section-name selfRef">Encryptions</a>
4984 </h5>
4985 <div id="appendix-A.2.4.1-1">
4986 <pre class="lang-test-vectors sourcecode">
4987 sequence number: 0
4988 pt: 4265617574792069732074727574682c20747275746820626561757479
4989 aad: 436f756e742d30
4990 nonce: abac79931e8c1bcb8a23960a
4991 ct: 9aa52e29274fc6172e38a4461361d2342585d3aeec67fb3b721ecd63f059577c
4992 7fe886be0ede01456ebc67d597
4993
4994 sequence number: 1
4995 pt: 4265617574792069732074727574682c20747275746820626561757479
4996 aad: 436f756e742d31
4997 nonce: abac79931e8c1bcb8a23960b
4998 ct: 59460bacdbe7a920ef2806a74937d5a691d6d5062d7daafcad7db7e4d8c649ad
4999 ffe575c1889c5c2e3a49af8e3e
5000
5001 sequence number: 2
5002 pt: 4265617574792069732074727574682c20747275746820626561757479
5003 aad: 436f756e742d32
5004 nonce: abac79931e8c1bcb8a239608
5005 ct: 5688ff6a03ba26ae936044a5c800f286fb5d1eccdd2a0f268f6ff9773b511693
5006 18d1a1466bb36263415071db00
5007
5008 sequence number: 4
5009 pt: 4265617574792069732074727574682c20747275746820626561757479
5010 aad: 436f756e742d34
5011 nonce: abac79931e8c1bcb8a23960e
5012 ct: d936b7a01f5c7dc4c3dc04e322cc694684ee18dd71719196874e5235aed3cfb0
5013 6cadcd3bc7da0877488d7c551d
5014
5015 sequence number: 255
5016 pt: 4265617574792069732074727574682c20747275746820626561757479
5017 aad: 436f756e742d323535
5018 nonce: abac79931e8c1bcb8a2396f5
5019 ct: 4d4c462f7b9b637eaf1f4e15e325b7bc629c0af6e3073422c86064cc3c98cff8
5020 7300f054fd56dd57dc34358beb
5021
5022 sequence number: 256
5023 pt: 4265617574792069732074727574682c20747275746820626561757479
5024 aad: 436f756e742d323536
5025 nonce: abac79931e8c1bcb8a23970a
5026 ct: 9b7f84224922d2a9edd7b2c2057f3bcf3a547f17570575e626202e593bfdd99e
5027 9878a1af9e41ded58c7fb77d2f
5028 </pre><a href="#appendix-A.2.4.1-1" class="pilcrow">¶</a>
5029 </div>
5030 </section>
5031 </div>
5032 <div id="exported-values-7">
5033 <section id="appendix-A.2.4.2">
5034 <h5 id="name-exported-values-8">
5035 <a href="#appendix-A.2.4.2" class="section-number selfRef">A.2.4.2. </a><a href="#name-exported-values-8" class="section-name selfRef">Exported Values</a>
5036 </h5>
5037 <div id="appendix-A.2.4.2-1">
5038 <pre class="lang-test-vectors sourcecode">
5039 exporter_context:
5040 L: 32
5041 exported_value:
5042 c23ebd4e7a0ad06a5dddf779f65004ce9481069ce0f0e6dd51a04539ddcbd5cd
5043
5044 exporter_context: 00
5045 L: 32
5046 exported_value:
5047 ed7ff5ca40a3d84561067ebc8e01702bc36cf1eb99d42a92004642b9dfaadd37
5048
5049 exporter_context: 54657374436f6e74657874
5050 L: 32
5051 exported_value:
5052 d3bae066aa8da27d527d85c040f7dd6ccb60221c902ee36a82f70bcd62a60ee4
5053 </pre><a href="#appendix-A.2.4.2-1" class="pilcrow">¶</a>
5054 </div>
5055 </section>
5056 </div>
5057 </section>
5058 </div>
5059 </section>
5060 </div>
5061 <div id="dhkemp-256-hkdf-sha256-hkdf-sha256-aes-128-gcm">
5062 <section id="appendix-A.3">
5063 <h3 id="name-dhkemp-256-hkdf-sha256-hkdf">
5064 <a href="#appendix-A.3" class="section-number selfRef">A.3. </a><a href="#name-dhkemp-256-hkdf-sha256-hkdf" class="section-name selfRef">DHKEM(P-256, HKDF-SHA256), HKDF-SHA256, AES-128-GCM</a>
5065 </h3>
5066 <div id="base-setup-information-2">
5067 <section id="appendix-A.3.1">
5068 <h4 id="name-base-setup-information-3">
5069 <a href="#appendix-A.3.1" class="section-number selfRef">A.3.1. </a><a href="#name-base-setup-information-3" class="section-name selfRef">Base Setup Information</a>
5070 </h4>
5071 <div id="appendix-A.3.1-1">
5072 <pre class="lang-test-vectors sourcecode">
5073 mode: 0
5074 kem_id: 16
5075 kdf_id: 1
5076 aead_id: 1
5077 info: 4f6465206f6e2061204772656369616e2055726e
5078 ikmE:
5079 4270e54ffd08d79d5928020af4686d8f6b7d35dbe470265f1f5aa22816ce860e
5080 pkEm: 04a92719c6195d5085104f469a8b9814d5838ff72b60501e2c4466e5e67b32
5081 5ac98536d7b61a1af4b78e5b7f951c0900be863c403ce65c9bfcb9382657222d18c4
5082 skEm:
5083 4995788ef4b9d6132b249ce59a77281493eb39af373d236a1fe415cb0c2d7beb
5084 ikmR:
5085 668b37171f1072f3cf12ea8a236a45df23fc13b82af3609ad1e354f6ef817550
5086 pkRm: 04fe8c19ce0905191ebc298a9245792531f26f0cece2460639e8bc39cb7f70
5087 6a826a779b4cf969b8a0e539c7f62fb3d30ad6aa8f80e30f1d128aafd68a2ce72ea0
5088 skRm:
5089 f3ce7fdae57e1a310d87f1ebbde6f328be0a99cdbcadf4d6589cf29de4b8ffd2
5090 enc: 04a92719c6195d5085104f469a8b9814d5838ff72b60501e2c4466e5e67b325
5091 ac98536d7b61a1af4b78e5b7f951c0900be863c403ce65c9bfcb9382657222d18c4
5092 shared_secret:
5093 c0d26aeab536609a572b07695d933b589dcf363ff9d93c93adea537aeabb8cb8
5094 key_schedule_context: 00b88d4e6d91759e65e87c470e8b9141113e9ad5f0c8ce
5095 efc1e088c82e6980500798e486f9c9c09c9b5c753ac72d6005de254c607d1b534ed1
5096 1d493ae1c1d9ac85
5097 secret:
5098 2eb7b6bf138f6b5aff857414a058a3f1750054a9ba1f72c2cf0684a6f20b10e1
5099 key: 868c066ef58aae6dc589b6cfdd18f97e
5100 base_nonce: 4e0bc5018beba4bf004cca59
5101 exporter_secret:
5102 14ad94af484a7ad3ef40e9f3be99ecc6fa9036df9d4920548424df127ee0d99f
5103 </pre><a href="#appendix-A.3.1-1" class="pilcrow">¶</a>
5104 </div>
5105 <div id="encryptions-8">
5106 <section id="appendix-A.3.1.1">
5107 <h5 id="name-encryptions-9">
5108 <a href="#appendix-A.3.1.1" class="section-number selfRef">A.3.1.1. </a><a href="#name-encryptions-9" class="section-name selfRef">Encryptions</a>
5109 </h5>
5110 <div id="appendix-A.3.1.1-1">
5111 <pre class="lang-test-vectors sourcecode">
5112 sequence number: 0
5113 pt: 4265617574792069732074727574682c20747275746820626561757479
5114 aad: 436f756e742d30
5115 nonce: 4e0bc5018beba4bf004cca59
5116 ct: 5ad590bb8baa577f8619db35a36311226a896e7342a6d836d8b7bcd2f20b6c7f
5117 9076ac232e3ab2523f39513434
5118
5119 sequence number: 1
5120 pt: 4265617574792069732074727574682c20747275746820626561757479
5121 aad: 436f756e742d31
5122 nonce: 4e0bc5018beba4bf004cca58
5123 ct: fa6f037b47fc21826b610172ca9637e82d6e5801eb31cbd3748271affd4ecb06
5124 646e0329cbdf3c3cd655b28e82
5125
5126 sequence number: 2
5127 pt: 4265617574792069732074727574682c20747275746820626561757479
5128 aad: 436f756e742d32
5129 nonce: 4e0bc5018beba4bf004cca5b
5130 ct: 895cabfac50ce6c6eb02ffe6c048bf53b7f7be9a91fc559402cbc5b8dcaeb52b
5131 2ccc93e466c28fb55fed7a7fec
5132
5133 sequence number: 4
5134 pt: 4265617574792069732074727574682c20747275746820626561757479
5135 aad: 436f756e742d34
5136 nonce: 4e0bc5018beba4bf004cca5d
5137 ct: 8787491ee8df99bc99a246c4b3216d3d57ab5076e18fa27133f520703bc70ec9
5138 99dd36ce042e44f0c3169a6a8f
5139
5140 sequence number: 255
5141 pt: 4265617574792069732074727574682c20747275746820626561757479
5142 aad: 436f756e742d323535
5143 nonce: 4e0bc5018beba4bf004ccaa6
5144 ct: 2ad71c85bf3f45c6eca301426289854b31448bcf8a8ccb1deef3ebd87f60848a
5145 a53c538c30a4dac71d619ee2cd
5146
5147 sequence number: 256
5148 pt: 4265617574792069732074727574682c20747275746820626561757479
5149 aad: 436f756e742d323536
5150 nonce: 4e0bc5018beba4bf004ccb59
5151 ct: 10f179686aa2caec1758c8e554513f16472bd0a11e2a907dde0b212cbe87d74f
5152 367f8ffe5e41cd3e9962a6afb2
5153 </pre><a href="#appendix-A.3.1.1-1" class="pilcrow">¶</a>
5154 </div>
5155 </section>
5156 </div>
5157 <div id="exported-values-8">
5158 <section id="appendix-A.3.1.2">
5159 <h5 id="name-exported-values-9">
5160 <a href="#appendix-A.3.1.2" class="section-number selfRef">A.3.1.2. </a><a href="#name-exported-values-9" class="section-name selfRef">Exported Values</a>
5161 </h5>
5162 <div id="appendix-A.3.1.2-1">
5163 <pre class="lang-test-vectors sourcecode">
5164 exporter_context:
5165 L: 32
5166 exported_value:
5167 5e9bc3d236e1911d95e65b576a8a86d478fb827e8bdfe77b741b289890490d4d
5168
5169 exporter_context: 00
5170 L: 32
5171 exported_value:
5172 6cff87658931bda83dc857e6353efe4987a201b849658d9b047aab4cf216e796
5173
5174 exporter_context: 54657374436f6e74657874
5175 L: 32
5176 exported_value:
5177 d8f1ea7942adbba7412c6d431c62d01371ea476b823eb697e1f6e6cae1dab85a
5178 </pre><a href="#appendix-A.3.1.2-1" class="pilcrow">¶</a>
5179 </div>
5180 </section>
5181 </div>
5182 </section>
5183 </div>
5184 <div id="psk-setup-information-2">
5185 <section id="appendix-A.3.2">
5186 <h4 id="name-psk-setup-information-3">
5187 <a href="#appendix-A.3.2" class="section-number selfRef">A.3.2. </a><a href="#name-psk-setup-information-3" class="section-name selfRef">PSK Setup Information</a>
5188 </h4>
5189 <div id="appendix-A.3.2-1">
5190 <pre class="lang-test-vectors sourcecode">
5191 mode: 1
5192 kem_id: 16
5193 kdf_id: 1
5194 aead_id: 1
5195 info: 4f6465206f6e2061204772656369616e2055726e
5196 ikmE:
5197 2afa611d8b1a7b321c761b483b6a053579afa4f767450d3ad0f84a39fda587a6
5198 pkEm: 04305d35563527bce037773d79a13deabed0e8e7cde61eecee403496959e89
5199 e4d0ca701726696d1485137ccb5341b3c1c7aaee90a4a02449725e744b1193b53b5f
5200 skEm:
5201 57427244f6cc016cddf1c19c8973b4060aa13579b4c067fd5d93a5d74e32a90f
5202 ikmR:
5203 d42ef874c1913d9568c9405407c805baddaffd0898a00f1e84e154fa787b2429
5204 pkRm: 040d97419ae99f13007a93996648b2674e5260a8ebd2b822e84899cd52d874
5205 46ea394ca76223b76639eccdf00e1967db10ade37db4e7db476261fcc8df97c5ffd1
5206 skRm:
5207 438d8bcef33b89e0e9ae5eb0957c353c25a94584b0dd59c991372a75b43cb661
5208 psk:
5209 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
5210 psk_id: 456e6e796e20447572696e206172616e204d6f726961
5211 enc: 04305d35563527bce037773d79a13deabed0e8e7cde61eecee403496959e89e
5212 4d0ca701726696d1485137ccb5341b3c1c7aaee90a4a02449725e744b1193b53b5f
5213 shared_secret:
5214 2e783ad86a1beae03b5749e0f3f5e9bb19cb7eb382f2fb2dd64c99f15ae0661b
5215 key_schedule_context: 01b873cdf2dff4c1434988053b7a775e980dd2039ea24f
5216 950b26b056ccedcb933198e486f9c9c09c9b5c753ac72d6005de254c607d1b534ed1
5217 1d493ae1c1d9ac85
5218 secret:
5219 f2f534e55931c62eeb2188c1f53450354a725183937e68c85e68d6b267504d26
5220 key: 55d9eb9d26911d4c514a990fa8d57048
5221 base_nonce: b595dc6b2d7e2ed23af529b1
5222 exporter_secret:
5223 895a723a1eab809804973a53c0ee18ece29b25a7555a4808277ad2651d66d705
5224 </pre><a href="#appendix-A.3.2-1" class="pilcrow">¶</a>
5225 </div>
5226 <div id="encryptions-9">
5227 <section id="appendix-A.3.2.1">
5228 <h5 id="name-encryptions-10">
5229 <a href="#appendix-A.3.2.1" class="section-number selfRef">A.3.2.1. </a><a href="#name-encryptions-10" class="section-name selfRef">Encryptions</a>
5230 </h5>
5231 <div id="appendix-A.3.2.1-1">
5232 <pre class="lang-test-vectors sourcecode">
5233 sequence number: 0
5234 pt: 4265617574792069732074727574682c20747275746820626561757479
5235 aad: 436f756e742d30
5236 nonce: b595dc6b2d7e2ed23af529b1
5237 ct: 90c4deb5b75318530194e4bb62f890b019b1397bbf9d0d6eb918890e1fb2be1a
5238 c2603193b60a49c2126b75d0eb
5239
5240 sequence number: 1
5241 pt: 4265617574792069732074727574682c20747275746820626561757479
5242 aad: 436f756e742d31
5243 nonce: b595dc6b2d7e2ed23af529b0
5244 ct: 9e223384a3620f4a75b5a52f546b7262d8826dea18db5a365feb8b997180b22d
5245 72dc1287f7089a1073a7102c27
5246
5247 sequence number: 2
5248 pt: 4265617574792069732074727574682c20747275746820626561757479
5249 aad: 436f756e742d32
5250 nonce: b595dc6b2d7e2ed23af529b3
5251 ct: adf9f6000773035023be7d415e13f84c1cb32a24339a32eb81df02be9ddc6abc
5252 880dd81cceb7c1d0c7781465b2
5253
5254 sequence number: 4
5255 pt: 4265617574792069732074727574682c20747275746820626561757479
5256 aad: 436f756e742d34
5257 nonce: b595dc6b2d7e2ed23af529b5
5258 ct: 1f4cc9b7013d65511b1f69c050b7bd8bbd5a5c16ece82b238fec4f30ba2400e7
5259 ca8ee482ac5253cffb5c3dc577
5260
5261 sequence number: 255
5262 pt: 4265617574792069732074727574682c20747275746820626561757479
5263 aad: 436f756e742d323535
5264 nonce: b595dc6b2d7e2ed23af5294e
5265 ct: cdc541253111ed7a424eea5134dc14fc5e8293ab3b537668b8656789628e4589
5266 4e5bb873c968e3b7cdcbb654a4
5267
5268 sequence number: 256
5269 pt: 4265617574792069732074727574682c20747275746820626561757479
5270 aad: 436f756e742d323536
5271 nonce: b595dc6b2d7e2ed23af528b1
5272 ct: faf985208858b1253b97b60aecd28bc18737b58d1242370e7703ec33b73a4c31
5273 a1afee300e349adef9015bbbfd
5274 </pre><a href="#appendix-A.3.2.1-1" class="pilcrow">¶</a>
5275 </div>
5276 </section>
5277 </div>
5278 <div id="exported-values-9">
5279 <section id="appendix-A.3.2.2">
5280 <h5 id="name-exported-values-10">
5281 <a href="#appendix-A.3.2.2" class="section-number selfRef">A.3.2.2. </a><a href="#name-exported-values-10" class="section-name selfRef">Exported Values</a>
5282 </h5>
5283 <div id="appendix-A.3.2.2-1">
5284 <pre class="lang-test-vectors sourcecode">
5285 exporter_context:
5286 L: 32
5287 exported_value:
5288 a115a59bf4dd8dc49332d6a0093af8efca1bcbfd3627d850173f5c4a55d0c185
5289
5290 exporter_context: 00
5291 L: 32
5292 exported_value:
5293 4517eaede0669b16aac7c92d5762dd459c301fa10e02237cd5aeb9be969430c4
5294
5295 exporter_context: 54657374436f6e74657874
5296 L: 32
5297 exported_value:
5298 164e02144d44b607a7722e58b0f4156e67c0c2874d74cf71da6ca48a4cbdc5e0
5299 </pre><a href="#appendix-A.3.2.2-1" class="pilcrow">¶</a>
5300 </div>
5301 </section>
5302 </div>
5303 </section>
5304 </div>
5305 <div id="auth-setup-information-2">
5306 <section id="appendix-A.3.3">
5307 <h4 id="name-auth-setup-information-3">
5308 <a href="#appendix-A.3.3" class="section-number selfRef">A.3.3. </a><a href="#name-auth-setup-information-3" class="section-name selfRef">Auth Setup Information</a>
5309 </h4>
5310 <div id="appendix-A.3.3-1">
5311 <pre class="lang-test-vectors sourcecode">
5312 mode: 2
5313 kem_id: 16
5314 kdf_id: 1
5315 aead_id: 1
5316 info: 4f6465206f6e2061204772656369616e2055726e
5317 ikmE:
5318 798d82a8d9ea19dbc7f2c6dfa54e8a6706f7cdc119db0813dacf8440ab37c857
5319 pkEm: 042224f3ea800f7ec55c03f29fc9865f6ee27004f818fcbdc6dc68932c1e52
5320 e15b79e264a98f2c535ef06745f3d308624414153b22c7332bc1e691cb4af4d53454
5321 skEm:
5322 6b8de0873aed0c1b2d09b8c7ed54cbf24fdf1dfc7a47fa501f918810642d7b91
5323 ikmR:
5324 7bc93bde8890d1fb55220e7f3b0c107ae7e6eda35ca4040bb6651284bf0747ee
5325 pkRm: 04423e363e1cd54ce7b7573110ac121399acbc9ed815fae03b72ffbd4c18b0
5326 1836835c5a09513f28fc971b7266cfde2e96afe84bb0f266920e82c4f53b36e1a78d
5327 skRm:
5328 d929ab4be2e59f6954d6bedd93e638f02d4046cef21115b00cdda2acb2a4440e
5329 ikmS:
5330 874baa0dcf93595a24a45a7f042e0d22d368747daaa7e19f80a802af19204ba8
5331 pkSm: 04a817a0902bf28e036d66add5d544cc3a0457eab150f104285df1e293b5c1
5332 0eef8651213e43d9cd9086c80b309df22cf37609f58c1127f7607e85f210b2804f73
5333 skSm:
5334 1120ac99fb1fccc1e8230502d245719d1b217fe20505c7648795139d177f0de9
5335 enc: 042224f3ea800f7ec55c03f29fc9865f6ee27004f818fcbdc6dc68932c1e52e
5336 15b79e264a98f2c535ef06745f3d308624414153b22c7332bc1e691cb4af4d53454
5337 shared_secret:
5338 d4aea336439aadf68f9348880aa358086f1480e7c167b6ef15453ba69b94b44f
5339 key_schedule_context: 02b88d4e6d91759e65e87c470e8b9141113e9ad5f0c8ce
5340 efc1e088c82e6980500798e486f9c9c09c9b5c753ac72d6005de254c607d1b534ed1
5341 1d493ae1c1d9ac85
5342 secret:
5343 fd0a93c7c6f6b1b0dd6a822d7b16f6c61c83d98ad88426df4613c3581a2319f1
5344 key: 19aa8472b3fdc530392b0e54ca17c0f5
5345 base_nonce: b390052d26b67a5b8a8fcaa4
5346 exporter_secret:
5347 f152759972660eb0e1db880835abd5de1c39c8e9cd269f6f082ed80e28acb164
5348 </pre><a href="#appendix-A.3.3-1" class="pilcrow">¶</a>
5349 </div>
5350 <div id="encryptions-10">
5351 <section id="appendix-A.3.3.1">
5352 <h5 id="name-encryptions-11">
5353 <a href="#appendix-A.3.3.1" class="section-number selfRef">A.3.3.1. </a><a href="#name-encryptions-11" class="section-name selfRef">Encryptions</a>
5354 </h5>
5355 <div id="appendix-A.3.3.1-1">
5356 <pre class="lang-test-vectors sourcecode">
5357 sequence number: 0
5358 pt: 4265617574792069732074727574682c20747275746820626561757479
5359 aad: 436f756e742d30
5360 nonce: b390052d26b67a5b8a8fcaa4
5361 ct: 82ffc8c44760db691a07c5627e5fc2c08e7a86979ee79b494a17cc3405446ac2
5362 bdb8f265db4a099ed3289ffe19
5363
5364 sequence number: 1
5365 pt: 4265617574792069732074727574682c20747275746820626561757479
5366 aad: 436f756e742d31
5367 nonce: b390052d26b67a5b8a8fcaa5
5368 ct: b0a705a54532c7b4f5907de51c13dffe1e08d55ee9ba59686114b05945494d96
5369 725b239468f1229e3966aa1250
5370
5371 sequence number: 2
5372 pt: 4265617574792069732074727574682c20747275746820626561757479
5373 aad: 436f756e742d32
5374 nonce: b390052d26b67a5b8a8fcaa6
5375 ct: 8dc805680e3271a801790833ed74473710157645584f06d1b53ad439078d880b
5376 23e25256663178271c80ee8b7c
5377
5378 sequence number: 4
5379 pt: 4265617574792069732074727574682c20747275746820626561757479
5380 aad: 436f756e742d34
5381 nonce: b390052d26b67a5b8a8fcaa0
5382 ct: 04c8f7aae1584b61aa5816382cb0b834a5d744f420e6dffb5ddcec633a21b8b3
5383 472820930c1ea9258b035937a2
5384
5385 sequence number: 255
5386 pt: 4265617574792069732074727574682c20747275746820626561757479
5387 aad: 436f756e742d323535
5388 nonce: b390052d26b67a5b8a8fca5b
5389 ct: 4a319462eaedee37248b4d985f64f4f863d31913fe9e30b6e13136053b69fe5d
5390 70853c84c60a84bb5495d5a678
5391
5392 sequence number: 256
5393 pt: 4265617574792069732074727574682c20747275746820626561757479
5394 aad: 436f756e742d323536
5395 nonce: b390052d26b67a5b8a8fcba4
5396 ct: 28e874512f8940fafc7d06135e7589f6b4198bc0f3a1c64702e72c9e6abaf9f0
5397 5cb0d2f11b03a517898815c934
5398 </pre><a href="#appendix-A.3.3.1-1" class="pilcrow">¶</a>
5399 </div>
5400 </section>
5401 </div>
5402 <div id="exported-values-10">
5403 <section id="appendix-A.3.3.2">
5404 <h5 id="name-exported-values-11">
5405 <a href="#appendix-A.3.3.2" class="section-number selfRef">A.3.3.2. </a><a href="#name-exported-values-11" class="section-name selfRef">Exported Values</a>
5406 </h5>
5407 <div id="appendix-A.3.3.2-1">
5408 <pre class="lang-test-vectors sourcecode">
5409 exporter_context:
5410 L: 32
5411 exported_value:
5412 837e49c3ff629250c8d80d3c3fb957725ed481e59e2feb57afd9fe9a8c7c4497
5413
5414 exporter_context: 00
5415 L: 32
5416 exported_value:
5417 594213f9018d614b82007a7021c3135bda7b380da4acd9ab27165c508640dbda
5418
5419 exporter_context: 54657374436f6e74657874
5420 L: 32
5421 exported_value:
5422 14fe634f95ca0d86e15247cca7de7ba9b73c9b9deb6437e1c832daf7291b79d5
5423 </pre><a href="#appendix-A.3.3.2-1" class="pilcrow">¶</a>
5424 </div>
5425 </section>
5426 </div>
5427 </section>
5428 </div>
5429 <div id="authpsk-setup-information-2">
5430 <section id="appendix-A.3.4">
5431 <h4 id="name-authpsk-setup-information-3">
5432 <a href="#appendix-A.3.4" class="section-number selfRef">A.3.4. </a><a href="#name-authpsk-setup-information-3" class="section-name selfRef">AuthPSK Setup Information</a>
5433 </h4>
5434 <div id="appendix-A.3.4-1">
5435 <pre class="lang-test-vectors sourcecode">
5436 mode: 3
5437 kem_id: 16
5438 kdf_id: 1
5439 aead_id: 1
5440 info: 4f6465206f6e2061204772656369616e2055726e
5441 ikmE:
5442 3c1fceb477ec954c8d58ef3249e4bb4c38241b5925b95f7486e4d9f1d0d35fbb
5443 pkEm: 046a1de3fc26a3d43f4e4ba97dbe24f7e99181136129c48fbe872d4743e2b1
5444 31357ed4f29a7b317dc22509c7b00991ae990bf65f8b236700c82ab7c11a84511401
5445 skEm:
5446 36f771e411cf9cf72f0701ef2b991ce9743645b472e835fe234fb4d6eb2ff5a0
5447 ikmR:
5448 abcc2da5b3fa81d8aabd91f7f800a8ccf60ec37b1b585a5d1d1ac77f258b6cca
5449 pkRm: 04d824d7e897897c172ac8a9e862e4bd820133b8d090a9b188b8233a64dfbc
5450 5f725aa0aa52c8462ab7c9188f1c4872f0c99087a867e8a773a13df48a627058e1b3
5451 skRm:
5452 bdf4e2e587afdf0930644a0c45053889ebcadeca662d7c755a353d5b4e2a8394
5453 ikmS:
5454 6262031f040a9db853edd6f91d2272596eabbc78a2ed2bd643f770ecd0f19b82
5455 pkSm: 049f158c750e55d8d5ad13ede66cf6e79801634b7acadcad72044eac2ae1d0
5456 480069133d6488bf73863fa988c4ba8bde1c2e948b761274802b4d8012af4f13af9e
5457 skSm:
5458 b0ed8721db6185435898650f7a677affce925aba7975a582653c4cb13c72d240
5459 psk:
5460 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
5461 psk_id: 456e6e796e20447572696e206172616e204d6f726961
5462 enc: 046a1de3fc26a3d43f4e4ba97dbe24f7e99181136129c48fbe872d4743e2b13
5463 1357ed4f29a7b317dc22509c7b00991ae990bf65f8b236700c82ab7c11a84511401
5464 shared_secret:
5465 d4c27698391db126f1612d9e91a767f10b9b19aa17e1695549203f0df7d9aebe
5466 key_schedule_context: 03b873cdf2dff4c1434988053b7a775e980dd2039ea24f
5467 950b26b056ccedcb933198e486f9c9c09c9b5c753ac72d6005de254c607d1b534ed1
5468 1d493ae1c1d9ac85
5469 secret:
5470 3bf9d4c7955da2740414e73081fa74d6f6f2b4b9645d0685219813ce99a2f270
5471 key: 4d567121d67fae1227d90e11585988fb
5472 base_nonce: 67c9d05330ca21e5116ecda6
5473 exporter_secret:
5474 3f479020ae186788e4dfd4a42a21d24f3faabb224dd4f91c2b2e5e9524ca27b2
5475 </pre><a href="#appendix-A.3.4-1" class="pilcrow">¶</a>
5476 </div>
5477 <div id="encryptions-11">
5478 <section id="appendix-A.3.4.1">
5479 <h5 id="name-encryptions-12">
5480 <a href="#appendix-A.3.4.1" class="section-number selfRef">A.3.4.1. </a><a href="#name-encryptions-12" class="section-name selfRef">Encryptions</a>
5481 </h5>
5482 <div id="appendix-A.3.4.1-1">
5483 <pre class="lang-test-vectors sourcecode">
5484 sequence number: 0
5485 pt: 4265617574792069732074727574682c20747275746820626561757479
5486 aad: 436f756e742d30
5487 nonce: 67c9d05330ca21e5116ecda6
5488 ct: b9f36d58d9eb101629a3e5a7b63d2ee4af42b3644209ab37e0a272d44365407d
5489 b8e655c72e4fa46f4ff81b9246
5490
5491 sequence number: 1
5492 pt: 4265617574792069732074727574682c20747275746820626561757479
5493 aad: 436f756e742d31
5494 nonce: 67c9d05330ca21e5116ecda7
5495 ct: 51788c4e5d56276771032749d015d3eea651af0c7bb8e3da669effffed299ea1
5496 f641df621af65579c10fc09736
5497
5498 sequence number: 2
5499 pt: 4265617574792069732074727574682c20747275746820626561757479
5500 aad: 436f756e742d32
5501 nonce: 67c9d05330ca21e5116ecda4
5502 ct: 3b5a2be002e7b29927f06442947e1cf709b9f8508b03823127387223d7127034
5503 71c266efc355f1bc2036f3027c
5504
5505 sequence number: 4
5506 pt: 4265617574792069732074727574682c20747275746820626561757479
5507 aad: 436f756e742d34
5508 nonce: 67c9d05330ca21e5116ecda2
5509 ct: 8ddbf1242fe5c7d61e1675496f3bfdb4d90205b3dfbc1b12aab41395d71a8211
5510 8e095c484103107cf4face5123
5511
5512 sequence number: 255
5513 pt: 4265617574792069732074727574682c20747275746820626561757479
5514 aad: 436f756e742d323535
5515 nonce: 67c9d05330ca21e5116ecd59
5516 ct: 6de25ceadeaec572fbaa25eda2558b73c383fe55106abaec24d518ef6724a7ce
5517 698f83ecdc53e640fe214d2f42
5518
5519 sequence number: 256
5520 pt: 4265617574792069732074727574682c20747275746820626561757479
5521 aad: 436f756e742d323536
5522 nonce: 67c9d05330ca21e5116ecca6
5523 ct: f380e19d291e12c5e378b51feb5cd50f6d00df6cb2af8393794c4df342126c2e
5524 29633fe7e8ce49587531affd4d
5525 </pre><a href="#appendix-A.3.4.1-1" class="pilcrow">¶</a>
5526 </div>
5527 </section>
5528 </div>
5529 <div id="exported-values-11">
5530 <section id="appendix-A.3.4.2">
5531 <h5 id="name-exported-values-12">
5532 <a href="#appendix-A.3.4.2" class="section-number selfRef">A.3.4.2. </a><a href="#name-exported-values-12" class="section-name selfRef">Exported Values</a>
5533 </h5>
5534 <div id="appendix-A.3.4.2-1">
5535 <pre class="lang-test-vectors sourcecode">
5536 exporter_context:
5537 L: 32
5538 exported_value:
5539 595ce0eff405d4b3bb1d08308d70a4e77226ce11766e0a94c4fdb5d90025c978
5540
5541 exporter_context: 00
5542 L: 32
5543 exported_value:
5544 110472ee0ae328f57ef7332a9886a1992d2c45b9b8d5abc9424ff68630f7d38d
5545
5546 exporter_context: 54657374436f6e74657874
5547 L: 32
5548 exported_value:
5549 18ee4d001a9d83a4c67e76f88dd747766576cac438723bad0700a910a4d717e6
5550 </pre><a href="#appendix-A.3.4.2-1" class="pilcrow">¶</a>
5551 </div>
5552 </section>
5553 </div>
5554 </section>
5555 </div>
5556 </section>
5557 </div>
5558 <div id="dhkemp-256-hkdf-sha256-hkdf-sha512-aes-128-gcm">
5559 <section id="appendix-A.4">
5560 <h3 id="name-dhkemp-256-hkdf-sha256-hkdf-">
5561 <a href="#appendix-A.4" class="section-number selfRef">A.4. </a><a href="#name-dhkemp-256-hkdf-sha256-hkdf-" class="section-name selfRef">DHKEM(P-256, HKDF-SHA256), HKDF-SHA512, AES-128-GCM</a>
5562 </h3>
5563 <div id="base-setup-information-3">
5564 <section id="appendix-A.4.1">
5565 <h4 id="name-base-setup-information-4">
5566 <a href="#appendix-A.4.1" class="section-number selfRef">A.4.1. </a><a href="#name-base-setup-information-4" class="section-name selfRef">Base Setup Information</a>
5567 </h4>
5568 <div id="appendix-A.4.1-1">
5569 <pre class="lang-test-vectors sourcecode">
5570 mode: 0
5571 kem_id: 16
5572 kdf_id: 3
5573 aead_id: 1
5574 info: 4f6465206f6e2061204772656369616e2055726e
5575 ikmE:
5576 4ab11a9dd78c39668f7038f921ffc0993b368171d3ddde8031501ee1e08c4c9a
5577 pkEm: 0493ed86735bdfb978cc055c98b45695ad7ce61ce748f4dd63c525a3b8d53a
5578 15565c6897888070070c1579db1f86aaa56deb8297e64db7e8924e72866f9a472580
5579 skEm:
5580 2292bf14bb6e15b8c81a0f45b7a6e93e32d830e48cca702e0affcfb4d07e1b5c
5581 ikmR:
5582 ea9ff7cc5b2705b188841c7ace169290ff312a9cb31467784ca92d7a2e6e1be8
5583 pkRm: 04085aa5b665dc3826f9650ccbcc471be268c8ada866422f739e2d531d4a88
5584 18a9466bc6b449357096232919ec4fe9070ccbac4aac30f4a1a53efcf7af90610edd
5585 skRm:
5586 3ac8530ad1b01885960fab38cf3cdc4f7aef121eaa239f222623614b4079fb38
5587 enc: 0493ed86735bdfb978cc055c98b45695ad7ce61ce748f4dd63c525a3b8d53a1
5588 5565c6897888070070c1579db1f86aaa56deb8297e64db7e8924e72866f9a472580
5589 shared_secret:
5590 02f584736390fc93f5b4ad039826a3fa08e9911bd1215a3db8e8791ba533cafd
5591 key_schedule_context: 005b8a3617af7789ee716e7911c7e77f84cdc4cc46e60f
5592 b7e19e4059f9aeadc00585e26874d1ddde76e551a7679cd47168c466f6e1f705cc93
5593 74c192778a34fcd5ca221d77e229a9d11b654de7942d685069c633b2362ce3b3d8ea
5594 4891c9a2a87a4eb7cdb289ba5e2ecbf8cd2c8498bb4a383dc021454d70d46fcbbad1
5595 252ef4f9
5596 secret: 0c7acdab61693f936c4c1256c78e7be30eebfe466812f9cc49f0b58dc970
5597 328dfc03ea359be0250a471b1635a193d2dfa8cb23c90aa2e25025b892a725353eeb
5598 key: 090ca96e5f8aa02b69fac360da50ddf9
5599 base_nonce: 9c995e621bf9a20c5ca45546
5600 exporter_secret: 4a7abb2ac43e6553f129b2c5750a7e82d149a76ed56dc342d7b
5601 ca61e26d494f4855dff0d0165f27ce57756f7f16baca006539bb8e4518987ba61048
5602 0ac03efa8
5603 </pre><a href="#appendix-A.4.1-1" class="pilcrow">¶</a>
5604 </div>
5605 <div id="encryptions-12">
5606 <section id="appendix-A.4.1.1">
5607 <h5 id="name-encryptions-13">
5608 <a href="#appendix-A.4.1.1" class="section-number selfRef">A.4.1.1. </a><a href="#name-encryptions-13" class="section-name selfRef">Encryptions</a>
5609 </h5>
5610 <div id="appendix-A.4.1.1-1">
5611 <pre class="lang-test-vectors sourcecode">
5612 sequence number: 0
5613 pt: 4265617574792069732074727574682c20747275746820626561757479
5614 aad: 436f756e742d30
5615 nonce: 9c995e621bf9a20c5ca45546
5616 ct: d3cf4984931484a080f74c1bb2a6782700dc1fef9abe8442e44a6f09044c8890
5617 7200b332003543754eb51917ba
5618
5619 sequence number: 1
5620 pt: 4265617574792069732074727574682c20747275746820626561757479
5621 aad: 436f756e742d31
5622 nonce: 9c995e621bf9a20c5ca45547
5623 ct: d14414555a47269dfead9fbf26abb303365e40709a4ed16eaefe1f2070f1ddeb
5624 1bdd94d9e41186f124e0acc62d
5625
5626 sequence number: 2
5627 pt: 4265617574792069732074727574682c20747275746820626561757479
5628 aad: 436f756e742d32
5629 nonce: 9c995e621bf9a20c5ca45544
5630 ct: 9bba136cade5c4069707ba91a61932e2cbedda2d9c7bdc33515aa01dd0e0f7e9
5631 d3579bf4016dec37da4aafa800
5632
5633 sequence number: 4
5634 pt: 4265617574792069732074727574682c20747275746820626561757479
5635 aad: 436f756e742d34
5636 nonce: 9c995e621bf9a20c5ca45542
5637 ct: a531c0655342be013bf32112951f8df1da643602f1866749519f5dcb09cc6843
5638 2579de305a77e6864e862a7600
5639
5640 sequence number: 255
5641 pt: 4265617574792069732074727574682c20747275746820626561757479
5642 aad: 436f756e742d323535
5643 nonce: 9c995e621bf9a20c5ca455b9
5644 ct: be5da649469efbad0fb950366a82a73fefeda5f652ec7d3731fac6c4ffa21a70
5645 04d2ab8a04e13621bd3629547d
5646
5647 sequence number: 256
5648 pt: 4265617574792069732074727574682c20747275746820626561757479
5649 aad: 436f756e742d323536
5650 nonce: 9c995e621bf9a20c5ca45446
5651 ct: 62092672f5328a0dde095e57435edf7457ace60b26ee44c9291110ec135cb0e1
5652 4b85594e4fea11247d937deb62
5653 </pre><a href="#appendix-A.4.1.1-1" class="pilcrow">¶</a>
5654 </div>
5655 </section>
5656 </div>
5657 <div id="exported-values-12">
5658 <section id="appendix-A.4.1.2">
5659 <h5 id="name-exported-values-13">
5660 <a href="#appendix-A.4.1.2" class="section-number selfRef">A.4.1.2. </a><a href="#name-exported-values-13" class="section-name selfRef">Exported Values</a>
5661 </h5>
5662 <div id="appendix-A.4.1.2-1">
5663 <pre class="lang-test-vectors sourcecode">
5664 exporter_context:
5665 L: 32
5666 exported_value:
5667 a32186b8946f61aeead1c093fe614945f85833b165b28c46bf271abf16b57208
5668
5669 exporter_context: 00
5670 L: 32
5671 exported_value:
5672 84998b304a0ea2f11809398755f0abd5f9d2c141d1822def79dd15c194803c2a
5673
5674 exporter_context: 54657374436f6e74657874
5675 L: 32
5676 exported_value:
5677 93fb9411430b2cfa2cf0bed448c46922a5be9beff20e2e621df7e4655852edbc
5678 </pre><a href="#appendix-A.4.1.2-1" class="pilcrow">¶</a>
5679 </div>
5680 </section>
5681 </div>
5682 </section>
5683 </div>
5684 <div id="psk-setup-information-3">
5685 <section id="appendix-A.4.2">
5686 <h4 id="name-psk-setup-information-4">
5687 <a href="#appendix-A.4.2" class="section-number selfRef">A.4.2. </a><a href="#name-psk-setup-information-4" class="section-name selfRef">PSK Setup Information</a>
5688 </h4>
5689 <div id="appendix-A.4.2-1">
5690 <pre class="lang-test-vectors sourcecode">
5691 mode: 1
5692 kem_id: 16
5693 kdf_id: 3
5694 aead_id: 1
5695 info: 4f6465206f6e2061204772656369616e2055726e
5696 ikmE:
5697 c11d883d6587f911d2ddbc2a0859d5b42fb13bf2c8e89ef408a25564893856f5
5698 pkEm: 04a307934180ad5287f95525fe5bc6244285d7273c15e061f0f2efb211c350
5699 57f3079f6e0abae200992610b25f48b63aacfcb669106ddee8aa023feed301901371
5700 skEm:
5701 a5901ff7d6931959c2755382ea40a4869b1dec3694ed3b009dda2d77dd488f18
5702 ikmR:
5703 75bfc2a3a3541170a54c0b06444e358d0ee2b4fb78a401fd399a47a33723b700
5704 pkRm: 043f5266fba0742db649e1043102b8a5afd114465156719cea90373229aabd
5705 d84d7f45dabfc1f55664b888a7e86d594853a6cccdc9b189b57839cbbe3b90b55873
5706 skRm:
5707 bc6f0b5e22429e5ff47d5969003f3cae0f4fec50e23602e880038364f33b8522
5708 psk:
5709 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
5710 psk_id: 456e6e796e20447572696e206172616e204d6f726961
5711 enc: 04a307934180ad5287f95525fe5bc6244285d7273c15e061f0f2efb211c3505
5712 7f3079f6e0abae200992610b25f48b63aacfcb669106ddee8aa023feed301901371
5713 shared_secret:
5714 2912aacc6eaebd71ff715ea50f6ef3a6637856b2a4c58ea61e0c3fc159e3bc16
5715 key_schedule_context: 01713f73042575cebfd132f0cc4338523f8eae95c80a74
5716 9f7cf3eb9436ff1c612ca62c37df27ca46d2cc162445a92c5f5fdc57bcde129ca7b1
5717 f284b0c12297c037ca221d77e229a9d11b654de7942d685069c633b2362ce3b3d8ea
5718 4891c9a2a87a4eb7cdb289ba5e2ecbf8cd2c8498bb4a383dc021454d70d46fcbbad1
5719 252ef4f9
5720 secret: ff2051d2128d5f3078de867143e076262ce1d0aecafc3fff3d607f1eaff0
5721 5345c7d5ffcb3202cdecb3d1a2f7da20592a237747b6e855390cbe2109d3e6ac70c2
5722 key: 0b910ba8d9cfa17e5f50c211cb32839a
5723 base_nonce: 0c29e714eb52de5b7415a1b7
5724 exporter_secret: 50c0a182b6f94b4c0bd955c4aa20df01f282cc12c43065a0812
5725 fe4d4352790171ed2b2c4756ad7f5a730ba336c8f1edd0089d8331192058c385bae3
5726 9c7cc8b57
5727 </pre><a href="#appendix-A.4.2-1" class="pilcrow">¶</a>
5728 </div>
5729 <div id="encryptions-13">
5730 <section id="appendix-A.4.2.1">
5731 <h5 id="name-encryptions-14">
5732 <a href="#appendix-A.4.2.1" class="section-number selfRef">A.4.2.1. </a><a href="#name-encryptions-14" class="section-name selfRef">Encryptions</a>
5733 </h5>
5734 <div id="appendix-A.4.2.1-1">
5735 <pre class="lang-test-vectors sourcecode">
5736 sequence number: 0
5737 pt: 4265617574792069732074727574682c20747275746820626561757479
5738 aad: 436f756e742d30
5739 nonce: 0c29e714eb52de5b7415a1b7
5740 ct: 57624b6e320d4aba0afd11f548780772932f502e2ba2a8068676b2a0d3b5129a
5741 45b9faa88de39e8306da41d4cc
5742
5743 sequence number: 1
5744 pt: 4265617574792069732074727574682c20747275746820626561757479
5745 aad: 436f756e742d31
5746 nonce: 0c29e714eb52de5b7415a1b6
5747 ct: 159d6b4c24bacaf2f5049b7863536d8f3ffede76302dace42080820fa51925d4
5748 e1c72a64f87b14291a3057e00a
5749
5750 sequence number: 2
5751 pt: 4265617574792069732074727574682c20747275746820626561757479
5752 aad: 436f756e742d32
5753 nonce: 0c29e714eb52de5b7415a1b5
5754 ct: bd24140859c99bf0055075e9c460032581dd1726d52cf980d308e9b20083ca62
5755 e700b17892bcf7fa82bac751d0
5756
5757 sequence number: 4
5758 pt: 4265617574792069732074727574682c20747275746820626561757479
5759 aad: 436f756e742d34
5760 nonce: 0c29e714eb52de5b7415a1b3
5761 ct: 93ddd55f82e9aaaa3cfc06840575f09d80160b20538125c2549932977d1238dd
5762 e8126a4a91118faf8632f62cb8
5763
5764 sequence number: 255
5765 pt: 4265617574792069732074727574682c20747275746820626561757479
5766 aad: 436f756e742d323535
5767 nonce: 0c29e714eb52de5b7415a148
5768 ct: 377a98a3c34bf716581b05a6b3fdc257f245856384d5f2241c8840571c52f5c8
5769 5c21138a4a81655edab8fe227d
5770
5771 sequence number: 256
5772 pt: 4265617574792069732074727574682c20747275746820626561757479
5773 aad: 436f756e742d323536
5774 nonce: 0c29e714eb52de5b7415a0b7
5775 ct: cc161f5a179831d456d119d2f2c19a6817289c75d1c61cd37ac8a450acd9efba
5776 02e0ac00d128c17855931ff69a
5777 </pre><a href="#appendix-A.4.2.1-1" class="pilcrow">¶</a>
5778 </div>
5779 </section>
5780 </div>
5781 <div id="exported-values-13">
5782 <section id="appendix-A.4.2.2">
5783 <h5 id="name-exported-values-14">
5784 <a href="#appendix-A.4.2.2" class="section-number selfRef">A.4.2.2. </a><a href="#name-exported-values-14" class="section-name selfRef">Exported Values</a>
5785 </h5>
5786 <div id="appendix-A.4.2.2-1">
5787 <pre class="lang-test-vectors sourcecode">
5788 exporter_context:
5789 L: 32
5790 exported_value:
5791 8158bea21a6700d37022bb7802866edca30ebf2078273757b656ef7fc2e428cf
5792
5793 exporter_context: 00
5794 L: 32
5795 exported_value:
5796 6a348ba6e0e72bb3ef22479214a139ef8dac57be34509a61087a12565473da8d
5797
5798 exporter_context: 54657374436f6e74657874
5799 L: 32
5800 exported_value:
5801 2f6d4f7a18ec48de1ef4469f596aada4afdf6d79b037ed3c07e0118f8723bffc
5802 </pre><a href="#appendix-A.4.2.2-1" class="pilcrow">¶</a>
5803 </div>
5804 </section>
5805 </div>
5806 </section>
5807 </div>
5808 <div id="auth-setup-information-3">
5809 <section id="appendix-A.4.3">
5810 <h4 id="name-auth-setup-information-4">
5811 <a href="#appendix-A.4.3" class="section-number selfRef">A.4.3. </a><a href="#name-auth-setup-information-4" class="section-name selfRef">Auth Setup Information</a>
5812 </h4>
5813 <div id="appendix-A.4.3-1">
5814 <pre class="lang-test-vectors sourcecode">
5815 mode: 2
5816 kem_id: 16
5817 kdf_id: 3
5818 aead_id: 1
5819 info: 4f6465206f6e2061204772656369616e2055726e
5820 ikmE:
5821 6bb031aa9197562da0b44e737db2b9e61f6c3ea1138c37de28fc37ac29bc7350
5822 pkEm: 04fec59fa9f76f5d0f6c1660bb179cb314ed97953c53a60ab38f8e6ace60fd
5823 59178084d0dd66e0f79172992d4ddb2e91172ce24949bcebfff158dcc417f2c6e9c6
5824 skEm:
5825 93cddd5288e7ef4884c8fe321d075df01501b993ff49ffab8184116f39b3c655
5826 ikmR:
5827 649a3f92edbb7a2516a0ade0b7dccc58a37240c4ba06f9726a952227b4adf6ff
5828 pkRm: 04378bad519aab406e04d0e5608bcca809c02d6afd2272d4dd03e9357bd0ee
5829 e8adf84c8deba3155c9cf9506d1d4c8bfefe3cf033a75716cc3cc07295100ec96276
5830 skRm:
5831 1ea4484be482bf25fdb2ed39e6a02ed9156b3e57dfb18dff82e4a048de990236
5832 ikmS:
5833 4d79b8691aab55a7265e8490a04bb3860ed64dece90953ad0dc43a6ea59b4bf2
5834 pkSm: 0404d3c1f9fca22eb4a6d326125f0814c35593b1da8ea0d11a640730b215a2
5835 59b9b98a34ad17e21617d19fe1d4fa39a4828bfdb306b729ec51c543caca3b2d9529
5836 skSm:
5837 02b266d66919f7b08f42ae0e7d97af4ca98b2dae3043bb7e0740ccadc1957579
5838 enc: 04fec59fa9f76f5d0f6c1660bb179cb314ed97953c53a60ab38f8e6ace60fd5
5839 9178084d0dd66e0f79172992d4ddb2e91172ce24949bcebfff158dcc417f2c6e9c6
5840 shared_secret:
5841 1ed49f6d7ada333d171cd63861a1cb700a1ec4236755a9cd5f9f8f67a2f8e7b3
5842 key_schedule_context: 025b8a3617af7789ee716e7911c7e77f84cdc4cc46e60f
5843 b7e19e4059f9aeadc00585e26874d1ddde76e551a7679cd47168c466f6e1f705cc93
5844 74c192778a34fcd5ca221d77e229a9d11b654de7942d685069c633b2362ce3b3d8ea
5845 4891c9a2a87a4eb7cdb289ba5e2ecbf8cd2c8498bb4a383dc021454d70d46fcbbad1
5846 252ef4f9
5847 secret: 9c846ba81ddbbd57bc26d99da6cf7ab956bb735ecd47fe21ed14241c7079
5848 1b7484c1d06663d21a5d97bf1be70d56ab727f650c4f859c5ed3f71f8928b3c082dd
5849 key: 9d4b1c83129f3de6db95faf3d539dcf1
5850 base_nonce: ea4fd7a485ee5f1f4b62c1b7
5851 exporter_secret: ca2410672369aae1afd6c2639f4fe34ca36d35410c090608d29
5852 24f60def17f910d7928575434d7f991b1f19d3e8358b8278ff59ced0d5eed4774cec
5853 72e12766e
5854 </pre><a href="#appendix-A.4.3-1" class="pilcrow">¶</a>
5855 </div>
5856 <div id="encryptions-14">
5857 <section id="appendix-A.4.3.1">
5858 <h5 id="name-encryptions-15">
5859 <a href="#appendix-A.4.3.1" class="section-number selfRef">A.4.3.1. </a><a href="#name-encryptions-15" class="section-name selfRef">Encryptions</a>
5860 </h5>
5861 <div id="appendix-A.4.3.1-1">
5862 <pre class="lang-test-vectors sourcecode">
5863 sequence number: 0
5864 pt: 4265617574792069732074727574682c20747275746820626561757479
5865 aad: 436f756e742d30
5866 nonce: ea4fd7a485ee5f1f4b62c1b7
5867 ct: 2480179d880b5f458154b8bfe3c7e8732332de84aabf06fc440f6b31f169e154
5868 157fa9eb44f2fa4d7b38a9236e
5869
5870 sequence number: 1
5871 pt: 4265617574792069732074727574682c20747275746820626561757479
5872 aad: 436f756e742d31
5873 nonce: ea4fd7a485ee5f1f4b62c1b6
5874 ct: 10cd81e3a816d29942b602a92884348171a31cbd0f042c3057c65cd93c540943
5875 a5b05115bd520c09281061935b
5876
5877 sequence number: 2
5878 pt: 4265617574792069732074727574682c20747275746820626561757479
5879 aad: 436f756e742d32
5880 nonce: ea4fd7a485ee5f1f4b62c1b5
5881 ct: 920743a88d8cf6a09e1a3098e8be8edd09db136e9d543f215924043af8c7410f
5882 68ce6aa64fd2b1a176e7f6b3fd
5883
5884 sequence number: 4
5885 pt: 4265617574792069732074727574682c20747275746820626561757479
5886 aad: 436f756e742d34
5887 nonce: ea4fd7a485ee5f1f4b62c1b3
5888 ct: 6b11380fcc708fc8589effb5b5e0394cbd441fa5e240b5500522150ca8265d65
5889 ff55479405af936e2349119dcd
5890
5891 sequence number: 255
5892 pt: 4265617574792069732074727574682c20747275746820626561757479
5893 aad: 436f756e742d323535
5894 nonce: ea4fd7a485ee5f1f4b62c148
5895 ct: d084eca50e7554bb97ba34c4482dfe32c9a2b7f3ab009c2d1b68ecbf97bee2d2
5896 8cd94b6c829b96361f2701772d
5897
5898 sequence number: 256
5899 pt: 4265617574792069732074727574682c20747275746820626561757479
5900 aad: 436f756e742d323536
5901 nonce: ea4fd7a485ee5f1f4b62c0b7
5902 ct: 247da592cc4ce834a94de2c79f5730ee49342470a021e4a4bc2bb77c53b17413
5903 e94d94f57b4fdaedcf97cfe7b1
5904 </pre><a href="#appendix-A.4.3.1-1" class="pilcrow">¶</a>
5905 </div>
5906 </section>
5907 </div>
5908 <div id="exported-values-14">
5909 <section id="appendix-A.4.3.2">
5910 <h5 id="name-exported-values-15">
5911 <a href="#appendix-A.4.3.2" class="section-number selfRef">A.4.3.2. </a><a href="#name-exported-values-15" class="section-name selfRef">Exported Values</a>
5912 </h5>
5913 <div id="appendix-A.4.3.2-1">
5914 <pre class="lang-test-vectors sourcecode">
5915 exporter_context:
5916 L: 32
5917 exported_value:
5918 f03fbc82f321a0ab4840e487cb75d07aafd8e6f68485e4f7ff72b2f55ff24ad6
5919
5920 exporter_context: 00
5921 L: 32
5922 exported_value:
5923 1ce0cadec0a8f060f4b5070c8f8888dcdfefc2e35819df0cd559928a11ff0891
5924
5925 exporter_context: 54657374436f6e74657874
5926 L: 32
5927 exported_value:
5928 70c405c707102fd0041ea716090753be47d68d238b111d542846bd0d84ba907c
5929 </pre><a href="#appendix-A.4.3.2-1" class="pilcrow">¶</a>
5930 </div>
5931 </section>
5932 </div>
5933 </section>
5934 </div>
5935 <div id="authpsk-setup-information-3">
5936 <section id="appendix-A.4.4">
5937 <h4 id="name-authpsk-setup-information-4">
5938 <a href="#appendix-A.4.4" class="section-number selfRef">A.4.4. </a><a href="#name-authpsk-setup-information-4" class="section-name selfRef">AuthPSK Setup Information</a>
5939 </h4>
5940 <div id="appendix-A.4.4-1">
5941 <pre class="lang-test-vectors sourcecode">
5942 mode: 3
5943 kem_id: 16
5944 kdf_id: 3
5945 aead_id: 1
5946 info: 4f6465206f6e2061204772656369616e2055726e
5947 ikmE:
5948 37ae06a521cd555648c928d7af58ad2aa4a85e34b8cabd069e94ad55ab872cc8
5949 pkEm: 04801740f4b1b35823f7fb2930eac2efc8c4893f34ba111c0bb976e3c7d5dc
5950 0aef5a7ef0bf4057949a140285f774f1efc53b3860936b92279a11b68395d898d138
5951 skEm:
5952 778f2254ae5d661d5c7fca8c4a7495a25bd13f26258e459159f3899df0de76c1
5953 ikmR:
5954 7466024b7e2d2366c3914d7833718f13afb9e3e45bcfbb510594d614ddd9b4e7
5955 pkRm: 04a4ca7af2fc2cce48edbf2f1700983e927743a4e85bb5035ad562043e25d9
5956 a111cbf6f7385fac55edc5c9d2ca6ed351a5643de95c36748e11dbec98730f4d43e9
5957 skRm:
5958 00510a70fde67af487c093234fc4215c1cdec09579c4b30cc8e48cb530414d0e
5959 ikmS:
5960 ee27aaf99bf5cd8398e9de88ac09a82ac22cdb8d0905ab05c0f5fa12ba1709f3
5961 pkSm: 04b59a4157a9720eb749c95f842a5e3e8acdccbe834426d405509ac3191e23
5962 f2165b5bb1f07a6240dd567703ae75e13182ee0f69fc102145cdb5abf681ff126d60
5963 skSm:
5964 d743b20821e6326f7a26684a4beed7088b35e392114480ca9f6c325079dcf10b
5965 psk:
5966 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
5967 psk_id: 456e6e796e20447572696e206172616e204d6f726961
5968 enc: 04801740f4b1b35823f7fb2930eac2efc8c4893f34ba111c0bb976e3c7d5dc0
5969 aef5a7ef0bf4057949a140285f774f1efc53b3860936b92279a11b68395d898d138
5970 shared_secret:
5971 02bee8be0dda755846115db45071c0cf59c25722e015bde1c124de849c0fea52
5972 key_schedule_context: 03713f73042575cebfd132f0cc4338523f8eae95c80a74
5973 9f7cf3eb9436ff1c612ca62c37df27ca46d2cc162445a92c5f5fdc57bcde129ca7b1
5974 f284b0c12297c037ca221d77e229a9d11b654de7942d685069c633b2362ce3b3d8ea
5975 4891c9a2a87a4eb7cdb289ba5e2ecbf8cd2c8498bb4a383dc021454d70d46fcbbad1
5976 252ef4f9
5977 secret: 0f9df08908a6a3d06c8e934cd3f5313f9ebccd0986e316c0198bb48bed30
5978 dc3db2f3baab94fd40c2c285c7288c77e2255401ee2d5884306addf4296b93c238b3
5979 key: b68bb0e2fbf7431cedb46cc3b6f1fe9e
5980 base_nonce: 76af62719d33d39a1cb6be9f
5981 exporter_secret: 7f72308ae68c9a2b3862e686cb547b16d33d00fe482c770c471
5982 7d8b54e9b1e547244c3602bdd86d5a788a8443befea0a7658002b23f1c96a62a6498
5983 6fffc511a
5984 </pre><a href="#appendix-A.4.4-1" class="pilcrow">¶</a>
5985 </div>
5986 <div id="encryptions-15">
5987 <section id="appendix-A.4.4.1">
5988 <h5 id="name-encryptions-16">
5989 <a href="#appendix-A.4.4.1" class="section-number selfRef">A.4.4.1. </a><a href="#name-encryptions-16" class="section-name selfRef">Encryptions</a>
5990 </h5>
5991 <div id="appendix-A.4.4.1-1">
5992 <pre class="lang-test-vectors sourcecode">
5993 sequence number: 0
5994 pt: 4265617574792069732074727574682c20747275746820626561757479
5995 aad: 436f756e742d30
5996 nonce: 76af62719d33d39a1cb6be9f
5997 ct: 840669634db51e28df54f189329c1b727fd303ae413f003020aff5e26276aaa9
5998 10fc4296828cb9d862c2fd7d16
5999
6000 sequence number: 1
6001 pt: 4265617574792069732074727574682c20747275746820626561757479
6002 aad: 436f756e742d31
6003 nonce: 76af62719d33d39a1cb6be9e
6004 ct: d4680a48158d9a75fd09355878d6e33997a36ee01d4a8f22032b22373b795a94
6005 1b7b9c5205ff99e0ff284beef4
6006
6007 sequence number: 2
6008 pt: 4265617574792069732074727574682c20747275746820626561757479
6009 aad: 436f756e742d32
6010 nonce: 76af62719d33d39a1cb6be9d
6011 ct: c45eb6597de2bac929a0f5d404ba9d2dc1ea031880930f1fd7a283f0a0cbebb3
6012 5eac1a9ee0d1225f5e0f181571
6013
6014 sequence number: 4
6015 pt: 4265617574792069732074727574682c20747275746820626561757479
6016 aad: 436f756e742d34
6017 nonce: 76af62719d33d39a1cb6be9b
6018 ct: 4ee2482ad8d7d1e9b7e651c78b6ca26d3c5314d0711710ca62c2fd8bb8996d7d
6019 8727c157538d5493da696b61f8
6020
6021 sequence number: 255
6022 pt: 4265617574792069732074727574682c20747275746820626561757479
6023 aad: 436f756e742d323535
6024 nonce: 76af62719d33d39a1cb6be60
6025 ct: 65596b731df010c76a915c6271a438056ce65696459432eeafdae7b4cadb6290
6026 dd61e68edd4e40b659d2a8cbcc
6027
6028 sequence number: 256
6029 pt: 4265617574792069732074727574682c20747275746820626561757479
6030 aad: 436f756e742d323536
6031 nonce: 76af62719d33d39a1cb6bf9f
6032 ct: 9f659482ebc52f8303f9eac75656d807ec38ce2e50c72e3078cd13d86b30e3f8
6033 90690a873277620f8a6a42d836
6034 </pre><a href="#appendix-A.4.4.1-1" class="pilcrow">¶</a>
6035 </div>
6036 </section>
6037 </div>
6038 <div id="exported-values-15">
6039 <section id="appendix-A.4.4.2">
6040 <h5 id="name-exported-values-16">
6041 <a href="#appendix-A.4.4.2" class="section-number selfRef">A.4.4.2. </a><a href="#name-exported-values-16" class="section-name selfRef">Exported Values</a>
6042 </h5>
6043 <div id="appendix-A.4.4.2-1">
6044 <pre class="lang-test-vectors sourcecode">
6045 exporter_context:
6046 L: 32
6047 exported_value:
6048 c8c917e137a616d3d4e4c9fcd9c50202f366cb0d37862376bc79f9b72e8a8db9
6049
6050 exporter_context: 00
6051 L: 32
6052 exported_value:
6053 33a5d4df232777008a06d0684f23bb891cfaef702f653c8601b6ad4d08dddddf
6054
6055 exporter_context: 54657374436f6e74657874
6056 L: 32
6057 exported_value:
6058 bed80f2e54f1285895c4a3f3b3625e6206f78f1ed329a0cfb5864f7c139b3c6a
6059 </pre><a href="#appendix-A.4.4.2-1" class="pilcrow">¶</a>
6060 </div>
6061 </section>
6062 </div>
6063 </section>
6064 </div>
6065 </section>
6066 </div>
6067 <div id="dhkemp-256-hkdf-sha256-hkdf-sha256-chacha20poly1305">
6068 <section id="appendix-A.5">
6069 <h3 id="name-dhkemp-256-hkdf-sha256-hkdf-s">
6070 <a href="#appendix-A.5" class="section-number selfRef">A.5. </a><a href="#name-dhkemp-256-hkdf-sha256-hkdf-s" class="section-name selfRef">DHKEM(P-256, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305</a>
6071 </h3>
6072 <div id="base-setup-information-4">
6073 <section id="appendix-A.5.1">
6074 <h4 id="name-base-setup-information-5">
6075 <a href="#appendix-A.5.1" class="section-number selfRef">A.5.1. </a><a href="#name-base-setup-information-5" class="section-name selfRef">Base Setup Information</a>
6076 </h4>
6077 <div id="appendix-A.5.1-1">
6078 <pre class="lang-test-vectors sourcecode">
6079 mode: 0
6080 kem_id: 16
6081 kdf_id: 1
6082 aead_id: 3
6083 info: 4f6465206f6e2061204772656369616e2055726e
6084 ikmE:
6085 f1f1a3bc95416871539ecb51c3a8f0cf608afb40fbbe305c0a72819d35c33f1f
6086 pkEm: 04c07836a0206e04e31d8ae99bfd549380b072a1b1b82e563c935c09582782
6087 4fc1559eac6fb9e3c70cd3193968994e7fe9781aa103f5b50e934b5b2f387e381291
6088 skEm:
6089 7550253e1147aae48839c1f8af80d2770fb7a4c763afe7d0afa7e0f42a5b3689
6090 ikmR:
6091 61092f3f56994dd424405899154a9918353e3e008171517ad576b900ddb275e7
6092 pkRm: 04a697bffde9405c992883c5c439d6cc358170b51af72812333b015621dc0f
6093 40bad9bb726f68a5c013806a790ec716ab8669f84f6b694596c2987cf35baba2a006
6094 skRm:
6095 a4d1c55836aa30f9b3fbb6ac98d338c877c2867dd3a77396d13f68d3ab150d3b
6096 enc: 04c07836a0206e04e31d8ae99bfd549380b072a1b1b82e563c935c095827824
6097 fc1559eac6fb9e3c70cd3193968994e7fe9781aa103f5b50e934b5b2f387e381291
6098 shared_secret:
6099 806520f82ef0b03c823b7fc524b6b55a088f566b9751b89551c170f4113bd850
6100 key_schedule_context: 00b738cd703db7b4106e93b4621e9a19c89c838e559642
6101 40e5d3f331aaf8b0d58b2e986ea1c671b61cf45eec134dac0bae58ec6f63e790b140
6102 0b47c33038b0269c
6103 secret:
6104 fe891101629aa355aad68eff3cc5170d057eca0c7573f6575e91f9783e1d4506
6105 key:
6106 a8f45490a92a3b04d1dbf6cf2c3939ad8bfc9bfcb97c04bffe116730c9dfe3fc
6107 base_nonce: 726b4390ed2209809f58c693
6108 exporter_secret:
6109 4f9bd9b3a8db7d7c3a5b9d44fdc1f6e37d5d77689ade5ec44a7242016e6aa205
6110 </pre><a href="#appendix-A.5.1-1" class="pilcrow">¶</a>
6111 </div>
6112 <div id="encryptions-16">
6113 <section id="appendix-A.5.1.1">
6114 <h5 id="name-encryptions-17">
6115 <a href="#appendix-A.5.1.1" class="section-number selfRef">A.5.1.1. </a><a href="#name-encryptions-17" class="section-name selfRef">Encryptions</a>
6116 </h5>
6117 <div id="appendix-A.5.1.1-1">
6118 <pre class="lang-test-vectors sourcecode">
6119 sequence number: 0
6120 pt: 4265617574792069732074727574682c20747275746820626561757479
6121 aad: 436f756e742d30
6122 nonce: 726b4390ed2209809f58c693
6123 ct: 6469c41c5c81d3aa85432531ecf6460ec945bde1eb428cb2fedf7a29f5a685b4
6124 ccb0d057f03ea2952a27bb458b
6125
6126 sequence number: 1
6127 pt: 4265617574792069732074727574682c20747275746820626561757479
6128 aad: 436f756e742d31
6129 nonce: 726b4390ed2209809f58c692
6130 ct: f1564199f7e0e110ec9c1bcdde332177fc35c1adf6e57f8d1df24022227ffa87
6131 16862dbda2b1dc546c9d114374
6132
6133 sequence number: 2
6134 pt: 4265617574792069732074727574682c20747275746820626561757479
6135 aad: 436f756e742d32
6136 nonce: 726b4390ed2209809f58c691
6137 ct: 39de89728bcb774269f882af8dc5369e4f3d6322d986e872b3a8d074c7c18e85
6138 49ff3f85b6d6592ff87c3f310c
6139
6140 sequence number: 4
6141 pt: 4265617574792069732074727574682c20747275746820626561757479
6142 aad: 436f756e742d34
6143 nonce: 726b4390ed2209809f58c697
6144 ct: bc104a14fbede0cc79eeb826ea0476ce87b9c928c36e5e34dc9b6905d91473ec
6145 369a08b1a25d305dd45c6c5f80
6146
6147 sequence number: 255
6148 pt: 4265617574792069732074727574682c20747275746820626561757479
6149 aad: 436f756e742d323535
6150 nonce: 726b4390ed2209809f58c66c
6151 ct: 8f2814a2c548b3be50259713c6724009e092d37789f6856553d61df23ebc0792
6152 35f710e6af3c3ca6eaba7c7c6c
6153
6154 sequence number: 256
6155 pt: 4265617574792069732074727574682c20747275746820626561757479
6156 aad: 436f756e742d323536
6157 nonce: 726b4390ed2209809f58c793
6158 ct: b45b69d419a9be7219d8c94365b89ad6951caf4576ea4774ea40e9b7047a09d6
6159 537d1aa2f7c12d6ae4b729b4d0
6160 </pre><a href="#appendix-A.5.1.1-1" class="pilcrow">¶</a>
6161 </div>
6162 </section>
6163 </div>
6164 <div id="exported-values-16">
6165 <section id="appendix-A.5.1.2">
6166 <h5 id="name-exported-values-17">
6167 <a href="#appendix-A.5.1.2" class="section-number selfRef">A.5.1.2. </a><a href="#name-exported-values-17" class="section-name selfRef">Exported Values</a>
6168 </h5>
6169 <div id="appendix-A.5.1.2-1">
6170 <pre class="lang-test-vectors sourcecode">
6171 exporter_context:
6172 L: 32
6173 exported_value:
6174 9b13c510416ac977b553bf1741018809c246a695f45eff6d3b0356dbefe1e660
6175
6176 exporter_context: 00
6177 L: 32
6178 exported_value:
6179 6c8b7be3a20a5684edecb4253619d9051ce8583baf850e0cb53c402bdcaf8ebb
6180
6181 exporter_context: 54657374436f6e74657874
6182 L: 32
6183 exported_value:
6184 477a50d804c7c51941f69b8e32fe8288386ee1a84905fe4938d58972f24ac938
6185 </pre><a href="#appendix-A.5.1.2-1" class="pilcrow">¶</a>
6186 </div>
6187 </section>
6188 </div>
6189 </section>
6190 </div>
6191 <div id="psk-setup-information-4">
6192 <section id="appendix-A.5.2">
6193 <h4 id="name-psk-setup-information-5">
6194 <a href="#appendix-A.5.2" class="section-number selfRef">A.5.2. </a><a href="#name-psk-setup-information-5" class="section-name selfRef">PSK Setup Information</a>
6195 </h4>
6196 <div id="appendix-A.5.2-1">
6197 <pre class="lang-test-vectors sourcecode">
6198 mode: 1
6199 kem_id: 16
6200 kdf_id: 1
6201 aead_id: 3
6202 info: 4f6465206f6e2061204772656369616e2055726e
6203 ikmE:
6204 e1a4e1d50c4bfcf890f2b4c7d6b2d2aca61368eddc3c84162df2856843e1057a
6205 pkEm: 04f336578b72ad7932fe867cc4d2d44a718a318037a0ec271163699cee653f
6206 a805c1fec955e562663e0c2061bb96a87d78892bff0cc0bad7906c2d998ebe1a7246
6207 skEm:
6208 7d6e4e006cee68af9b3fdd583a0ee8962df9d59fab029997ee3f456cbc857904
6209 ikmR:
6210 ee51dec304abf993ef8fd52aacdd3b539108bbf6e491943266c1de89ec596a17
6211 pkRm: 041eb8f4f20ab72661af369ff3231a733672fa26f385ffb959fd1bae46bfda
6212 43ad55e2d573b880831381d9367417f554ce5b2134fbba5235b44db465feffc6189e
6213 skRm:
6214 12ecde2c8bc2d5d7ed2219c71f27e3943d92b344174436af833337c557c300b3
6215 psk:
6216 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
6217 psk_id: 456e6e796e20447572696e206172616e204d6f726961
6218 enc: 04f336578b72ad7932fe867cc4d2d44a718a318037a0ec271163699cee653fa
6219 805c1fec955e562663e0c2061bb96a87d78892bff0cc0bad7906c2d998ebe1a7246
6220 shared_secret:
6221 ac4f260dce4db6bf45435d9c92c0e11cfdd93743bd3075949975974cc2b3d79e
6222 key_schedule_context: 01622b72afcc3795841596c67ea74400ca3b029374d7d5
6223 640bda367c5d67b3fbeb2e986ea1c671b61cf45eec134dac0bae58ec6f63e790b140
6224 0b47c33038b0269c
6225 secret:
6226 858c8087a1c056db5811e85802f375bb0c19b9983204a1575de4803575d23239
6227 key:
6228 6d61cb330b7771168c8619498e753f16198aad9566d1f1c6c70e2bc1a1a8b142
6229 base_nonce: 0de7655fb65e1cd51a38864e
6230 exporter_secret:
6231 754ca00235b245e72d1f722a7718e7145bd113050a2aa3d89586d4cb7514bfdb
6232 </pre><a href="#appendix-A.5.2-1" class="pilcrow">¶</a>
6233 </div>
6234 <div id="encryptions-17">
6235 <section id="appendix-A.5.2.1">
6236 <h5 id="name-encryptions-18">
6237 <a href="#appendix-A.5.2.1" class="section-number selfRef">A.5.2.1. </a><a href="#name-encryptions-18" class="section-name selfRef">Encryptions</a>
6238 </h5>
6239 <div id="appendix-A.5.2.1-1">
6240 <pre class="lang-test-vectors sourcecode">
6241 sequence number: 0
6242 pt: 4265617574792069732074727574682c20747275746820626561757479
6243 aad: 436f756e742d30
6244 nonce: 0de7655fb65e1cd51a38864e
6245 ct: 21433eaff24d7706f3ed5b9b2e709b07230e2b11df1f2b1fe07b3c70d5948a53
6246 d6fa5c8bed194020bd9df0877b
6247
6248 sequence number: 1
6249 pt: 4265617574792069732074727574682c20747275746820626561757479
6250 aad: 436f756e742d31
6251 nonce: 0de7655fb65e1cd51a38864f
6252 ct: c74a764b4892072ea8c2c56b9bcd46c7f1e9ca8cb0a263f8b40c2ba59ac9c857
6253 033f176019562218769d3e0452
6254
6255 sequence number: 2
6256 pt: 4265617574792069732074727574682c20747275746820626561757479
6257 aad: 436f756e742d32
6258 nonce: 0de7655fb65e1cd51a38864c
6259 ct: dc8cd68863474d6e9cbb6a659335a86a54e036249d41acf909e738c847ff2bd3
6260 6fe3fcacda4ededa7032c0a220
6261
6262 sequence number: 4
6263 pt: 4265617574792069732074727574682c20747275746820626561757479
6264 aad: 436f756e742d34
6265 nonce: 0de7655fb65e1cd51a38864a
6266 ct: cd54a8576353b1b9df366cb0cc042e46eef6f4cf01e205fe7d47e306b2fdd90f
6267 7185f289a26c613ca094e3be10
6268
6269 sequence number: 255
6270 pt: 4265617574792069732074727574682c20747275746820626561757479
6271 aad: 436f756e742d323535
6272 nonce: 0de7655fb65e1cd51a3886b1
6273 ct: 6324570c9d542c70c7e70570c1d8f4c52a89484746bf0625441890ededcc80c2
6274 4ef2301c38bfd34d689d19f67d
6275
6276 sequence number: 256
6277 pt: 4265617574792069732074727574682c20747275746820626561757479
6278 aad: 436f756e742d323536
6279 nonce: 0de7655fb65e1cd51a38874e
6280 ct: 1ea6326c8098ed0437a553c466550114fb2ca1412cca7de98709b9ccdf19206e
6281 52c3d39180e2cf62b3e9f4baf4
6282 </pre><a href="#appendix-A.5.2.1-1" class="pilcrow">¶</a>
6283 </div>
6284 </section>
6285 </div>
6286 <div id="exported-values-17">
6287 <section id="appendix-A.5.2.2">
6288 <h5 id="name-exported-values-18">
6289 <a href="#appendix-A.5.2.2" class="section-number selfRef">A.5.2.2. </a><a href="#name-exported-values-18" class="section-name selfRef">Exported Values</a>
6290 </h5>
6291 <div id="appendix-A.5.2.2-1">
6292 <pre class="lang-test-vectors sourcecode">
6293 exporter_context:
6294 L: 32
6295 exported_value:
6296 530bbc2f68f078dccc89cc371b4f4ade372c9472bafe4601a8432cbb934f528d
6297
6298 exporter_context: 00
6299 L: 32
6300 exported_value:
6301 6e25075ddcc528c90ef9218f800ca3dfe1b8ff4042de5033133adb8bd54c401d
6302
6303 exporter_context: 54657374436f6e74657874
6304 L: 32
6305 exported_value:
6306 6f6fbd0d1c7733f796461b3235a856cc34f676fe61ed509dfc18fa16efe6be78
6307 </pre><a href="#appendix-A.5.2.2-1" class="pilcrow">¶</a>
6308 </div>
6309 </section>
6310 </div>
6311 </section>
6312 </div>
6313 <div id="auth-setup-information-4">
6314 <section id="appendix-A.5.3">
6315 <h4 id="name-auth-setup-information-5">
6316 <a href="#appendix-A.5.3" class="section-number selfRef">A.5.3. </a><a href="#name-auth-setup-information-5" class="section-name selfRef">Auth Setup Information</a>
6317 </h4>
6318 <div id="appendix-A.5.3-1">
6319 <pre class="lang-test-vectors sourcecode">
6320 mode: 2
6321 kem_id: 16
6322 kdf_id: 1
6323 aead_id: 3
6324 info: 4f6465206f6e2061204772656369616e2055726e
6325 ikmE:
6326 0ecd212019008138a31f9104d5dba76b9f8e34d5b996041fff9e3df221dd0d5d
6327 pkEm: 040d5176aedba55bc41709261e9195c5146bb62d783031280775f32e507d79
6328 b5cbc5748b6be6359760c73cfe10ca19521af704ca6d91ff32fc0739527b9385d415
6329 skEm:
6330 085fd5d5e6ce6497c79df960cac93710006b76217d8bcfafbd2bb2c20ea03c42
6331 ikmR:
6332 d32236d8378b9563840653789eb7bc33c3c720e537391727bf1c812d0eac110f
6333 pkRm: 0444f6ee41818d9fe0f8265bffd016b7e2dd3964d610d0f7514244a60dbb7a
6334 11ece876bb110a97a2ac6a9542d7344bf7d2bd59345e3e75e497f7416cf38d296233
6335 skRm:
6336 3cb2c125b8c5a81d165a333048f5dcae29a2ab2072625adad66dbb0f48689af9
6337 ikmS:
6338 0e6be0851283f9327295fd49858a8c8908ea9783212945eef6c598ee0a3cedbb
6339 pkSm: 04265529a04d4f46ab6fa3af4943774a9f1127821656a75a35fade898a9a1b
6340 014f64d874e88cddb24c1c3d79004d3a587db67670ca357ff4fba7e8b56ec013b98b
6341 skSm:
6342 39b19402e742d48d319d24d68e494daa4492817342e593285944830320912519
6343 enc: 040d5176aedba55bc41709261e9195c5146bb62d783031280775f32e507d79b
6344 5cbc5748b6be6359760c73cfe10ca19521af704ca6d91ff32fc0739527b9385d415
6345 shared_secret:
6346 1a45aa4792f4b166bfee7eeab0096c1a6e497480e2261b2a59aad12f2768d469
6347 key_schedule_context: 02b738cd703db7b4106e93b4621e9a19c89c838e559642
6348 40e5d3f331aaf8b0d58b2e986ea1c671b61cf45eec134dac0bae58ec6f63e790b140
6349 0b47c33038b0269c
6350 secret:
6351 9193210815b87a4c5496c9d73e609a6c92665b5ea0d760866294906d089ebb57
6352 key:
6353 cf292f8a4313280a462ce55cde05b5aa5744fe4ca89a5d81b0146a5eaca8092d
6354 base_nonce: 7e45c21e20e869ae00492123
6355 exporter_secret:
6356 dba6e307f71769ba11e2c687cc19592f9d436da0c81e772d7a8a9fd28e54355f
6357 </pre><a href="#appendix-A.5.3-1" class="pilcrow">¶</a>
6358 </div>
6359 <div id="encryptions-18">
6360 <section id="appendix-A.5.3.1">
6361 <h5 id="name-encryptions-19">
6362 <a href="#appendix-A.5.3.1" class="section-number selfRef">A.5.3.1. </a><a href="#name-encryptions-19" class="section-name selfRef">Encryptions</a>
6363 </h5>
6364 <div id="appendix-A.5.3.1-1">
6365 <pre class="lang-test-vectors sourcecode">
6366 sequence number: 0
6367 pt: 4265617574792069732074727574682c20747275746820626561757479
6368 aad: 436f756e742d30
6369 nonce: 7e45c21e20e869ae00492123
6370 ct: 25881f219935eec5ba70d7b421f13c35005734f3e4d959680270f55d71e2f5cb
6371 3bd2daced2770bf3d9d4916872
6372
6373 sequence number: 1
6374 pt: 4265617574792069732074727574682c20747275746820626561757479
6375 aad: 436f756e742d31
6376 nonce: 7e45c21e20e869ae00492122
6377 ct: 653f0036e52a376f5d2dd85b3204b55455b7835c231255ae098d09ed138719b9
6378 7185129786338ab6543f753193
6379
6380 sequence number: 2
6381 pt: 4265617574792069732074727574682c20747275746820626561757479
6382 aad: 436f756e742d32
6383 nonce: 7e45c21e20e869ae00492121
6384 ct: 60878706117f22180c788e62df6a595bc41906096a11a9513e84f0141e43239e
6385 81a98d7a235abc64112fcb8ddd
6386
6387 sequence number: 4
6388 pt: 4265617574792069732074727574682c20747275746820626561757479
6389 aad: 436f756e742d34
6390 nonce: 7e45c21e20e869ae00492127
6391 ct: 0f9094dd08240b5fa7a388b824d19d5b4b1e126cebfd67a062c32f9ba9f1f386
6392 6cc38de7df2702626e2ab65c0f
6393
6394 sequence number: 255
6395 pt: 4265617574792069732074727574682c20747275746820626561757479
6396 aad: 436f756e742d323535
6397 nonce: 7e45c21e20e869ae004921dc
6398 ct: dd29319e08135c5f8401d6537a364e92172c0e3f095f3fd18923881d11c0a683
6399 9345dd0b54acd0edd8f8344792
6400
6401 sequence number: 256
6402 pt: 4265617574792069732074727574682c20747275746820626561757479
6403 aad: 436f756e742d323536
6404 nonce: 7e45c21e20e869ae00492023
6405 ct: e2276ec5047bc4b6ed57d6da7da2fb47a77502f0a30f17d040247c73da336d72
6406 2bc6c89adf68396a0912c6d152
6407 </pre><a href="#appendix-A.5.3.1-1" class="pilcrow">¶</a>
6408 </div>
6409 </section>
6410 </div>
6411 <div id="exported-values-18">
6412 <section id="appendix-A.5.3.2">
6413 <h5 id="name-exported-values-19">
6414 <a href="#appendix-A.5.3.2" class="section-number selfRef">A.5.3.2. </a><a href="#name-exported-values-19" class="section-name selfRef">Exported Values</a>
6415 </h5>
6416 <div id="appendix-A.5.3.2-1">
6417 <pre class="lang-test-vectors sourcecode">
6418 exporter_context:
6419 L: 32
6420 exported_value:
6421 56c4d6c1d3a46c70fd8f4ecda5d27c70886e348efb51bd5edeaa39ff6ce34389
6422
6423 exporter_context: 00
6424 L: 32
6425 exported_value:
6426 d2d3e48ed76832b6b3f28fa84be5f11f09533c0e3c71825a34fb0f1320891b51
6427
6428 exporter_context: 54657374436f6e74657874
6429 L: 32
6430 exported_value:
6431 eb0d312b6263995b4c7761e64b688c215ffd6043ff3bad2368c862784cbe6eff
6432 </pre><a href="#appendix-A.5.3.2-1" class="pilcrow">¶</a>
6433 </div>
6434 </section>
6435 </div>
6436 </section>
6437 </div>
6438 <div id="authpsk-setup-information-4">
6439 <section id="appendix-A.5.4">
6440 <h4 id="name-authpsk-setup-information-5">
6441 <a href="#appendix-A.5.4" class="section-number selfRef">A.5.4. </a><a href="#name-authpsk-setup-information-5" class="section-name selfRef">AuthPSK Setup Information</a>
6442 </h4>
6443 <div id="appendix-A.5.4-1">
6444 <pre class="lang-test-vectors sourcecode">
6445 mode: 3
6446 kem_id: 16
6447 kdf_id: 1
6448 aead_id: 3
6449 info: 4f6465206f6e2061204772656369616e2055726e
6450 ikmE:
6451 f3a07f194703e321ef1f753a1b9fe27a498dfdfa309151d70bedd896c239c499
6452 pkEm: 043539917ee26f8ae0aa5f784a387981b13de33124a3cde88b946720301831
6453 10f331400115855808244ff0c5b6ca6104483ac95724481d41bdcd9f15b430ad16f6
6454 skEm:
6455 11b7e4de2d919240616a31ab14944cced79bc2372108bb98f6792e3b645fe546
6456 ikmR:
6457 1240e55a0a03548d7f963ef783b6a7362cb505e6b31dfd04c81d9b294543bfbd
6458 pkRm: 04d383fd920c42d018b9d57fd73a01f1eee480008923f67d35169478e55d2e
6459 8817068daf62a06b10e0aad4a9e429fa7f904481be96b79a9c231a33e956c20b81b6
6460 skRm:
6461 c29fc577b7e74d525c0043f1c27540a1248e4f2c8d297298e99010a92e94865c
6462 ikmS:
6463 ce2a0387a2eb8870a3a92c34a2975f0f3f271af4384d446c7dc1524a6c6c515a
6464 pkSm: 0492cf8c9b144b742fe5a63d9a181a19d416f3ec8705f24308ad316564823c
6465 344e018bd7c03a33c926bb271b28ef5bf28c0ca00abff249fee5ef7f33315ff34fdb
6466 skSm:
6467 53541bd995f874a67f8bfd8038afa67fd68876801f42ff47d0dc2a4deea067ae
6468 psk:
6469 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
6470 psk_id: 456e6e796e20447572696e206172616e204d6f726961
6471 enc: 043539917ee26f8ae0aa5f784a387981b13de33124a3cde88b9467203018311
6472 0f331400115855808244ff0c5b6ca6104483ac95724481d41bdcd9f15b430ad16f6
6473 shared_secret:
6474 87584311791036a3019bc36803cdd42e9a8931a98b13c88835f2f8a9036a4fd6
6475 key_schedule_context: 03622b72afcc3795841596c67ea74400ca3b029374d7d5
6476 640bda367c5d67b3fbeb2e986ea1c671b61cf45eec134dac0bae58ec6f63e790b140
6477 0b47c33038b0269c
6478 secret:
6479 fe52b4412590e825ea2603fa88e145b2ee014b942a774b55fab4f081301f16f4
6480 key:
6481 31e140c8856941315d4067239fdc4ebe077fbf45a6fc78a61e7a6c8b3bacb10a
6482 base_nonce: 75838a8010d2e4760254dd56
6483 exporter_secret:
6484 600895965755db9c5027f25f039a6e3e506c35b3b7084ce33c4a48d59ee1f0e3
6485 </pre><a href="#appendix-A.5.4-1" class="pilcrow">¶</a>
6486 </div>
6487 <div id="encryptions-19">
6488 <section id="appendix-A.5.4.1">
6489 <h5 id="name-encryptions-20">
6490 <a href="#appendix-A.5.4.1" class="section-number selfRef">A.5.4.1. </a><a href="#name-encryptions-20" class="section-name selfRef">Encryptions</a>
6491 </h5>
6492 <div id="appendix-A.5.4.1-1">
6493 <pre class="lang-test-vectors sourcecode">
6494 sequence number: 0
6495 pt: 4265617574792069732074727574682c20747275746820626561757479
6496 aad: 436f756e742d30
6497 nonce: 75838a8010d2e4760254dd56
6498 ct: 9eadfa0f954835e7e920ffe56dec6b31a046271cf71fdda55db72926e1d8fae9
6499 4cc6280fcfabd8db71eaa65c05
6500
6501 sequence number: 1
6502 pt: 4265617574792069732074727574682c20747275746820626561757479
6503 aad: 436f756e742d31
6504 nonce: 75838a8010d2e4760254dd57
6505 ct: e357ad10d75240224d4095c9f6150a2ed2179c0f878e4f2db8ca95d365d174d0
6506 59ff8c3eb38ea9a65cfc8eaeb8
6507
6508 sequence number: 2
6509 pt: 4265617574792069732074727574682c20747275746820626561757479
6510 aad: 436f756e742d32
6511 nonce: 75838a8010d2e4760254dd54
6512 ct: 2fa56d00f8dd479d67a2ec3308325cf3bbccaf102a64ffccdb006bd7dcb93268
6513 5b9a7b49cdc094a85fec1da5ef
6514
6515 sequence number: 4
6516 pt: 4265617574792069732074727574682c20747275746820626561757479
6517 aad: 436f756e742d34
6518 nonce: 75838a8010d2e4760254dd52
6519 ct: 1fe9d6db14965003ed81a39abf240f9cd7c5a454bca0d69ef9a2de16d537364f
6520 bbf110b9ef11fa4a7a0172f0ce
6521
6522 sequence number: 255
6523 pt: 4265617574792069732074727574682c20747275746820626561757479
6524 aad: 436f756e742d323535
6525 nonce: 75838a8010d2e4760254dda9
6526 ct: eaf4041a5c9122b22d1f8d698eeffe45d64b4ae33d0ddca3a4cdf4a5f595acc9
6527 5a1a9334d06cc4d000df6aaad6
6528
6529 sequence number: 256
6530 pt: 4265617574792069732074727574682c20747275746820626561757479
6531 aad: 436f756e742d323536
6532 nonce: 75838a8010d2e4760254dc56
6533 ct: fb857f4185ce5286c1a52431867537204963ea66a3eee8d2a74419fd8751faee
6534 066d08277ac7880473aa4143ba
6535 </pre><a href="#appendix-A.5.4.1-1" class="pilcrow">¶</a>
6536 </div>
6537 </section>
6538 </div>
6539 <div id="exported-values-19">
6540 <section id="appendix-A.5.4.2">
6541 <h5 id="name-exported-values-20">
6542 <a href="#appendix-A.5.4.2" class="section-number selfRef">A.5.4.2. </a><a href="#name-exported-values-20" class="section-name selfRef">Exported Values</a>
6543 </h5>
6544 <div id="appendix-A.5.4.2-1">
6545 <pre class="lang-test-vectors sourcecode">
6546 exporter_context:
6547 L: 32
6548 exported_value:
6549 c52b4592cd33dd38b2a3613108ddda28dcf7f03d30f2a09703f758bfa8029c9a
6550
6551 exporter_context: 00
6552 L: 32
6553 exported_value:
6554 2f03bebc577e5729e148554991787222b5c2a02b77e9b1ac380541f710e5a318
6555
6556 exporter_context: 54657374436f6e74657874
6557 L: 32
6558 exported_value:
6559 e01dd49e8bfc3d9216abc1be832f0418adf8b47a7b5a330a7436c31e33d765d7
6560 </pre><a href="#appendix-A.5.4.2-1" class="pilcrow">¶</a>
6561 </div>
6562 </section>
6563 </div>
6564 </section>
6565 </div>
6566 </section>
6567 </div>
6568 <div id="dhkemp-521-hkdf-sha512-hkdf-sha512-aes-256-gcm">
6569 <section id="appendix-A.6">
6570 <h3 id="name-dhkemp-521-hkdf-sha512-hkdf">
6571 <a href="#appendix-A.6" class="section-number selfRef">A.6. </a><a href="#name-dhkemp-521-hkdf-sha512-hkdf" class="section-name selfRef">DHKEM(P-521, HKDF-SHA512), HKDF-SHA512, AES-256-GCM</a>
6572 </h3>
6573 <div id="base-setup-information-5">
6574 <section id="appendix-A.6.1">
6575 <h4 id="name-base-setup-information-6">
6576 <a href="#appendix-A.6.1" class="section-number selfRef">A.6.1. </a><a href="#name-base-setup-information-6" class="section-name selfRef">Base Setup Information</a>
6577 </h4>
6578 <div id="appendix-A.6.1-1">
6579 <pre class="lang-test-vectors sourcecode">
6580 mode: 0
6581 kem_id: 18
6582 kdf_id: 3
6583 aead_id: 2
6584 info: 4f6465206f6e2061204772656369616e2055726e
6585 ikmE: 7f06ab8215105fc46aceeb2e3dc5028b44364f960426eb0d8e4026c2f8b5d7
6586 e7a986688f1591abf5ab753c357a5d6f0440414b4ed4ede71317772ac98d9239f709
6587 04
6588 pkEm: 040138b385ca16bb0d5fa0c0665fbbd7e69e3ee29f63991d3e9b5fa740aab8
6589 900aaeed46ed73a49055758425a0ce36507c54b29cc5b85a5cee6bae0cf1c21f2731
6590 ece2013dc3fb7c8d21654bb161b463962ca19e8c654ff24c94dd2898de12051f1ed0
6591 692237fb02b2f8d1dc1c73e9b366b529eb436e98a996ee522aef863dd5739d2f29b0
6592 skEm: 014784c692da35df6ecde98ee43ac425dbdd0969c0c72b42f2e708ab9d5354
6593 15a8569bdacfcc0a114c85b8e3f26acf4d68115f8c91a66178cdbd03b7bcc5291e37
6594 4b
6595 ikmR: 2ad954bbe39b7122529f7dde780bff626cd97f850d0784a432784e69d86ecc
6596 aade43b6c10a8ffdb94bf943c6da479db137914ec835a7e715e36e45e29b587bab3b
6597 f1
6598 pkRm: 0401b45498c1714e2dce167d3caf162e45e0642afc7ed435df7902ccae0e84
6599 ba0f7d373f646b7738bbbdca11ed91bdeae3cdcba3301f2457be452f271fa6837580
6600 e661012af49583a62e48d44bed350c7118c0d8dc861c238c72a2bda17f64704f464b
6601 57338e7f40b60959480c0e58e6559b190d81663ed816e523b6b6a418f66d2451ec64
6602 skRm: 01462680369ae375e4b3791070a7458ed527842f6a98a79ff5e0d4cbde83c2
6603 7196a3916956655523a6a2556a7af62c5cadabe2ef9da3760bb21e005202f7b24628
6604 47
6605 enc: 040138b385ca16bb0d5fa0c0665fbbd7e69e3ee29f63991d3e9b5fa740aab89
6606 00aaeed46ed73a49055758425a0ce36507c54b29cc5b85a5cee6bae0cf1c21f2731e
6607 ce2013dc3fb7c8d21654bb161b463962ca19e8c654ff24c94dd2898de12051f1ed06
6608 92237fb02b2f8d1dc1c73e9b366b529eb436e98a996ee522aef863dd5739d2f29b0
6609 shared_secret: 776ab421302f6eff7d7cb5cb1adaea0cd50872c71c2d63c30c4f1
6610 d5e43653336fef33b103c67e7a98add2d3b66e2fda95b5b2a667aa9dac7e59cc1d46
6611 d30e818
6612 key_schedule_context: 0083a27c5b2358ab4dae1b2f5d8f57f10ccccc822a4733
6613 26f543f239a70aee46347324e84e02d7651a10d08fb3dda739d22d50c53fbfa8122b
6614 aacd0f9ae5913072ef45baa1f3a4b169e141feb957e48d03f28c837d8904c3d67753
6615 08c3d3faa75dd64adfa44e1a1141edf9349959b8f8e5291cbdc56f62b0ed6527d692
6616 e85b09a4
6617 secret: 49fd9f53b0f93732555b2054edfdc0e3101000d75df714b98ce5aa295a37
6618 f1b18dfa86a1c37286d805d3ea09a20b72f93c21e83955a1f01eb7c5eead563d21e7
6619 key:
6620 751e346ce8f0ddb2305c8a2a85c70d5cf559c53093656be636b9406d4d7d1b70
6621 base_nonce: 55ff7a7d739c69f44b25447b
6622 exporter_secret: e4ff9dfbc732a2b9c75823763c5ccc954a2c0648fc6de80a585
6623 81252d0ee3215388a4455e69086b50b87eb28c169a52f42e71de4ca61c920e7bd24c
6624 95cc3f992
6625 </pre><a href="#appendix-A.6.1-1" class="pilcrow">¶</a>
6626 </div>
6627 <div id="encryptions-20">
6628 <section id="appendix-A.6.1.1">
6629 <h5 id="name-encryptions-21">
6630 <a href="#appendix-A.6.1.1" class="section-number selfRef">A.6.1.1. </a><a href="#name-encryptions-21" class="section-name selfRef">Encryptions</a>
6631 </h5>
6632 <div id="appendix-A.6.1.1-1">
6633 <pre class="lang-test-vectors sourcecode">
6634 sequence number: 0
6635 pt: 4265617574792069732074727574682c20747275746820626561757479
6636 aad: 436f756e742d30
6637 nonce: 55ff7a7d739c69f44b25447b
6638 ct: 170f8beddfe949b75ef9c387e201baf4132fa7374593dfafa90768788b7b2b20
6639 0aafcc6d80ea4c795a7c5b841a
6640
6641 sequence number: 1
6642 pt: 4265617574792069732074727574682c20747275746820626561757479
6643 aad: 436f756e742d31
6644 nonce: 55ff7a7d739c69f44b25447a
6645 ct: d9ee248e220ca24ac00bbbe7e221a832e4f7fa64c4fbab3945b6f3af0c5ecd5e
6646 16815b328be4954a05fd352256
6647
6648 sequence number: 2
6649 pt: 4265617574792069732074727574682c20747275746820626561757479
6650 aad: 436f756e742d32
6651 nonce: 55ff7a7d739c69f44b254479
6652 ct: 142cf1e02d1f58d9285f2af7dcfa44f7c3f2d15c73d460c48c6e0e506a3144ba
6653 e35284e7e221105b61d24e1c7a
6654
6655 sequence number: 4
6656 pt: 4265617574792069732074727574682c20747275746820626561757479
6657 aad: 436f756e742d34
6658 nonce: 55ff7a7d739c69f44b25447f
6659 ct: 3bb3a5a07100e5a12805327bf3b152df728b1c1be75a9fd2cb2bf5eac0cca1fb
6660 80addb37eb2a32938c7268e3e5
6661
6662 sequence number: 255
6663 pt: 4265617574792069732074727574682c20747275746820626561757479
6664 aad: 436f756e742d323535
6665 nonce: 55ff7a7d739c69f44b254484
6666 ct: 4f268d0930f8d50b8fd9d0f26657ba25b5cb08b308c92e33382f369c768b558e
6667 113ac95a4c70dd60909ad1adc7
6668
6669 sequence number: 256
6670 pt: 4265617574792069732074727574682c20747275746820626561757479
6671 aad: 436f756e742d323536
6672 nonce: 55ff7a7d739c69f44b25457b
6673 ct: dbbfc44ae037864e75f136e8b4b4123351d480e6619ae0e0ae437f036f2f8f1e
6674 f677686323977a1ccbb4b4f16a
6675 </pre><a href="#appendix-A.6.1.1-1" class="pilcrow">¶</a>
6676 </div>
6677 </section>
6678 </div>
6679 <div id="exported-values-20">
6680 <section id="appendix-A.6.1.2">
6681 <h5 id="name-exported-values-21">
6682 <a href="#appendix-A.6.1.2" class="section-number selfRef">A.6.1.2. </a><a href="#name-exported-values-21" class="section-name selfRef">Exported Values</a>
6683 </h5>
6684 <div id="appendix-A.6.1.2-1">
6685 <pre class="lang-test-vectors sourcecode">
6686 exporter_context:
6687 L: 32
6688 exported_value:
6689 05e2e5bd9f0c30832b80a279ff211cc65eceb0d97001524085d609ead60d0412
6690
6691 exporter_context: 00
6692 L: 32
6693 exported_value:
6694 fca69744bb537f5b7a1596dbf34eaa8d84bf2e3ee7f1a155d41bd3624aa92b63
6695
6696 exporter_context: 54657374436f6e74657874
6697 L: 32
6698 exported_value:
6699 f389beaac6fcf6c0d9376e20f97e364f0609a88f1bc76d7328e9104df8477013
6700 </pre><a href="#appendix-A.6.1.2-1" class="pilcrow">¶</a>
6701 </div>
6702 </section>
6703 </div>
6704 </section>
6705 </div>
6706 <div id="psk-setup-information-5">
6707 <section id="appendix-A.6.2">
6708 <h4 id="name-psk-setup-information-6">
6709 <a href="#appendix-A.6.2" class="section-number selfRef">A.6.2. </a><a href="#name-psk-setup-information-6" class="section-name selfRef">PSK Setup Information</a>
6710 </h4>
6711 <div id="appendix-A.6.2-1">
6712 <pre class="lang-test-vectors sourcecode">
6713 mode: 1
6714 kem_id: 18
6715 kdf_id: 3
6716 aead_id: 2
6717 info: 4f6465206f6e2061204772656369616e2055726e
6718 ikmE: f3ebfa9a69a924e672114fcd9e06fa9559e937f7eccce4181a2b506df53dbe
6719 514be12f094bb28e01de19dd345b4f7ede5ad7eaa6b9c3019592ec68eaae9a14732c
6720 e0
6721 pkEm: 040085eff0835cc84351f32471d32aa453cdc1f6418eaaecf1c2824210eb1d
6722 48d0768b368110fab21407c324b8bb4bec63f042cfa4d0868d19b760eb4beba1bff7
6723 93b30036d2c614d55730bd2a40c718f9466faf4d5f8170d22b6df98dfe0c067d02b3
6724 49ae4a142e0c03418f0a1479ff78a3db07ae2c2e89e5840f712c174ba2118e90fdcb
6725 skEm: 012e5cfe0daf5fe2a1cd617f4c4bae7c86f1f527b3207f115e262a98cc6526
6726 8ec88cb8645aec73b7aa0a472d0292502d1078e762646e0c093cf873243d12c39915
6727 f6
6728 ikmR: a2a2458705e278e574f835effecd18232f8a4c459e7550a09d44348ae5d3b1
6729 ea9d95c51995e657ad6f7cae659f5e186126a471c017f8f5e41da9eba74d4e0473e1
6730 79
6731 pkRm: 04006917e049a2be7e1482759fb067ddb94e9c4f7f5976f655088dec452466
6732 14ff924ed3b385fc2986c0ecc39d14f907bf837d7306aada59dd5889086125ecd038
6733 ead400603394b5d81f89ebfd556a898cc1d6a027e143d199d3db845cb91c5289fb26
6734 c5ff80832935b0e8dd08d37c6185a6f77683347e472d1edb6daa6bd7652fea628fae
6735 skRm: 011bafd9c7a52e3e71afbdab0d2f31b03d998a0dc875dd7555c63560e142bd
6736 e264428de03379863b4ec6138f813fa009927dc5d15f62314c56d4e7ff2b485753eb
6737 72
6738 psk:
6739 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
6740 psk_id: 456e6e796e20447572696e206172616e204d6f726961
6741 enc: 040085eff0835cc84351f32471d32aa453cdc1f6418eaaecf1c2824210eb1d4
6742 8d0768b368110fab21407c324b8bb4bec63f042cfa4d0868d19b760eb4beba1bff79
6743 3b30036d2c614d55730bd2a40c718f9466faf4d5f8170d22b6df98dfe0c067d02b34
6744 9ae4a142e0c03418f0a1479ff78a3db07ae2c2e89e5840f712c174ba2118e90fdcb
6745 shared_secret: 0d52de997fdaa4797720e8b1bebd3df3d03c4cf38cc8c1398168d
6746 36c3fc7626428c9c254dd3f9274450909c64a5b3acbe45e2d850a2fd69ac0605fe5c
6747 8a057a5
6748 key_schedule_context: 0124497637cf18d6fbcc16e9f652f00244c981726f293b
6749 b7819861e85e50c94f0be30e022ab081e18e6f299fd3d3d976a4bc590f85bc7711bf
6750 ce32ee1a7fb1c154ef45baa1f3a4b169e141feb957e48d03f28c837d8904c3d67753
6751 08c3d3faa75dd64adfa44e1a1141edf9349959b8f8e5291cbdc56f62b0ed6527d692
6752 e85b09a4
6753 secret: 2cf425e26f65526afc0634a3dba4e28d980c1015130ce07c2ac7530d7a39
6754 1a75e5a0db428b09f27ad4d975b4ad1e7f85800e03ffeea35e8cf3fe67b18d4a1345
6755 key:
6756 f764a5a4b17e5d1ffba6e699d65560497ebaea6eb0b0d9010a6d979e298a39ff
6757 base_nonce: 479afdf3546ddba3a9841f38
6758 exporter_secret: 5c3d4b65a13570502b93095ef196c42c8211a4a188c4590d358
6759 63665c705bb140ecba6ce9256be3fad35b4378d41643867454612adfd0542a684b61
6760 799bf293f
6761 </pre><a href="#appendix-A.6.2-1" class="pilcrow">¶</a>
6762 </div>
6763 <div id="encryptions-21">
6764 <section id="appendix-A.6.2.1">
6765 <h5 id="name-encryptions-22">
6766 <a href="#appendix-A.6.2.1" class="section-number selfRef">A.6.2.1. </a><a href="#name-encryptions-22" class="section-name selfRef">Encryptions</a>
6767 </h5>
6768 <div id="appendix-A.6.2.1-1">
6769 <pre class="lang-test-vectors sourcecode">
6770 sequence number: 0
6771 pt: 4265617574792069732074727574682c20747275746820626561757479
6772 aad: 436f756e742d30
6773 nonce: 479afdf3546ddba3a9841f38
6774 ct: de69e9d943a5d0b70be3359a19f317bd9aca4a2ebb4332a39bcdfc97d5fe62f3
6775 a77702f4822c3be531aa7843a1
6776
6777 sequence number: 1
6778 pt: 4265617574792069732074727574682c20747275746820626561757479
6779 aad: 436f756e742d31
6780 nonce: 479afdf3546ddba3a9841f39
6781 ct: 77a16162831f90de350fea9152cfc685ecfa10acb4f7994f41aed43fa5431f23
6782 82d078ec88baec53943984553e
6783
6784 sequence number: 2
6785 pt: 4265617574792069732074727574682c20747275746820626561757479
6786 aad: 436f756e742d32
6787 nonce: 479afdf3546ddba3a9841f3a
6788 ct: f1d48d09f126b9003b4c7d3fe6779c7c92173188a2bb7465ba43d899a6398a33
6789 3914d2bb19fd769d53f3ec7336
6790
6791 sequence number: 4
6792 pt: 4265617574792069732074727574682c20747275746820626561757479
6793 aad: 436f756e742d34
6794 nonce: 479afdf3546ddba3a9841f3c
6795 ct: 829b11c082b0178082cd595be6d73742a4721b9ac05f8d2ef8a7704a53022d82
6796 bd0d8571f578c5c13b99eccff8
6797
6798 sequence number: 255
6799 pt: 4265617574792069732074727574682c20747275746820626561757479
6800 aad: 436f756e742d323535
6801 nonce: 479afdf3546ddba3a9841fc7
6802 ct: a3ee291e20f37021e82df14d41f3fbe98b27c43b318a36cacd8471a3b1051ab1
6803 2ee055b62ded95b72a63199a3f
6804
6805 sequence number: 256
6806 pt: 4265617574792069732074727574682c20747275746820626561757479
6807 aad: 436f756e742d323536
6808 nonce: 479afdf3546ddba3a9841e38
6809 ct: eecc2173ce1ac14b27ee67041e90ed50b7809926e55861a579949c07f6d26137
6810 bf9cf0d097f60b5fd2fbf348ec
6811 </pre><a href="#appendix-A.6.2.1-1" class="pilcrow">¶</a>
6812 </div>
6813 </section>
6814 </div>
6815 <div id="exported-values-21">
6816 <section id="appendix-A.6.2.2">
6817 <h5 id="name-exported-values-22">
6818 <a href="#appendix-A.6.2.2" class="section-number selfRef">A.6.2.2. </a><a href="#name-exported-values-22" class="section-name selfRef">Exported Values</a>
6819 </h5>
6820 <div id="appendix-A.6.2.2-1">
6821 <pre class="lang-test-vectors sourcecode">
6822 exporter_context:
6823 L: 32
6824 exported_value:
6825 62691f0f971e34de38370bff24deb5a7d40ab628093d304be60946afcdb3a936
6826
6827 exporter_context: 00
6828 L: 32
6829 exported_value:
6830 76083c6d1b6809da088584674327b39488eaf665f0731151128452e04ce81bff
6831
6832 exporter_context: 54657374436f6e74657874
6833 L: 32
6834 exported_value:
6835 0c7cfc0976e25ae7680cf909ae2de1859cd9b679610a14bec40d69b91785b2f6
6836 </pre><a href="#appendix-A.6.2.2-1" class="pilcrow">¶</a>
6837 </div>
6838 </section>
6839 </div>
6840 </section>
6841 </div>
6842 <div id="auth-setup-information-5">
6843 <section id="appendix-A.6.3">
6844 <h4 id="name-auth-setup-information-6">
6845 <a href="#appendix-A.6.3" class="section-number selfRef">A.6.3. </a><a href="#name-auth-setup-information-6" class="section-name selfRef">Auth Setup Information</a>
6846 </h4>
6847 <div id="appendix-A.6.3-1">
6848 <pre class="lang-test-vectors sourcecode">
6849 mode: 2
6850 kem_id: 18
6851 kdf_id: 3
6852 aead_id: 2
6853 info: 4f6465206f6e2061204772656369616e2055726e
6854 ikmE: fe1c589c2a05893895a537f38c7cb4300b5a7e8fef3d6ccb8f07a498029c61
6855 e90262e009dc254c7f6235f9c6b2fd6aeff0a714db131b09258c16e217b7bd2aa619
6856 b0
6857 pkEm: 04017de12ede7f72cb101dab36a111265c97b3654816dcd6183f809d4b3d11
6858 1fe759497f8aefdc5dbb40d3e6d21db15bdc60f15f2a420761bcaeef73b891c2b117
6859 e9cf01e29320b799bbc86afdc5ea97d941ea1c5bd5ebeeac7a784b3bab524746f3e6
6860 40ec26ee1bd91255f9330d974f845084637ee0e6fe9f505c5b87c86a4e1a6c3096dd
6861 skEm: 0185f03560de87bb2c543ef03607f3c33ac09980000de25eabe3b224312946
6862 330d2e65d192d3b4aa46ca92fc5ca50736b624402d95f6a80dc04d1f10ae95171372
6863 61
6864 ikmR: 8feea0438481fc0ecd470d6adfcda334a759c6b8650452c5a5dd9b2dd2cc9b
6865 e33d2bb7ee64605fc07ab4664a58bb9a8de80defe510b6c97d2daf85b92cd4bb0a66
6866 bf
6867 pkRm: 04007d419b8834e7513d0e7cc66424a136ec5e11395ab353da324e3586673e
6868 e73d53ab34f30a0b42a92d054d0db321b80f6217e655e304f72793767c4231785c4a
6869 4a6e008f31b93b7a4f2b8cd12e5fe5a0523dc71353c66cbdad51c86b9e0bdfcd9a45
6870 698f2dab1809ab1b0f88f54227232c858accc44d9a8d41775ac026341564a2d749f4
6871 skRm: 013ef326940998544a899e15e1726548ff43bbdb23a8587aa3bef9d1b85733
6872 8d87287df5667037b519d6a14661e9503cfc95a154d93566d8c84e95ce93ad05293a
6873 0b
6874 ikmS: 2f66a68b85ef04822b054ef521838c00c64f8b6226935593b69e13a1a2461a
6875 4f1a74c10c836e87eed150c0db85d4e4f506cbb746149befac6f5c07dc48a615ef92
6876 db
6877 pkSm: 04015cc3636632ea9a3879e43240beae5d15a44fba819282fac26a19c989fa
6878 fdd0f330b8521dff7dc393101b018c1e65b07be9f5fc9a28a1f450d6a541ee0d7622
6879 1133001e8f0f6a05ab79f9b9bb9ccce142a453d59c5abebb5674839d935a3ca1a3fb
6880 c328539a60b3bc3c05fed22838584a726b9c176796cad0169ba4093332cbd2dc3a9f
6881 skSm: 001018584599625ff9953b9305849850d5e34bd789d4b81101139662fbea8b
6882 6508ddb9d019b0d692e737f66beae3f1f783e744202aaf6fea01506c27287e359fe7
6883 76
6884 enc: 04017de12ede7f72cb101dab36a111265c97b3654816dcd6183f809d4b3d111
6885 fe759497f8aefdc5dbb40d3e6d21db15bdc60f15f2a420761bcaeef73b891c2b117e
6886 9cf01e29320b799bbc86afdc5ea97d941ea1c5bd5ebeeac7a784b3bab524746f3e64
6887 0ec26ee1bd91255f9330d974f845084637ee0e6fe9f505c5b87c86a4e1a6c3096dd
6888 shared_secret: 26648fa2a2deb0bfc56349a590fd4cb7108a51797b634694fc020
6889 61e8d91b3576ac736a68bf848fe2a58dfb1956d266e68209a4d631e513badf8f4dcf
6890 c00f30a
6891 key_schedule_context: 0283a27c5b2358ab4dae1b2f5d8f57f10ccccc822a4733
6892 26f543f239a70aee46347324e84e02d7651a10d08fb3dda739d22d50c53fbfa8122b
6893 aacd0f9ae5913072ef45baa1f3a4b169e141feb957e48d03f28c837d8904c3d67753
6894 08c3d3faa75dd64adfa44e1a1141edf9349959b8f8e5291cbdc56f62b0ed6527d692
6895 e85b09a4
6896 secret: 56b7acb7355d080922d2ddc227829c2276a0b456087654b3ac4b53828bd3
6897 4af8cf54626f85af858a15a86eba73011665cc922bc59fd07d2975f356d2674db554
6898 key:
6899 01fced239845e53f0ec616e71777883a1f9fcab22a50f701bdeee17ad040e44d
6900 base_nonce: 9752b85fe8c73eda183f9e80
6901 exporter_secret: 80466a9d9cc5112ddad297e817e038801e15fa18152bc4dc010
6902 a35d7f534089c87c98b4bacd7bbc6276c4002a74085adcd9019fca6139826b529256
6903 9cfb7fe47
6904 </pre><a href="#appendix-A.6.3-1" class="pilcrow">¶</a>
6905 </div>
6906 <div id="encryptions-22">
6907 <section id="appendix-A.6.3.1">
6908 <h5 id="name-encryptions-23">
6909 <a href="#appendix-A.6.3.1" class="section-number selfRef">A.6.3.1. </a><a href="#name-encryptions-23" class="section-name selfRef">Encryptions</a>
6910 </h5>
6911 <div id="appendix-A.6.3.1-1">
6912 <pre class="lang-test-vectors sourcecode">
6913 sequence number: 0
6914 pt: 4265617574792069732074727574682c20747275746820626561757479
6915 aad: 436f756e742d30
6916 nonce: 9752b85fe8c73eda183f9e80
6917 ct: 0116aeb3a1c405c61b1ce47600b7ecd11d89b9c08c408b7e2d1e00a4d64696d1
6918 2e6881dc61688209a8207427f9
6919
6920 sequence number: 1
6921 pt: 4265617574792069732074727574682c20747275746820626561757479
6922 aad: 436f756e742d31
6923 nonce: 9752b85fe8c73eda183f9e81
6924 ct: 37ece0cf6741f443e9d73b9966dc0b228499bb21fbf313948327231e70a18380
6925 e080529c0267f399ba7c539cc6
6926
6927 sequence number: 2
6928 pt: 4265617574792069732074727574682c20747275746820626561757479
6929 aad: 436f756e742d32
6930 nonce: 9752b85fe8c73eda183f9e82
6931 ct: d17b045cac963e45d55fd3692ec17f100df66ac06d91f3b6af8efa7ed3c88955
6932 50eb753bc801fe4bd27005b4bd
6933
6934 sequence number: 4
6935 pt: 4265617574792069732074727574682c20747275746820626561757479
6936 aad: 436f756e742d34
6937 nonce: 9752b85fe8c73eda183f9e84
6938 ct: 50c523ae7c64cada96abea16ddf67a73d2914ec86a4cedb31a7e6257f7553ed2
6939 44626ef79a57198192b2323384
6940
6941 sequence number: 255
6942 pt: 4265617574792069732074727574682c20747275746820626561757479
6943 aad: 436f756e742d323535
6944 nonce: 9752b85fe8c73eda183f9e7f
6945 ct: 53d422295a6ce8fcc51e6f69e252e7195e64abf49252f347d8c25534f1865a6a
6946 17d949c65ce618ddc7d816111f
6947
6948 sequence number: 256
6949 pt: 4265617574792069732074727574682c20747275746820626561757479
6950 aad: 436f756e742d323536
6951 nonce: 9752b85fe8c73eda183f9f80
6952 ct: 0dfcfc22ea768880b4160fec27ab10c75fb27766c6bb97aed373a9b6eae35d31
6953 afb08257401075cbb602ac5abb
6954 </pre><a href="#appendix-A.6.3.1-1" class="pilcrow">¶</a>
6955 </div>
6956 </section>
6957 </div>
6958 <div id="exported-values-22">
6959 <section id="appendix-A.6.3.2">
6960 <h5 id="name-exported-values-23">
6961 <a href="#appendix-A.6.3.2" class="section-number selfRef">A.6.3.2. </a><a href="#name-exported-values-23" class="section-name selfRef">Exported Values</a>
6962 </h5>
6963 <div id="appendix-A.6.3.2-1">
6964 <pre class="lang-test-vectors sourcecode">
6965 exporter_context:
6966 L: 32
6967 exported_value:
6968 8d78748d632f95b8ce0c67d70f4ad1757e61e872b5941e146986804b3990154b
6969
6970 exporter_context: 00
6971 L: 32
6972 exported_value:
6973 80a4753230900ea785b6c80775092801fe91183746479f9b04c305e1db9d1f4d
6974
6975 exporter_context: 54657374436f6e74657874
6976 L: 32
6977 exported_value:
6978 620b176d737cf366bcc20d96adb54ec156978220879b67923689e6dca36210ed
6979 </pre><a href="#appendix-A.6.3.2-1" class="pilcrow">¶</a>
6980 </div>
6981 </section>
6982 </div>
6983 </section>
6984 </div>
6985 <div id="authpsk-setup-information-5">
6986 <section id="appendix-A.6.4">
6987 <h4 id="name-authpsk-setup-information-6">
6988 <a href="#appendix-A.6.4" class="section-number selfRef">A.6.4. </a><a href="#name-authpsk-setup-information-6" class="section-name selfRef">AuthPSK Setup Information</a>
6989 </h4>
6990 <div id="appendix-A.6.4-1">
6991 <pre class="lang-test-vectors sourcecode">
6992 mode: 3
6993 kem_id: 18
6994 kdf_id: 3
6995 aead_id: 2
6996 info: 4f6465206f6e2061204772656369616e2055726e
6997 ikmE: 54272797b1fbc128a6967ff1fd606e0c67868f7762ce1421439cbc9e90ce1b
6998 28d566e6c2acbce712e48eebf236696eb680849d6873e9959395b2931975d61d38bd
6999 6c
7000 pkEm: 04000a5096a6e6e002c83517b494bfc2e36bfb8632fae8068362852b70d0ff
7001 71e560b15aff96741ecffb63d8ac3090c3769679009ac59a99a1feb4713c5f090fc0
7002 dbed01ad73c45d29d369e36744e9ed37d12f80700c16d816485655169a5dd66e4ddf
7003 27f2acffe0f56f7f77ea2b473b4bf0518b975d9527009a3d14e5a4957e3e8a9074f8
7004 skEm: 003430af19716084efeced1241bb1a5625b6c826f11ef31649095eb2795261
7005 9e36f62a79ea28001ac452fb20ddfbb66e62c6c0b1be03c0d28c97794a1fb638207a
7006 83
7007 ikmR: 3db434a8bc25b27eb0c590dc64997ab1378a99f52b2cb5a5a5b2fa540888f6
7008 c0f09794c654f4468524e040e6b4eca2c9dcf229f908b9d318f960cc9e9baa92c5ee
7009 e6
7010 pkRm: 0401655b5d3b7cfafaba30851d25edc44c6dd17d99410efbed8591303b4dbe
7011 ea8cb1045d5255f9a60384c3bbd4a3386ae6e6fab341dc1f8db0eed5f0ab1aaac6d7
7012 838e00dadf8a1c2c64b48f89c633721e88369e54104b31368f26e35d04a442b0b428
7013 510fb23caada686add16492f333b0f7ba74c391d779b788df2c38d7a7f4778009d91
7014 skRm: 0053c0bc8c1db4e9e5c3e3158bfdd7fc716aef12db13c8515adf821dd692ba
7015 3ca53041029128ee19c8556e345c4bcb840bb7fd789f97fe10f17f0e2c6c25280728
7016 43
7017 ikmS: 65d523d9b37e1273eb25ad0527d3a7bd33f67208dd1666d9904c6bc04969ae
7018 5831a8b849e7ff642581f2c3e56be84609600d3c6bbdaded3f6989c37d2892b1e978
7019 d5
7020 pkSm: 040013761e97007293d57de70962876b4926f69a52680b4714bee1d4236aa9
7021 6c19b840c57e80b14e91258f0a350e3f7ba59f3f091633aede4c7ec4fa8918323aa4
7022 5d5901076dec8eeb22899fda9ab9e1960003ff0535f53c02c40f2ae4cdc6070a3870
7023 b85b4bdd0bb77f1f889e7ee51f465a308f08c666ad3407f75dc046b2ff5a24dbe2ed
7024 skSm: 003f64675fc8914ec9e2b3ecf13585b26dbaf3d5d805042ba487a5070b8c5a
7025 c1d39b17e2161771cc1b4d0a3ba6e866f4ea4808684b56af2a49b5e5111146d45d93
7026 26
7027 psk:
7028 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
7029 psk_id: 456e6e796e20447572696e206172616e204d6f726961
7030 enc: 04000a5096a6e6e002c83517b494bfc2e36bfb8632fae8068362852b70d0ff7
7031 1e560b15aff96741ecffb63d8ac3090c3769679009ac59a99a1feb4713c5f090fc0d
7032 bed01ad73c45d29d369e36744e9ed37d12f80700c16d816485655169a5dd66e4ddf2
7033 7f2acffe0f56f7f77ea2b473b4bf0518b975d9527009a3d14e5a4957e3e8a9074f8
7034 shared_secret: 9e1d5f62cb38229f57f68948a0fbc1264499910cce50ec62cb241
7035 88c5b0a98868f3c1cfa8c5baa97b3f24db3cdd30df6e04eae83dc4347be8a981066c
7036 3b5b945
7037 key_schedule_context: 0324497637cf18d6fbcc16e9f652f00244c981726f293b
7038 b7819861e85e50c94f0be30e022ab081e18e6f299fd3d3d976a4bc590f85bc7711bf
7039 ce32ee1a7fb1c154ef45baa1f3a4b169e141feb957e48d03f28c837d8904c3d67753
7040 08c3d3faa75dd64adfa44e1a1141edf9349959b8f8e5291cbdc56f62b0ed6527d692
7041 e85b09a4
7042 secret: 50a57775958037a04098e0054576cd3bc084d0d08d29548ba4befa5676b9
7043 1eb4dcd0752813a052c9a930d0aba6ca10b89dd690b64032dc635dece35d1bf4645c
7044 key:
7045 1316ed34bd52374854ed0e5cb0394ca0a79b2d8ce7f15d5104f21acdfb594286
7046 base_nonce: d9c64ec8deb8a0647fafe8ff
7047 exporter_secret: 6cb00ff99aebb2e4a05042ce0d048326dd2c03acd61a601b103
7048 8a65398406a96ab8b5da3187412b2324089ea16ba4ff7e6f4fe55d281fc8ae5f2049
7049 032b69ebd
7050 </pre><a href="#appendix-A.6.4-1" class="pilcrow">¶</a>
7051 </div>
7052 <div id="encryptions-23">
7053 <section id="appendix-A.6.4.1">
7054 <h5 id="name-encryptions-24">
7055 <a href="#appendix-A.6.4.1" class="section-number selfRef">A.6.4.1. </a><a href="#name-encryptions-24" class="section-name selfRef">Encryptions</a>
7056 </h5>
7057 <div id="appendix-A.6.4.1-1">
7058 <pre class="lang-test-vectors sourcecode">
7059 sequence number: 0
7060 pt: 4265617574792069732074727574682c20747275746820626561757479
7061 aad: 436f756e742d30
7062 nonce: d9c64ec8deb8a0647fafe8ff
7063 ct: 942a2a92e0817cf032ce61abccf4f3a7c5d21b794ed943227e07b7df2d6dd92c
7064 9b8a9371949e65cca262448ab7
7065
7066 sequence number: 1
7067 pt: 4265617574792069732074727574682c20747275746820626561757479
7068 aad: 436f756e742d31
7069 nonce: d9c64ec8deb8a0647fafe8fe
7070 ct: c0a83b5ec3d7933a090f681717290337b4fede5bfaa0a40ec29f93acad742888
7071 a1513c649104c391c78d1d7f29
7072
7073 sequence number: 2
7074 pt: 4265617574792069732074727574682c20747275746820626561757479
7075 aad: 436f756e742d32
7076 nonce: d9c64ec8deb8a0647fafe8fd
7077 ct: 2847b2e0ce0b9da8fca7b0e81ff389d1682ee1b388ed09579b145058b5af6a93
7078 a85dd50d9f417dc88f2c785312
7079
7080 sequence number: 4
7081 pt: 4265617574792069732074727574682c20747275746820626561757479
7082 aad: 436f756e742d34
7083 nonce: d9c64ec8deb8a0647fafe8fb
7084 ct: fbd9948ab9ac4a9cb9e295c07273600e6a111a3a89241d3e2178f39d532a2ec5
7085 c15b9b0c6937ac84c88e0ca76f
7086
7087 sequence number: 255
7088 pt: 4265617574792069732074727574682c20747275746820626561757479
7089 aad: 436f756e742d323535
7090 nonce: d9c64ec8deb8a0647fafe800
7091 ct: 63113a870131b567db8f39a11b4541eafbd2d3cf3a9bf9e5c1cfcb41e52f9027
7092 310b82a4868215959131694d15
7093
7094 sequence number: 256
7095 pt: 4265617574792069732074727574682c20747275746820626561757479
7096 aad: 436f756e742d323536
7097 nonce: d9c64ec8deb8a0647fafe9ff
7098 ct: 24f9d8dadd2107376ccd143f70f9bafcd2b21d8117d45ff327e9a78f603a3260
7099 6e42a6a8bdb57a852591d20907
7100 </pre><a href="#appendix-A.6.4.1-1" class="pilcrow">¶</a>
7101 </div>
7102 </section>
7103 </div>
7104 <div id="exported-values-23">
7105 <section id="appendix-A.6.4.2">
7106 <h5 id="name-exported-values-24">
7107 <a href="#appendix-A.6.4.2" class="section-number selfRef">A.6.4.2. </a><a href="#name-exported-values-24" class="section-name selfRef">Exported Values</a>
7108 </h5>
7109 <div id="appendix-A.6.4.2-1">
7110 <pre class="lang-test-vectors sourcecode">
7111 exporter_context:
7112 L: 32
7113 exported_value:
7114 a39502ef5ca116aa1317bd9583dd52f15b0502b71d900fc8a622d19623d0cb5d
7115
7116 exporter_context: 00
7117 L: 32
7118 exported_value:
7119 749eda112c4cfdd6671d84595f12cd13198fc3ef93ed72369178f344fe6e09c3
7120
7121 exporter_context: 54657374436f6e74657874
7122 L: 32
7123 exported_value:
7124 f8b4e72cefbff4ca6c4eabb8c0383287082cfcbb953d900aed4959afd0017095
7125 </pre><a href="#appendix-A.6.4.2-1" class="pilcrow">¶</a>
7126 </div>
7127 </section>
7128 </div>
7129 </section>
7130 </div>
7131 </section>
7132 </div>
7133 <div id="dhkemx25519-hkdf-sha256-hkdf-sha256-export-only-aead">
7134 <section id="appendix-A.7">
7135 <h3 id="name-dhkemx25519-hkdf-sha256-hkdf-">
7136 <a href="#appendix-A.7" class="section-number selfRef">A.7. </a><a href="#name-dhkemx25519-hkdf-sha256-hkdf-" class="section-name selfRef">DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, Export-Only AEAD</a>
7137 </h3>
7138 <div id="base-setup-information-6">
7139 <section id="appendix-A.7.1">
7140 <h4 id="name-base-setup-information-7">
7141 <a href="#appendix-A.7.1" class="section-number selfRef">A.7.1. </a><a href="#name-base-setup-information-7" class="section-name selfRef">Base Setup Information</a>
7142 </h4>
7143 <div id="appendix-A.7.1-1">
7144 <pre class="lang-test-vectors sourcecode">
7145 mode: 0
7146 kem_id: 32
7147 kdf_id: 1
7148 aead_id: 65535
7149 info: 4f6465206f6e2061204772656369616e2055726e
7150 ikmE:
7151 55bc245ee4efda25d38f2d54d5bb6665291b99f8108a8c4b686c2b14893ea5d9
7152 pkEm:
7153 e5e8f9bfff6c2f29791fc351d2c25ce1299aa5eaca78a757c0b4fb4bcd830918
7154 skEm:
7155 095182b502f1f91f63ba584c7c3ec473d617b8b4c2cec3fad5af7fa6748165ed
7156 ikmR:
7157 683ae0da1d22181e74ed2e503ebf82840deb1d5e872cade20f4b458d99783e31
7158 pkRm:
7159 194141ca6c3c3beb4792cd97ba0ea1faff09d98435012345766ee33aae2d7664
7160 skRm:
7161 33d196c830a12f9ac65d6e565a590d80f04ee9b19c83c87f2c170d972a812848
7162 enc:
7163 e5e8f9bfff6c2f29791fc351d2c25ce1299aa5eaca78a757c0b4fb4bcd830918
7164 shared_secret:
7165 e81716ce8f73141d4f25ee9098efc968c91e5b8ce52ffff59d64039e82918b66
7166 key_schedule_context: 009bd09219212a8cf27c6bb5d54998c5240793a70ca0a8
7167 92234bd5e082bc619b6a3f4c22aa6d9a0424c2b4292fdf43b8257df93c2f6adbf6dd
7168 c9c64fee26bdd292
7169 secret:
7170 04d64e0620aa047e9ab833b0ebcd4ff026cefbe44338fd7d1a93548102ee01af
7171 key:
7172 base_nonce:
7173 exporter_secret:
7174 79dc8e0509cf4a3364ca027e5a0138235281611ca910e435e8ed58167c72f79b
7175 </pre><a href="#appendix-A.7.1-1" class="pilcrow">¶</a>
7176 </div>
7177 <div id="exported-values-24">
7178 <section id="appendix-A.7.1.1">
7179 <h5 id="name-exported-values-25">
7180 <a href="#appendix-A.7.1.1" class="section-number selfRef">A.7.1.1. </a><a href="#name-exported-values-25" class="section-name selfRef">Exported Values</a>
7181 </h5>
7182 <div id="appendix-A.7.1.1-1">
7183 <pre class="lang-test-vectors sourcecode">
7184 exporter_context:
7185 L: 32
7186 exported_value:
7187 7a36221bd56d50fb51ee65edfd98d06a23c4dc87085aa5866cb7087244bd2a36
7188
7189 exporter_context: 00
7190 L: 32
7191 exported_value:
7192 d5535b87099c6c3ce80dc112a2671c6ec8e811a2f284f948cec6dd1708ee33f0
7193
7194 exporter_context: 54657374436f6e74657874
7195 L: 32
7196 exported_value:
7197 ffaabc85a776136ca0c378e5d084c9140ab552b78f039d2e8775f26efff4c70e
7198 </pre><a href="#appendix-A.7.1.1-1" class="pilcrow">¶</a>
7199 </div>
7200 </section>
7201 </div>
7202 </section>
7203 </div>
7204 <div id="psk-setup-information-6">
7205 <section id="appendix-A.7.2">
7206 <h4 id="name-psk-setup-information-7">
7207 <a href="#appendix-A.7.2" class="section-number selfRef">A.7.2. </a><a href="#name-psk-setup-information-7" class="section-name selfRef">PSK Setup Information</a>
7208 </h4>
7209 <div id="appendix-A.7.2-1">
7210 <pre class="lang-test-vectors sourcecode">
7211 mode: 1
7212 kem_id: 32
7213 kdf_id: 1
7214 aead_id: 65535
7215 info: 4f6465206f6e2061204772656369616e2055726e
7216 ikmE:
7217 c51211a8799f6b8a0021fcba673d9c4067a98ebc6794232e5b06cb9febcbbdf5
7218 pkEm:
7219 d3805a97cbcd5f08babd21221d3e6b362a700572d14f9bbeb94ec078d051ae3d
7220 skEm:
7221 1d72396121a6a826549776ef1a9d2f3a2907fc6a38902fa4e401afdb0392e627
7222 ikmR:
7223 5e0516b1b29c0e13386529da16525210c796f7d647c37eac118023a6aa9eb89a
7224 pkRm:
7225 d53af36ea5f58f8868bb4a1333ed4cc47e7a63b0040eb54c77b9c8ec456da824
7226 skRm:
7227 98f304d4ecb312689690b113973c61ffe0aa7c13f2fbe365e48f3ed09e5a6a0c
7228 psk:
7229 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
7230 psk_id: 456e6e796e20447572696e206172616e204d6f726961
7231 enc:
7232 d3805a97cbcd5f08babd21221d3e6b362a700572d14f9bbeb94ec078d051ae3d
7233 shared_secret:
7234 024573db58c887decb4c57b6ed39f2c9a09c85600a8a0ecb11cac24c6aaec195
7235 key_schedule_context: 01446fb1fe2632a0a338f0a85ed1f3a0ac475bdea2cd72
7236 f8c713b3a46ee737379a3f4c22aa6d9a0424c2b4292fdf43b8257df93c2f6adbf6dd
7237 c9c64fee26bdd292
7238 secret:
7239 638b94532e0d0bf812cf294f36b97a5bdcb0299df36e22b7bb6858e3c113080b
7240 key:
7241 base_nonce:
7242 exporter_secret:
7243 04261818aeae99d6aba5101bd35ddf3271d909a756adcef0d41389d9ed9ab153
7244 </pre><a href="#appendix-A.7.2-1" class="pilcrow">¶</a>
7245 </div>
7246 <div id="exported-values-25">
7247 <section id="appendix-A.7.2.1">
7248 <h5 id="name-exported-values-26">
7249 <a href="#appendix-A.7.2.1" class="section-number selfRef">A.7.2.1. </a><a href="#name-exported-values-26" class="section-name selfRef">Exported Values</a>
7250 </h5>
7251 <div id="appendix-A.7.2.1-1">
7252 <pre class="lang-test-vectors sourcecode">
7253 exporter_context:
7254 L: 32
7255 exported_value:
7256 be6c76955334376aa23e936be013ba8bbae90ae74ed995c1c6157e6f08dd5316
7257
7258 exporter_context: 00
7259 L: 32
7260 exported_value:
7261 1721ed2aa852f84d44ad020c2e2be4e2e6375098bf48775a533505fd56a3f416
7262
7263 exporter_context: 54657374436f6e74657874
7264 L: 32
7265 exported_value:
7266 7c9d79876a288507b81a5a52365a7d39cc0fa3f07e34172984f96fec07c44cba
7267 </pre><a href="#appendix-A.7.2.1-1" class="pilcrow">¶</a>
7268 </div>
7269 </section>
7270 </div>
7271 </section>
7272 </div>
7273 <div id="auth-setup-information-6">
7274 <section id="appendix-A.7.3">
7275 <h4 id="name-auth-setup-information-7">
7276 <a href="#appendix-A.7.3" class="section-number selfRef">A.7.3. </a><a href="#name-auth-setup-information-7" class="section-name selfRef">Auth Setup Information</a>
7277 </h4>
7278 <div id="appendix-A.7.3-1">
7279 <pre class="lang-test-vectors sourcecode">
7280 mode: 2
7281 kem_id: 32
7282 kdf_id: 1
7283 aead_id: 65535
7284 info: 4f6465206f6e2061204772656369616e2055726e
7285 ikmE:
7286 43b078912a54b591a7b09b16ce89a1955a9dd60b29fb611e044260046e8b061b
7287 pkEm:
7288 5ac1671a55c5c3875a8afe74664aa8bc68830be9ded0c5f633cd96400e8b5c05
7289 skEm:
7290 83d3f217071bbf600ba6f081f6e4005d27b97c8001f55cb5ff6ea3bbea1d9295
7291 ikmR:
7292 fc9407ae72ed614901ebf44257fb540f617284b5361cfecd620bafc4aba36f73
7293 pkRm:
7294 ffd7ac24694cb17939d95feb7c4c6539bb31621deb9b96d715a64abdd9d14b10
7295 skRm:
7296 ed88cda0e91ca5da64b6ad7fc34a10f096fa92f0b9ceff9d2c55124304ed8b4a
7297 ikmS:
7298 2ff4c37a17b2e54046a076bf5fea9c3d59250d54d0dc8572bc5f7c046307040c
7299 pkSm:
7300 89eb1feae431159a5250c5186f72a15962c8d0debd20a8389d8b6e4996e14306
7301 skSm:
7302 c85f136e06d72d28314f0e34b10aadc8d297e9d71d45a5662c2b7c3b9f9f9405
7303 enc:
7304 5ac1671a55c5c3875a8afe74664aa8bc68830be9ded0c5f633cd96400e8b5c05
7305 shared_secret:
7306 e204156fd17fd65b132d53a0558cd67b7c0d7095ee494b00f47d686eb78f8fb3
7307 key_schedule_context: 029bd09219212a8cf27c6bb5d54998c5240793a70ca0a8
7308 92234bd5e082bc619b6a3f4c22aa6d9a0424c2b4292fdf43b8257df93c2f6adbf6dd
7309 c9c64fee26bdd292
7310 secret:
7311 355e7ef17f438db43152b7fb45a0e2f49a8bf8956d5dddfec1758c0f0eb1b5d5
7312 key:
7313 base_nonce:
7314 exporter_secret:
7315 276d87e5cb0655c7d3dad95e76e6fc02746739eb9d968955ccf8a6346c97509e
7316 </pre><a href="#appendix-A.7.3-1" class="pilcrow">¶</a>
7317 </div>
7318 <div id="exported-values-26">
7319 <section id="appendix-A.7.3.1">
7320 <h5 id="name-exported-values-27">
7321 <a href="#appendix-A.7.3.1" class="section-number selfRef">A.7.3.1. </a><a href="#name-exported-values-27" class="section-name selfRef">Exported Values</a>
7322 </h5>
7323 <div id="appendix-A.7.3.1-1">
7324 <pre class="lang-test-vectors sourcecode">
7325 exporter_context:
7326 L: 32
7327 exported_value:
7328 83c1bac00a45ed4cb6bd8a6007d2ce4ec501f55e485c5642bd01bf6b6d7d6f0a
7329
7330 exporter_context: 00
7331 L: 32
7332 exported_value:
7333 08a1d1ad2af3ef5bc40232a64f920650eb9b1034fac3892f729f7949621bf06e
7334
7335 exporter_context: 54657374436f6e74657874
7336 L: 32
7337 exported_value:
7338 ff3b0e37a9954247fea53f251b799e2edd35aac7152c5795751a3da424feca73
7339 </pre><a href="#appendix-A.7.3.1-1" class="pilcrow">¶</a>
7340 </div>
7341 </section>
7342 </div>
7343 </section>
7344 </div>
7345 <div id="authpsk-setup-information-6">
7346 <section id="appendix-A.7.4">
7347 <h4 id="name-authpsk-setup-information-7">
7348 <a href="#appendix-A.7.4" class="section-number selfRef">A.7.4. </a><a href="#name-authpsk-setup-information-7" class="section-name selfRef">AuthPSK Setup Information</a>
7349 </h4>
7350 <div id="appendix-A.7.4-1">
7351 <pre class="lang-test-vectors sourcecode">
7352 mode: 3
7353 kem_id: 32
7354 kdf_id: 1
7355 aead_id: 65535
7356 info: 4f6465206f6e2061204772656369616e2055726e
7357 ikmE:
7358 94efae91e96811a3a49fd1b20eb0344d68ead6ac01922c2360779aa172487f40
7359 pkEm:
7360 81cbf4bd7eee97dd0b600252a1c964ea186846252abb340be47087cc78f3d87c
7361 skEm:
7362 a2b43f5c67d0d560ee04de0122c765ea5165e328410844db97f74595761bbb81
7363 ikmR:
7364 4dfde6fadfe5cb50fced4034e84e6d3a104aa4bf2971360032c1c0580e286663
7365 pkRm:
7366 f47cd9d6993d2e2234eb122b425accfb486ee80f89607b087094e9f413253c2d
7367 skRm:
7368 c4962a7f97d773a47bdf40db4b01dc6a56797c9e0deaab45f4ea3aa9b1d72904
7369 ikmS:
7370 26c12fef8d71d13bbbf08ce8157a283d5e67ecf0f345366b0e90341911110f1b
7371 pkSm:
7372 29a5bf3867a6128bbdf8e070abe7fe70ca5e07b629eba5819af73810ee20112f
7373 skSm:
7374 6175b2830c5743dff5b7568a7e20edb1fe477fb0487ca21d6433365be90234d0
7375 psk:
7376 0247fd33b913760fa1fa51e1892d9f307fbe65eb171e8132c2af18555a738b82
7377 psk_id: 456e6e796e20447572696e206172616e204d6f726961
7378 enc:
7379 81cbf4bd7eee97dd0b600252a1c964ea186846252abb340be47087cc78f3d87c
7380 shared_secret:
7381 d69246bcd767e579b1eec80956d7e7dfbd2902dad920556f0de69bd54054a2d1
7382 key_schedule_context: 03446fb1fe2632a0a338f0a85ed1f3a0ac475bdea2cd72
7383 f8c713b3a46ee737379a3f4c22aa6d9a0424c2b4292fdf43b8257df93c2f6adbf6dd
7384 c9c64fee26bdd292
7385 secret:
7386 c15c5bec374f2087c241d3533c6ec48e1c60a21dd00085619b2ffdd84a7918c3
7387 key:
7388 base_nonce:
7389 exporter_secret:
7390 695b1faa479c0e0518b6414c3b46e8ef5caea04c0a192246843765ae6a8a78e0
7391 </pre><a href="#appendix-A.7.4-1" class="pilcrow">¶</a>
7392 </div>
7393 <div id="exported-values-27">
7394 <section id="appendix-A.7.4.1">
7395 <h5 id="name-exported-values-28">
7396 <a href="#appendix-A.7.4.1" class="section-number selfRef">A.7.4.1. </a><a href="#name-exported-values-28" class="section-name selfRef">Exported Values</a>
7397 </h5>
7398 <div id="appendix-A.7.4.1-1">
7399 <pre class="lang-test-vectors sourcecode">
7400 exporter_context:
7401 L: 32
7402 exported_value:
7403 dafd8beb94c5802535c22ff4c1af8946c98df2c417e187c6ccafe45335810b58
7404
7405 exporter_context: 00
7406 L: 32
7407 exported_value:
7408 7346bb0b56caf457bcc1aa63c1b97d9834644bdacac8f72dbbe3463e4e46b0dd
7409
7410 exporter_context: 54657374436f6e74657874
7411 L: 32
7412 exported_value:
7413 84f3466bd5a03bde6444324e63d7560e7ac790da4e5bbab01e7c4d575728c34a
7414 </pre><a href="#appendix-A.7.4.1-1" class="pilcrow">¶</a>
7415 </div>
7416 </section>
7417 </div>
7418 </section>
7419 </div>
7420 </section>
7421 </div>
7422 </section>
7423 </div>
7424 <div id="acknowledgements">
7425 <section id="appendix-B">
7426 <h2 id="name-acknowledgements">
7427 <a href="#name-acknowledgements" class="section-name selfRef">Acknowledgements</a>
7428 </h2>
7429 <p id="appendix-B-1">The authors would like to thank
7430 <span class="contact-name">Joel Alwen</span>,
7431 <span class="contact-name">Jean-Philippe Aumasson</span>,
7432 <span class="contact-name">David Benjamin</span>,
7433 <span class="contact-name">Benjamin Beurdouche</span>,
7434 <span class="contact-name">Bruno Blanchet</span>,
7435 <span class="contact-name">Frank Denis</span>,
7436 <span class="contact-name">Stephen Farrell</span>,
7437 <span class="contact-name">Scott Fluhrer</span>,
7438 <span class="contact-name">Eduard Hauck</span>,
7439 <span class="contact-name">Scott Hollenbeck</span>,
7440 <span class="contact-name">Kevin Jacobs</span>,
7441 <span class="contact-name">Burt Kaliski</span>,
7442 <span class="contact-name">Eike Kiltz</span>,
7443 <span class="contact-name">Julia Len</span>,
7444 <span class="contact-name">John Mattsson</span>,
7445 <span class="contact-name">Christopher Patton</span>,
7446 <span class="contact-name">Doreen Riepel</span>,
7447 <span class="contact-name">Raphael Robert</span>,
7448 <span class="contact-name">Michael Rosenberg</span>,
7449 <span class="contact-name">Michael Scott</span>,
7450 <span class="contact-name">Martin Thomson</span>,
7451 <span class="contact-name">Steven Valdez</span>,
7452 <span class="contact-name">Riad Wahby</span>,
7453 and other contributors in the CFRG for helpful feedback that greatly improved this document.<a href="#appendix-B-1" class="pilcrow">¶</a></p>
7454 </section>
7455 </div>
7456 <div id="authors-addresses">
7457 <section id="appendix-C">
7458 <h2 id="name-authors-addresses">
7459 <a href="#name-authors-addresses" class="section-name selfRef">Authors' Addresses</a>
7460 </h2>
7461 <address class="vcard">
7462 <div dir="auto" class="left"><span class="fn nameRole">Richard L. Barnes</span></div>
7463 <div dir="auto" class="left"><span class="org">Cisco</span></div>
7464 <div class="email">
7465 <span>Email:</span>
7466 <a href="mailto:[email protected]" class="email">[email protected]</a>
7467 </div>
7468 </address>
7469 <address class="vcard">
7470 <div dir="auto" class="left"><span class="fn nameRole">Karthik Bhargavan</span></div>
7471 <div dir="auto" class="left"><span class="org">Inria</span></div>
7472 <div class="email">
7473 <span>Email:</span>
7474 <a href="mailto:[email protected]" class="email">[email protected]</a>
7475 </div>
7476 </address>
7477 <address class="vcard">
7478 <div dir="auto" class="left"><span class="fn nameRole">Benjamin Lipp</span></div>
7479 <div dir="auto" class="left"><span class="org">Inria</span></div>
7480 <div class="email">
7481 <span>Email:</span>
7482 <a href="mailto:[email protected]" class="email">[email protected]</a>
7483 </div>
7484 </address>
7485 <address class="vcard">
7486 <div dir="auto" class="left"><span class="fn nameRole">Christopher A. Wood</span></div>
7487 <div dir="auto" class="left"><span class="org">Cloudflare</span></div>
7488 <div class="email">
7489 <span>Email:</span>
7490 <a href="mailto:[email protected]" class="email">[email protected]</a>
7491 </div>
7492 </address>
7493 </section>
7494 </div>
7495 <script>const toc = document.getElementById("toc");
7496 toc.querySelector("h2").addEventListener("click", e => {
7497 toc.classList.toggle("active");
7498 });
7499 toc.querySelector("nav").addEventListener("click", e => {
7500 toc.classList.remove("active");
7501 });
7502 </script>
7503 </body>
7504 </html>