Debian Codegraph @

rfc8998.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 8998: ShangMi (SM) Cipher Suites for TLS 1.3</title>
8 <meta content="Paul Yang" name="author">
9 <meta content="
10 This document specifies how to use the ShangMi (SM) cryptographic
11 algorithms with Transport Layer Security (TLS) protocol version 1.3.
12 The use of these algorithms with TLS 1.3 is not endorsed by the
13 IETF. The SM algorithms are becoming mandatory in China, so
14 this document provides a description of how to use the SM algorithms
15 with TLS 1.3 and specifies a profile of TLS 1.3 so that
16 implementers can produce interworking
17 implementations.
18 " name="description">
19 <meta content="xml2rfc 3.5.0" name="generator">
20 <meta content="cryptography" name="keyword">
21 <meta content="encryption" name="keyword">
22 <meta content="authentication" name="keyword">
23 <meta content="network security" name="keyword">
24 <meta content="8998" name="rfc.number">
25 <!-- Generator version information:
26 xml2rfc 3.5.0
27 Python 3.6.10
28 appdirs 1.4.4
29 ConfigArgParse 1.2.3
30 google-i18n-address 2.3.5
31 html5lib 1.0.1
32 intervaltree 3.0.2
33 Jinja2 2.11.2
34 kitchen 1.2.6
35 lxml 4.4.2
36 pycairo 1.19.0
37 pycountry 19.8.18
38 pyflakes 2.1.1
39 PyYAML 5.3.1
40 requests 2.22.0
41 setuptools 40.6.2
42 six 1.14.0
43 WeasyPrint 51
44 -->
45 <link href="rfc8998.xml" rel="alternate" type="application/rfc+xml">
46 <link href="#copyright" rel="license">
47 <style type="text/css">/*
48
49 NOTE: Changes at the bottom of this file overrides some earlier settings.
50
51 Once the style has stabilized and has been adopted as an official RFC style,
52 this can be consolidated so that style settings occur only in one place, but
53 for now the contents of this file consists first of the initial CSS work as
54 provided to the RFC Formatter (xml2rfc) work, followed by itemized and
55 commented changes found necssary during the development of the v3
56 formatters.
57
58 */
59
60 /* fonts */
61 @import url('https://fonts.googleapis.com/css?family=Noto+Sans'); /* Sans-serif */
62 @import url('https://fonts.googleapis.com/css?family=Noto+Serif'); /* Serif (print) */
63 @import url('https://fonts.googleapis.com/css?family=Roboto+Mono'); /* Monospace */
64
65 @viewport {
66 zoom: 1.0;
67 width: extend-to-zoom;
68 }
69 @-ms-viewport {
70 width: extend-to-zoom;
71 zoom: 1.0;
72 }
73 /* general and mobile first */
74 html {
75 }
76 body {
77 max-width: 90%;
78 margin: 1.5em auto;
79 color: #222;
80 background-color: #fff;
81 font-size: 14px;
82 font-family: 'Noto Sans', Arial, Helvetica, sans-serif;
83 line-height: 1.6;
84 scroll-behavior: smooth;
85 }
86 .ears {
87 display: none;
88 }
89
90 /* headings */
91 #title, h1, h2, h3, h4, h5, h6 {
92 margin: 1em 0 0.5em;
93 font-weight: bold;
94 line-height: 1.3;
95 }
96 #title {
97 clear: both;
98 border-bottom: 1px solid #ddd;
99 margin: 0 0 0.5em 0;
100 padding: 1em 0 0.5em;
101 }
102 .author {
103 padding-bottom: 4px;
104 }
105 h1 {
106 font-size: 26px;
107 margin: 1em 0;
108 }
109 h2 {
110 font-size: 22px;
111 margin-top: -20px; /* provide offset for in-page anchors */
112 padding-top: 33px;
113 }
114 h3 {
115 font-size: 18px;
116 margin-top: -36px; /* provide offset for in-page anchors */
117 padding-top: 42px;
118 }
119 h4 {
120 font-size: 16px;
121 margin-top: -36px; /* provide offset for in-page anchors */
122 padding-top: 42px;
123 }
124 h5, h6 {
125 font-size: 14px;
126 }
127 #n-copyright-notice {
128 border-bottom: 1px solid #ddd;
129 padding-bottom: 1em;
130 margin-bottom: 1em;
131 }
132 /* general structure */
133 p {
134 padding: 0;
135 margin: 0 0 1em 0;
136 text-align: left;
137 }
138 div, span {
139 position: relative;
140 }
141 div {
142 margin: 0;
143 }
144 .alignRight.art-text {
145 background-color: #f9f9f9;
146 border: 1px solid #eee;
147 border-radius: 3px;
148 padding: 1em 1em 0;
149 margin-bottom: 1.5em;
150 }
151 .alignRight.art-text pre {
152 padding: 0;
153 }
154 .alignRight {
155 margin: 1em 0;
156 }
157 .alignRight > *:first-child {
158 border: none;
159 margin: 0;
160 float: right;
161 clear: both;
162 }
163 .alignRight > *:nth-child(2) {
164 clear: both;
165 display: block;
166 border: none;
167 }
168 svg {
169 display: block;
170 }
171 .alignCenter.art-text {
172 background-color: #f9f9f9;
173 border: 1px solid #eee;
174 border-radius: 3px;
175 padding: 1em 1em 0;
176 margin-bottom: 1.5em;
177 }
178 .alignCenter.art-text pre {
179 padding: 0;
180 }
181 .alignCenter {
182 margin: 1em 0;
183 }
184 .alignCenter > *:first-child {
185 border: none;
186 /* this isn't optimal, but it's an existence proof. PrinceXML doesn't
187 support flexbox yet.
188 */
189 display: table;
190 margin: 0 auto;
191 }
192
193 /* lists */
194 ol, ul {
195 padding: 0;
196 margin: 0 0 1em 2em;
197 }
198 ol ol, ul ul, ol ul, ul ol {
199 margin-left: 1em;
200 }
201 li {
202 margin: 0 0 0.25em 0;
203 }
204 .ulCompact li {
205 margin: 0;
206 }
207 ul.empty, .ulEmpty {
208 list-style-type: none;
209 }
210 ul.empty li, .ulEmpty li {
211 margin-top: 0.5em;
212 }
213 ul.compact, .ulCompact,
214 ol.compact, .olCompact {
215 line-height: 100%;
216 margin: 0 0 0 2em;
217 }
218
219 /* definition lists */
220 dl {
221 }
222 dl > dt {
223 float: left;
224 margin-right: 1em;
225 }
226 /*
227 dl.nohang > dt {
228 float: none;
229 }
230 */
231 dl > dd {
232 margin-bottom: .8em;
233 min-height: 1.3em;
234 }
235 dl.compact > dd, .dlCompact > dd {
236 margin-bottom: 0em;
237 }
238 dl > dd > dl {
239 margin-top: 0.5em;
240 margin-bottom: 0em;
241 }
242
243 /* links */
244 a {
245 text-decoration: none;
246 }
247 a[href] {
248 color: #22e; /* Arlen: WCAG 2019 */
249 }
250 a[href]:hover {
251 background-color: #f2f2f2;
252 }
253 figcaption a[href],
254 a[href].selfRef {
255 color: #222;
256 }
257 /* XXX probably not this:
258 a.selfRef:hover {
259 background-color: transparent;
260 cursor: default;
261 } */
262
263 /* Figures */
264 tt, code, pre, code {
265 background-color: #f9f9f9;
266 font-family: 'Roboto Mono', monospace;
267 }
268 pre {
269 border: 1px solid #eee;
270 margin: 0;
271 padding: 1em;
272 }
273 img {
274 max-width: 100%;
275 }
276 figure {
277 margin: 0;
278 }
279 figure blockquote {
280 margin: 0.8em 0.4em 0.4em;
281 }
282 figcaption {
283 font-style: italic;
284 margin: 0 0 1em 0;
285 }
286 @media screen {
287 pre {
288 overflow-x: auto;
289 max-width: 100%;
290 max-width: calc(100% - 22px);
291 }
292 }
293
294 /* aside, blockquote */
295 aside, blockquote {
296 margin-left: 0;
297 padding: 1.2em 2em;
298 }
299 blockquote {
300 background-color: #f9f9f9;
301 color: #111; /* Arlen: WCAG 2019 */
302 border: 1px solid #ddd;
303 border-radius: 3px;
304 margin: 1em 0;
305 }
306 cite {
307 display: block;
308 text-align: right;
309 font-style: italic;
310 }
311
312 /* tables */
313 table {
314 width: 100%;
315 margin: 0 0 1em;
316 border-collapse: collapse;
317 border: 1px solid #eee;
318 }
319 th, td {
320 text-align: left;
321 vertical-align: top;
322 padding: 0.5em 0.75em;
323 }
324 th {
325 text-align: left;
326 background-color: #e9e9e9;
327 }
328 tr:nth-child(2n+1) > td {
329 background-color: #f5f5f5;
330 }
331 table caption {
332 font-style: italic;
333 margin: 0;
334 padding: 0;
335 text-align: left;
336 }
337 table p {
338 /* XXX to avoid bottom margin on table row signifiers. If paragraphs should
339 be allowed within tables more generally, it would be far better to select on a class. */
340 margin: 0;
341 }
342
343 /* pilcrow */
344 a.pilcrow {
345 color: #666; /* Arlen: AHDJ 2019 */
346 text-decoration: none;
347 visibility: hidden;
348 user-select: none;
349 -ms-user-select: none;
350 -o-user-select:none;
351 -moz-user-select: none;
352 -khtml-user-select: none;
353 -webkit-user-select: none;
354 -webkit-touch-callout: none;
355 }
356 @media screen {
357 aside:hover > a.pilcrow,
358 p:hover > a.pilcrow,
359 blockquote:hover > a.pilcrow,
360 div:hover > a.pilcrow,
361 li:hover > a.pilcrow,
362 pre:hover > a.pilcrow {
363 visibility: visible;
364 }
365 a.pilcrow:hover {
366 background-color: transparent;
367 }
368 }
369
370 /* misc */
371 hr {
372 border: 0;
373 border-top: 1px solid #eee;
374 }
375 .bcp14 {
376 font-variant: small-caps;
377 }
378
379 .role {
380 font-variant: all-small-caps;
381 }
382
383 /* info block */
384 #identifiers {
385 margin: 0;
386 font-size: 0.9em;
387 }
388 #identifiers dt {
389 width: 3em;
390 clear: left;
391 }
392 #identifiers dd {
393 float: left;
394 margin-bottom: 0;
395 }
396 #identifiers .authors .author {
397 display: inline-block;
398 margin-right: 1.5em;
399 }
400 #identifiers .authors .org {
401 font-style: italic;
402 }
403
404 /* The prepared/rendered info at the very bottom of the page */
405 .docInfo {
406 color: #666; /* Arlen: WCAG 2019 */
407 font-size: 0.9em;
408 font-style: italic;
409 margin-top: 2em;
410 }
411 .docInfo .prepared {
412 float: left;
413 }
414 .docInfo .prepared {
415 float: right;
416 }
417
418 /* table of contents */
419 #toc {
420 padding: 0.75em 0 2em 0;
421 margin-bottom: 1em;
422 }
423 nav.toc ul {
424 margin: 0 0.5em 0 0;
425 padding: 0;
426 list-style: none;
427 }
428 nav.toc li {
429 line-height: 1.3em;
430 margin: 0.75em 0;
431 padding-left: 1.2em;
432 text-indent: -1.2em;
433 }
434 /* references */
435 .references dt {
436 text-align: right;
437 font-weight: bold;
438 min-width: 7em;
439 }
440 .references dd {
441 margin-left: 8em;
442 overflow: auto;
443 }
444
445 .refInstance {
446 margin-bottom: 1.25em;
447 }
448
449 .references .ascii {
450 margin-bottom: 0.25em;
451 }
452
453 /* index */
454 .index ul {
455 margin: 0 0 0 1em;
456 padding: 0;
457 list-style: none;
458 }
459 .index ul ul {
460 margin: 0;
461 }
462 .index li {
463 margin: 0;
464 text-indent: -2em;
465 padding-left: 2em;
466 padding-bottom: 5px;
467 }
468 .indexIndex {
469 margin: 0.5em 0 1em;
470 }
471 .index a {
472 font-weight: 700;
473 }
474 /* make the index two-column on all but the smallest screens */
475 @media (min-width: 600px) {
476 .index ul {
477 -moz-column-count: 2;
478 -moz-column-gap: 20px;
479 }
480 .index ul ul {
481 -moz-column-count: 1;
482 -moz-column-gap: 0;
483 }
484 }
485
486 /* authors */
487 address.vcard {
488 font-style: normal;
489 margin: 1em 0;
490 }
491
492 address.vcard .nameRole {
493 font-weight: 700;
494 margin-left: 0;
495 }
496 address.vcard .label {
497 font-family: "Noto Sans",Arial,Helvetica,sans-serif;
498 margin: 0.5em 0;
499 }
500 address.vcard .type {
501 display: none;
502 }
503 .alternative-contact {
504 margin: 1.5em 0 1em;
505 }
506 hr.addr {
507 border-top: 1px dashed;
508 margin: 0;
509 color: #ddd;
510 max-width: calc(100% - 16px);
511 }
512
513 /* temporary notes */
514 .rfcEditorRemove::before {
515 position: absolute;
516 top: 0.2em;
517 right: 0.2em;
518 padding: 0.2em;
519 content: "The RFC Editor will remove this note";
520 color: #9e2a00; /* Arlen: WCAG 2019 */
521 background-color: #ffd; /* Arlen: WCAG 2019 */
522 }
523 .rfcEditorRemove {
524 position: relative;
525 padding-top: 1.8em;
526 background-color: #ffd; /* Arlen: WCAG 2019 */
527 border-radius: 3px;
528 }
529 .cref {
530 background-color: #ffd; /* Arlen: WCAG 2019 */
531 padding: 2px 4px;
532 }
533 .crefSource {
534 font-style: italic;
535 }
536 /* alternative layout for smaller screens */
537 @media screen and (max-width: 1023px) {
538 body {
539 padding-top: 2em;
540 }
541 #title {
542 padding: 1em 0;
543 }
544 h1 {
545 font-size: 24px;
546 }
547 h2 {
548 font-size: 20px;
549 margin-top: -18px; /* provide offset for in-page anchors */
550 padding-top: 38px;
551 }
552 #identifiers dd {
553 max-width: 60%;
554 }
555 #toc {
556 position: fixed;
557 z-index: 2;
558 top: 0;
559 right: 0;
560 padding: 0;
561 margin: 0;
562 background-color: inherit;
563 border-bottom: 1px solid #ccc;
564 }
565 #toc h2 {
566 margin: -1px 0 0 0;
567 padding: 4px 0 4px 6px;
568 padding-right: 1em;
569 min-width: 190px;
570 font-size: 1.1em;
571 text-align: right;
572 background-color: #444;
573 color: white;
574 cursor: pointer;
575 }
576 #toc h2::before { /* css hamburger */
577 float: right;
578 position: relative;
579 width: 1em;
580 height: 1px;
581 left: -164px;
582 margin: 6px 0 0 0;
583 background: white none repeat scroll 0 0;
584 box-shadow: 0 4px 0 0 white, 0 8px 0 0 white;
585 content: "";
586 }
587 #toc nav {
588 display: none;
589 padding: 0.5em 1em 1em;
590 overflow: auto;
591 height: calc(100vh - 48px);
592 border-left: 1px solid #ddd;
593 }
594 }
595
596 /* alternative layout for wide screens */
597 @media screen and (min-width: 1024px) {
598 body {
599 max-width: 724px;
600 margin: 42px auto;
601 padding-left: 1.5em;
602 padding-right: 29em;
603 }
604 #toc {
605 position: fixed;
606 top: 42px;
607 right: 42px;
608 width: 25%;
609 margin: 0;
610 padding: 0 1em;
611 z-index: 1;
612 }
613 #toc h2 {
614 border-top: none;
615 border-bottom: 1px solid #ddd;
616 font-size: 1em;
617 font-weight: normal;
618 margin: 0;
619 padding: 0.25em 1em 1em 0;
620 }
621 #toc nav {
622 display: block;
623 height: calc(90vh - 84px);
624 bottom: 0;
625 padding: 0.5em 0 0;
626 overflow: auto;
627 }
628 img { /* future proofing */
629 max-width: 100%;
630 height: auto;
631 }
632 }
633
634 /* pagination */
635 @media print {
636 body {
637
638 width: 100%;
639 }
640 p {
641 orphans: 3;
642 widows: 3;
643 }
644 #n-copyright-notice {
645 border-bottom: none;
646 }
647 #toc, #n-introduction {
648 page-break-before: always;
649 }
650 #toc {
651 border-top: none;
652 padding-top: 0;
653 }
654 figure, pre {
655 page-break-inside: avoid;
656 }
657 figure {
658 overflow: scroll;
659 }
660 h1, h2, h3, h4, h5, h6 {
661 page-break-after: avoid;
662 }
663 h2+*, h3+*, h4+*, h5+*, h6+* {
664 page-break-before: avoid;
665 }
666 pre {
667 white-space: pre-wrap;
668 word-wrap: break-word;
669 font-size: 10pt;
670 }
671 table {
672 border: 1px solid #ddd;
673 }
674 td {
675 border-top: 1px solid #ddd;
676 }
677 }
678
679 /* This is commented out here, as the string-set: doesn't
680 pass W3C validation currently */
681 /*
682 .ears thead .left {
683 string-set: ears-top-left content();
684 }
685
686 .ears thead .center {
687 string-set: ears-top-center content();
688 }
689
690 .ears thead .right {
691 string-set: ears-top-right content();
692 }
693
694 .ears tfoot .left {
695 string-set: ears-bottom-left content();
696 }
697
698 .ears tfoot .center {
699 string-set: ears-bottom-center content();
700 }
701
702 .ears tfoot .right {
703 string-set: ears-bottom-right content();
704 }
705 */
706
707 @page :first {
708 padding-top: 0;
709 @top-left {
710 content: normal;
711 border: none;
712 }
713 @top-center {
714 content: normal;
715 border: none;
716 }
717 @top-right {
718 content: normal;
719 border: none;
720 }
721 }
722
723 @page {
724 size: A4;
725 margin-bottom: 45mm;
726 padding-top: 20px;
727 /* The follwing is commented out here, but set appropriately by in code, as
728 the content depends on the document */
729 /*
730 @top-left {
731 content: 'Internet-Draft';
732 vertical-align: bottom;
733 border-bottom: solid 1px #ccc;
734 }
735 @top-left {
736 content: string(ears-top-left);
737 vertical-align: bottom;
738 border-bottom: solid 1px #ccc;
739 }
740 @top-center {
741 content: string(ears-top-center);
742 vertical-align: bottom;
743 border-bottom: solid 1px #ccc;
744 }
745 @top-right {
746 content: string(ears-top-right);
747 vertical-align: bottom;
748 border-bottom: solid 1px #ccc;
749 }
750 @bottom-left {
751 content: string(ears-bottom-left);
752 vertical-align: top;
753 border-top: solid 1px #ccc;
754 }
755 @bottom-center {
756 content: string(ears-bottom-center);
757 vertical-align: top;
758 border-top: solid 1px #ccc;
759 }
760 @bottom-right {
761 content: '[Page ' counter(page) ']';
762 vertical-align: top;
763 border-top: solid 1px #ccc;
764 }
765 */
766
767 }
768
769 /* Changes introduced to fix issues found during implementation */
770 /* Make sure links are clickable even if overlapped by following H* */
771 a {
772 z-index: 2;
773 }
774 /* Separate body from document info even without intervening H1 */
775 section {
776 clear: both;
777 }
778
779
780 /* Top align author divs, to avoid names without organization dropping level with org names */
781 .author {
782 vertical-align: top;
783 }
784
785 /* Leave room in document info to show Internet-Draft on one line */
786 #identifiers dt {
787 width: 8em;
788 }
789
790 /* Don't waste quite as much whitespace between label and value in doc info */
791 #identifiers dd {
792 margin-left: 1em;
793 }
794
795 /* Give floating toc a background color (needed when it's a div inside section */
796 #toc {
797 background-color: white;
798 }
799
800 /* Make the collapsed ToC header render white on gray also when it's a link */
801 @media screen and (max-width: 1023px) {
802 #toc h2 a,
803 #toc h2 a:link,
804 #toc h2 a:focus,
805 #toc h2 a:hover,
806 #toc a.toplink,
807 #toc a.toplink:hover {
808 color: white;
809 background-color: #444;
810 text-decoration: none;
811 }
812 }
813
814 /* Give the bottom of the ToC some whitespace */
815 @media screen and (min-width: 1024px) {
816 #toc {
817 padding: 0 0 1em 1em;
818 }
819 }
820
821 /* Style section numbers with more space between number and title */
822 .section-number {
823 padding-right: 0.5em;
824 }
825
826 /* prevent monospace from becoming overly large */
827 tt, code, pre, code {
828 font-size: 95%;
829 }
830
831 /* Fix the height/width aspect for ascii art*/
832 pre.sourcecode,
833 .art-text pre {
834 line-height: 1.12;
835 }
836
837
838 /* Add styling for a link in the ToC that points to the top of the document */
839 a.toplink {
840 float: right;
841 margin-right: 0.5em;
842 }
843
844 /* Fix the dl styling to match the RFC 7992 attributes */
845 dl > dt,
846 dl.dlParallel > dt {
847 float: left;
848 margin-right: 1em;
849 }
850 dl.dlNewline > dt {
851 float: none;
852 }
853
854 /* Provide styling for table cell text alignment */
855 table td.text-left,
856 table th.text-left {
857 text-align: left;
858 }
859 table td.text-center,
860 table th.text-center {
861 text-align: center;
862 }
863 table td.text-right,
864 table th.text-right {
865 text-align: right;
866 }
867
868 /* Make the alternative author contact informatio look less like just another
869 author, and group it closer with the primary author contact information */
870 .alternative-contact {
871 margin: 0.5em 0 0.25em 0;
872 }
873 address .non-ascii {
874 margin: 0 0 0 2em;
875 }
876
877 /* With it being possible to set tables with alignment
878 left, center, and right, { width: 100%; } does not make sense */
879 table {
880 width: auto;
881 }
882
883 /* Avoid reference text that sits in a block with very wide left margin,
884 because of a long floating dt label.*/
885 .references dd {
886 overflow: visible;
887 }
888
889 /* Control caption placement */
890 caption {
891 caption-side: bottom;
892 }
893
894 /* Limit the width of the author address vcard, so names in right-to-left
895 script don't end up on the other side of the page. */
896
897 address.vcard {
898 max-width: 30em;
899 margin-right: auto;
900 }
901
902 /* For address alignment dependent on LTR or RTL scripts */
903 address div.left {
904 text-align: left;
905 }
906 address div.right {
907 text-align: right;
908 }
909
910 /* Provide table alignment support. We can't use the alignX classes above
911 since they do unwanted things with caption and other styling. */
912 table.right {
913 margin-left: auto;
914 margin-right: 0;
915 }
916 table.center {
917 margin-left: auto;
918 margin-right: auto;
919 }
920 table.left {
921 margin-left: 0;
922 margin-right: auto;
923 }
924
925 /* Give the table caption label the same styling as the figcaption */
926 caption a[href] {
927 color: #222;
928 }
929
930 @media print {
931 .toplink {
932 display: none;
933 }
934
935 /* avoid overwriting the top border line with the ToC header */
936 #toc {
937 padding-top: 1px;
938 }
939
940 /* Avoid page breaks inside dl and author address entries */
941 .vcard {
942 page-break-inside: avoid;
943 }
944
945 }
946 /* Tweak the bcp14 keyword presentation */
947 .bcp14 {
948 font-variant: small-caps;
949 font-weight: bold;
950 font-size: 0.9em;
951 }
952 /* Tweak the invisible space above H* in order not to overlay links in text above */
953 h2 {
954 margin-top: -18px; /* provide offset for in-page anchors */
955 padding-top: 31px;
956 }
957 h3 {
958 margin-top: -18px; /* provide offset for in-page anchors */
959 padding-top: 24px;
960 }
961 h4 {
962 margin-top: -18px; /* provide offset for in-page anchors */
963 padding-top: 24px;
964 }
965 /* Float artwork pilcrow to the right */
966 @media screen {
967 .artwork a.pilcrow {
968 display: block;
969 line-height: 0.7;
970 margin-top: 0.15em;
971 }
972 }
973 /* Make pilcrows on dd visible */
974 @media screen {
975 dd:hover > a.pilcrow {
976 visibility: visible;
977 }
978 }
979 /* Make the placement of figcaption match that of a table's caption
980 by removing the figure's added bottom margin */
981 .alignLeft.art-text,
982 .alignCenter.art-text,
983 .alignRight.art-text {
984 margin-bottom: 0;
985 }
986 .alignLeft,
987 .alignCenter,
988 .alignRight {
989 margin: 1em 0 0 0;
990 }
991 /* In print, the pilcrow won't show on hover, so prevent it from taking up space,
992 possibly even requiring a new line */
993 @media print {
994 a.pilcrow {
995 display: none;
996 }
997 }
998 /* Styling for the external metadata */
999 div#external-metadata {
1000 background-color: #eee;
1001 padding: 0.5em;
1002 margin-bottom: 0.5em;
1003 display: none;
1004 }
1005 div#internal-metadata {
1006 padding: 0.5em; /* to match the external-metadata padding */
1007 }
1008 /* Styling for title RFC Number */
1009 h1#rfcnum {
1010 clear: both;
1011 margin: 0 0 -1em;
1012 padding: 1em 0 0 0;
1013 }
1014 /* Make .olPercent look the same as <ol><li> */
1015 dl.olPercent > dd {
1016 margin-bottom: 0.25em;
1017 min-height: initial;
1018 }
1019 /* Give aside some styling to set it apart */
1020 aside {
1021 border-left: 1px solid #ddd;
1022 margin: 1em 0 1em 2em;
1023 padding: 0.2em 2em;
1024 }
1025 aside > dl,
1026 aside > ol,
1027 aside > ul,
1028 aside > table,
1029 aside > p {
1030 margin-bottom: 0.5em;
1031 }
1032 /* Additional page break settings */
1033 @media print {
1034 figcaption, table caption {
1035 page-break-before: avoid;
1036 }
1037 }
1038 /* Font size adjustments for print */
1039 @media print {
1040 body { font-size: 10pt; line-height: normal; max-width: 96%; }
1041 h1 { font-size: 1.72em; padding-top: 1.5em; } /* 1*1.2*1.2*1.2 */
1042 h2 { font-size: 1.44em; padding-top: 1.5em; } /* 1*1.2*1.2 */
1043 h3 { font-size: 1.2em; padding-top: 1.5em; } /* 1*1.2 */
1044 h4 { font-size: 1em; padding-top: 1.5em; }
1045 h5, h6 { font-size: 1em; margin: initial; padding: 0.5em 0 0.3em; }
1046 }
1047 /* Sourcecode margin in print, when there's no pilcrow */
1048 @media print {
1049 .artwork,
1050 .sourcecode {
1051 margin-bottom: 1em;
1052 }
1053 }
1054 /* Avoid narrow tables forcing too narrow table captions, which may render badly */
1055 table {
1056 min-width: 20em;
1057 }
1058 /* ol type a */
1059 ol.type-a { list-style-type: lower-alpha; }
1060 ol.type-A { list-style-type: upper-alpha; }
1061 ol.type-i { list-style-type: lower-roman; }
1062 ol.type-I { list-style-type: lower-roman; }
1063 /* Apply the print table and row borders in general, on request from the RPC,
1064 and increase the contrast between border and odd row background sligthtly */
1065 table {
1066 border: 1px solid #ddd;
1067 }
1068 td {
1069 border-top: 1px solid #ddd;
1070 }
1071 tr:nth-child(2n+1) > td {
1072 background-color: #f8f8f8;
1073 }
1074 /* Use style rules to govern display of the TOC. */
1075 @media screen and (max-width: 1023px) {
1076 #toc nav { display: none; }
1077 #toc.active nav { display: block; }
1078 }
1079 /* Add support for keepWithNext */
1080 .keepWithNext {
1081 break-after: avoid-page;
1082 break-after: avoid-page;
1083 }
1084 /* Add support for keepWithPrevious */
1085 .keepWithPrevious {
1086 break-before: avoid-page;
1087 }
1088 /* Change the approach to avoiding breaks inside artwork etc. */
1089 figure, pre, table, .artwork, .sourcecode {
1090 break-before: avoid-page;
1091 break-after: auto;
1092 }
1093 /* Avoid breaks between <dt> and <dd> */
1094 dl {
1095 break-before: auto;
1096 break-inside: auto;
1097 }
1098 dt {
1099 break-before: auto;
1100 break-after: avoid-page;
1101 }
1102 dd {
1103 break-before: avoid-page;
1104 break-after: auto;
1105 orphans: 3;
1106 widows: 3
1107 }
1108 span.break, dd.break {
1109 margin-bottom: 0;
1110 min-height: 0;
1111 break-before: auto;
1112 break-inside: auto;
1113 break-after: auto;
1114 }
1115 /* Undo break-before ToC */
1116 @media print {
1117 #toc {
1118 break-before: auto;
1119 }
1120 }
1121 /* Text in compact lists should not get extra bottim margin space,
1122 since that would makes the list not compact */
1123 ul.compact p, .ulCompact p,
1124 ol.compact p, .olCompact p {
1125 margin: 0;
1126 }
1127 /* But the list as a whole needs the extra space at the end */
1128 section ul.compact,
1129 section .ulCompact,
1130 section ol.compact,
1131 section .olCompact {
1132 margin-bottom: 1em; /* same as p not within ul.compact etc. */
1133 }
1134 /* The tt and code background above interferes with for instance table cell
1135 backgrounds. Changed to something a bit more selective. */
1136 tt, code {
1137 background-color: transparent;
1138 }
1139 p tt, p code, li tt, li code {
1140 background-color: #f8f8f8;
1141 }
1142 /* Tweak the pre margin -- 0px doesn't come out well */
1143 pre {
1144 margin-top: 0.5px;
1145 }
1146 /* Tweak the comact list text */
1147 ul.compact, .ulCompact,
1148 ol.compact, .olCompact,
1149 dl.compact, .dlCompact {
1150 line-height: normal;
1151 }
1152 /* Don't add top margin for nested lists */
1153 li > ul, li > ol, li > dl,
1154 dd > ul, dd > ol, dd > dl,
1155 dl > dd > dl {
1156 margin-top: initial;
1157 }
1158 /* Elements that should not be rendered on the same line as a <dt> */
1159 /* This should match the element list in writer.text.TextWriter.render_dl() */
1160 dd > div.artwork:first-child,
1161 dd > aside:first-child,
1162 dd > figure:first-child,
1163 dd > ol:first-child,
1164 dd > div:first-child > pre.sourcecode,
1165 dd > table:first-child,
1166 dd > ul:first-child {
1167 clear: left;
1168 }
1169 /* fix for weird browser behaviour when <dd/> is empty */
1170 dt+dd:empty::before{
1171 content: "\00a0";
1172 }
1173 </style>
1174 <link href="rfc-local.css" rel="stylesheet" type="text/css">
1175 <link href="https://dx.doi.org/10.17487/rfc8998" rel="alternate">
1176 <link href="urn:issn:2070-1721" rel="alternate">
1177 <link href="https://datatracker.ietf.org/doc/draft-yang-tls-tls13-sm-suites-06" rel="prev">
1178 </head>
1179 <body>
1180 <script src="https://www.rfc-editor.org/js/metadata.min.js"></script>
1181 <table class="ears">
1182 <thead><tr>
1183 <td class="left">RFC 8998</td>
1184 <td class="center">SM Cipher Suites for TLS 1.3</td>
1185 <td class="right">March 2021</td>
1186 </tr></thead>
1187 <tfoot><tr>
1188 <td class="left">Yang</td>
1189 <td class="center">Informational</td>
1190 <td class="right">[Page]</td>
1191 </tr></tfoot>
1192 </table>
1193 <div id="external-metadata" class="document-information"></div>
1194 <div id="internal-metadata" class="document-information">
1195 <dl id="identifiers">
1196 <dt class="label-stream">Stream:</dt>
1197 <dd class="stream">Independent Submission</dd>
1198 <dt class="label-rfc">RFC:</dt>
1199 <dd class="rfc"><a href="https://www.rfc-editor.org/rfc/rfc8998" class="eref">8998</a></dd>
1200 <dt class="label-category">Category:</dt>
1201 <dd class="category">Informational</dd>
1202 <dt class="label-published">Published:</dt>
1203 <dd class="published">
1204 <time datetime="2021-03" class="published">March 2021</time>
1205 </dd>
1206 <dt class="label-issn">ISSN:</dt>
1207 <dd class="issn">2070-1721</dd>
1208 <dt class="label-authors">Author:</dt>
1209 <dd class="authors">
1210 <div class="author">
1211 <div class="author-name">P. Yang</div>
1212 <div class="org">Ant Group</div>
1213 </div>
1214 </dd>
1215 </dl>
1216 </div>
1217 <h1 id="rfcnum">RFC 8998</h1>
1218 <h1 id="title">ShangMi (SM) Cipher Suites for TLS 1.3</h1>
1219 <section id="section-abstract">
1220 <h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
1221 <p id="section-abstract-1">This document specifies how to use the ShangMi (SM) cryptographic
1222 algorithms with Transport Layer Security (TLS) protocol version 1.3.<a href="#section-abstract-1" class="pilcrow">¶</a></p>
1223 <p id="section-abstract-2">The use of these algorithms with TLS 1.3 is not endorsed by the
1224 IETF. The SM algorithms are becoming mandatory in China, so
1225 this document provides a description of how to use the SM algorithms
1226 with TLS 1.3 and specifies a profile of TLS 1.3 so that
1227 implementers can produce interworking
1228 implementations.<a href="#section-abstract-2" class="pilcrow">¶</a></p>
1229 </section>
1230 <div id="status-of-memo">
1231 <section id="section-boilerplate.1">
1232 <h2 id="name-status-of-this-memo">
1233 <a href="#name-status-of-this-memo" class="section-name selfRef">Status of This Memo</a>
1234 </h2>
1235 <p id="section-boilerplate.1-1">
1236 This document is not an Internet Standards Track specification; it is
1237 published for informational purposes.<a href="#section-boilerplate.1-1" class="pilcrow">¶</a></p>
1238 <p id="section-boilerplate.1-2">
1239 This is a contribution to the RFC Series, independently of any
1240 other RFC stream. The RFC Editor has chosen to publish this
1241 document at its discretion and makes no statement about its value
1242 for implementation or deployment. Documents approved for
1243 publication by the RFC Editor are not candidates for any level of
1244 Internet Standard; see Section 2 of RFC 7841.<a href="#section-boilerplate.1-2" class="pilcrow">¶</a></p>
1245 <p id="section-boilerplate.1-3">
1246 Information about the current status of this document, any
1247 errata, and how to provide feedback on it may be obtained at
1248 <span><a href="https://www.rfc-editor.org/info/rfc8998">https://www.rfc-editor.org/info/rfc8998</a></span>.<a href="#section-boilerplate.1-3" class="pilcrow">¶</a></p>
1249 </section>
1250 </div>
1251 <div id="copyright">
1252 <section id="section-boilerplate.2">
1253 <h2 id="name-copyright-notice">
1254 <a href="#name-copyright-notice" class="section-name selfRef">Copyright Notice</a>
1255 </h2>
1256 <p id="section-boilerplate.2-1">
1257 Copyright (c) 2021 IETF Trust and the persons identified as the
1258 document authors. All rights reserved.<a href="#section-boilerplate.2-1" class="pilcrow">¶</a></p>
1259 <p id="section-boilerplate.2-2">
1260 This document is subject to BCP 78 and the IETF Trust's Legal
1261 Provisions Relating to IETF Documents
1262 (<span><a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a></span>) in effect on the date of
1263 publication of this document. Please review these documents
1264 carefully, as they describe your rights and restrictions with
1265 respect to this document.<a href="#section-boilerplate.2-2" class="pilcrow">¶</a></p>
1266 </section>
1267 </div>
1268 <div id="toc">
1269 <section id="section-toc.1">
1270 <a href="#" onclick="scroll(0,0)" class="toplink">▲</a><h2 id="name-table-of-contents">
1271 <a href="#name-table-of-contents" class="section-name selfRef">Table of Contents</a>
1272 </h2>
1273 <nav class="toc"><ul class="compact toc ulEmpty">
1274 <li class="compact toc ulEmpty" id="section-toc.1-1.1">
1275 <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><a href="#section-toc.1-1.1.1" class="pilcrow">¶</a></p>
1276 <ul class="compact toc ulEmpty">
1277 <li class="compact toc ulEmpty" id="section-toc.1-1.1.2.1">
1278 <p id="section-toc.1-1.1.2.1.1" class="keepWithNext"><a href="#section-1.1" class="xref">1.1</a>.  <a href="#name-the-sm-algorithms" class="xref">The SM Algorithms</a><a href="#section-toc.1-1.1.2.1.1" class="pilcrow">¶</a></p>
1279 </li>
1280 <li class="compact toc ulEmpty" id="section-toc.1-1.1.2.2">
1281 <p id="section-toc.1-1.1.2.2.1" class="keepWithNext"><a href="#section-1.2" class="xref">1.2</a>.  <a href="#name-terminology" class="xref">Terminology</a><a href="#section-toc.1-1.1.2.2.1" class="pilcrow">¶</a></p>
1282 </li>
1283 </ul>
1284 </li>
1285 <li class="compact toc ulEmpty" id="section-toc.1-1.2">
1286 <p id="section-toc.1-1.2.1"><a href="#section-2" class="xref">2</a>.  <a href="#name-algorithm-identifiers" class="xref">Algorithm Identifiers</a><a href="#section-toc.1-1.2.1" class="pilcrow">¶</a></p>
1287 </li>
1288 <li class="compact toc ulEmpty" id="section-toc.1-1.3">
1289 <p id="section-toc.1-1.3.1"><a href="#section-3" class="xref">3</a>.  <a href="#name-algorithm-definitions" class="xref">Algorithm Definitions</a><a href="#section-toc.1-1.3.1" class="pilcrow">¶</a></p>
1290 <ul class="compact toc ulEmpty">
1291 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.1">
1292 <p id="section-toc.1-1.3.2.1.1"><a href="#section-3.1" class="xref">3.1</a>.  <a href="#name-tls-versions" class="xref">TLS Versions</a><a href="#section-toc.1-1.3.2.1.1" class="pilcrow">¶</a></p>
1293 </li>
1294 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.2">
1295 <p id="section-toc.1-1.3.2.2.1"><a href="#section-3.2" class="xref">3.2</a>.  <a href="#name-authentication" class="xref">Authentication</a><a href="#section-toc.1-1.3.2.2.1" class="pilcrow">¶</a></p>
1296 <ul class="compact toc ulEmpty">
1297 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.2.2.1">
1298 <p id="section-toc.1-1.3.2.2.2.1.1"><a href="#section-3.2.1" class="xref">3.2.1</a>.  <a href="#name-sm2-signature-scheme" class="xref">SM2 Signature Scheme</a><a href="#section-toc.1-1.3.2.2.2.1.1" class="pilcrow">¶</a></p>
1299 </li>
1300 </ul>
1301 </li>
1302 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3">
1303 <p id="section-toc.1-1.3.2.3.1"><a href="#section-3.3" class="xref">3.3</a>.  <a href="#name-key-exchange" class="xref">Key Exchange</a><a href="#section-toc.1-1.3.2.3.1" class="pilcrow">¶</a></p>
1304 <ul class="compact toc ulEmpty">
1305 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.1">
1306 <p id="section-toc.1-1.3.2.3.2.1.1"><a href="#section-3.3.1" class="xref">3.3.1</a>.  <a href="#name-hello-messages" class="xref">Hello Messages</a><a href="#section-toc.1-1.3.2.3.2.1.1" class="pilcrow">¶</a></p>
1307 </li>
1308 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.2">
1309 <p id="section-toc.1-1.3.2.3.2.2.1"><a href="#section-3.3.2" class="xref">3.3.2</a>.  <a href="#name-certificaterequest" class="xref">CertificateRequest</a><a href="#section-toc.1-1.3.2.3.2.2.1" class="pilcrow">¶</a></p>
1310 </li>
1311 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.3">
1312 <p id="section-toc.1-1.3.2.3.2.3.1"><a href="#section-3.3.3" class="xref">3.3.3</a>.  <a href="#name-certificate" class="xref">Certificate</a><a href="#section-toc.1-1.3.2.3.2.3.1" class="pilcrow">¶</a></p>
1313 </li>
1314 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.3.2.4">
1315 <p id="section-toc.1-1.3.2.3.2.4.1"><a href="#section-3.3.4" class="xref">3.3.4</a>.  <a href="#name-certificateverify" class="xref">CertificateVerify</a><a href="#section-toc.1-1.3.2.3.2.4.1" class="pilcrow">¶</a></p>
1316 </li>
1317 </ul>
1318 </li>
1319 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.4">
1320 <p id="section-toc.1-1.3.2.4.1"><a href="#section-3.4" class="xref">3.4</a>.  <a href="#name-key-scheduling" class="xref">Key Scheduling</a><a href="#section-toc.1-1.3.2.4.1" class="pilcrow">¶</a></p>
1321 </li>
1322 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.5">
1323 <p id="section-toc.1-1.3.2.5.1"><a href="#section-3.5" class="xref">3.5</a>.  <a href="#name-cipher" class="xref">Cipher</a><a href="#section-toc.1-1.3.2.5.1" class="pilcrow">¶</a></p>
1324 <ul class="compact toc ulEmpty">
1325 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.5.2.1">
1326 <p id="section-toc.1-1.3.2.5.2.1.1"><a href="#section-3.5.1" class="xref">3.5.1</a>.  <a href="#name-aead_sm4_gcm" class="xref">AEAD_SM4_GCM</a><a href="#section-toc.1-1.3.2.5.2.1.1" class="pilcrow">¶</a></p>
1327 </li>
1328 <li class="compact toc ulEmpty" id="section-toc.1-1.3.2.5.2.2">
1329 <p id="section-toc.1-1.3.2.5.2.2.1"><a href="#section-3.5.2" class="xref">3.5.2</a>.  <a href="#name-aead_sm4_ccm" class="xref">AEAD_SM4_CCM</a><a href="#section-toc.1-1.3.2.5.2.2.1" class="pilcrow">¶</a></p>
1330 </li>
1331 </ul>
1332 </li>
1333 </ul>
1334 </li>
1335 <li class="compact toc ulEmpty" id="section-toc.1-1.4">
1336 <p id="section-toc.1-1.4.1"><a href="#section-4" class="xref">4</a>.  <a href="#name-iana-considerations" class="xref">IANA Considerations</a><a href="#section-toc.1-1.4.1" class="pilcrow">¶</a></p>
1337 </li>
1338 <li class="compact toc ulEmpty" id="section-toc.1-1.5">
1339 <p id="section-toc.1-1.5.1"><a href="#section-5" class="xref">5</a>.  <a href="#name-security-considerations" class="xref">Security Considerations</a><a href="#section-toc.1-1.5.1" class="pilcrow">¶</a></p>
1340 </li>
1341 <li class="compact toc ulEmpty" id="section-toc.1-1.6">
1342 <p id="section-toc.1-1.6.1"><a href="#section-6" class="xref">6</a>.  <a href="#name-references" class="xref">References</a><a href="#section-toc.1-1.6.1" class="pilcrow">¶</a></p>
1343 <ul class="compact toc ulEmpty">
1344 <li class="compact toc ulEmpty" id="section-toc.1-1.6.2.1">
1345 <p id="section-toc.1-1.6.2.1.1"><a href="#section-6.1" class="xref">6.1</a>.  <a href="#name-normative-references" class="xref">Normative References</a><a href="#section-toc.1-1.6.2.1.1" class="pilcrow">¶</a></p>
1346 </li>
1347 <li class="compact toc ulEmpty" id="section-toc.1-1.6.2.2">
1348 <p id="section-toc.1-1.6.2.2.1"><a href="#section-6.2" class="xref">6.2</a>.  <a href="#name-informative-references" class="xref">Informative References</a><a href="#section-toc.1-1.6.2.2.1" class="pilcrow">¶</a></p>
1349 </li>
1350 </ul>
1351 </li>
1352 <li class="compact toc ulEmpty" id="section-toc.1-1.7">
1353 <p id="section-toc.1-1.7.1"><a href="#section-appendix.a" class="xref">Appendix A</a>.  <a href="#name-test-vectors" class="xref">Test Vectors</a><a href="#section-toc.1-1.7.1" class="pilcrow">¶</a></p>
1354 <ul class="compact toc ulEmpty">
1355 <li class="compact toc ulEmpty" id="section-toc.1-1.7.2.1">
1356 <p id="section-toc.1-1.7.2.1.1"><a href="#section-a.1" class="xref">A.1</a>.  <a href="#name-sm4-gcm-test-vectors" class="xref">SM4-GCM Test Vectors</a><a href="#section-toc.1-1.7.2.1.1" class="pilcrow">¶</a></p>
1357 </li>
1358 <li class="compact toc ulEmpty" id="section-toc.1-1.7.2.2">
1359 <p id="section-toc.1-1.7.2.2.1"><a href="#section-a.2" class="xref">A.2</a>.  <a href="#name-sm4-ccm-test-vectors" class="xref">SM4-CCM Test Vectors</a><a href="#section-toc.1-1.7.2.2.1" class="pilcrow">¶</a></p>
1360 </li>
1361 </ul>
1362 </li>
1363 <li class="compact toc ulEmpty" id="section-toc.1-1.8">
1364 <p id="section-toc.1-1.8.1"><a href="#section-appendix.b" class="xref"></a><a href="#name-contributors" class="xref">Contributors</a><a href="#section-toc.1-1.8.1" class="pilcrow">¶</a></p>
1365 </li>
1366 <li class="compact toc ulEmpty" id="section-toc.1-1.9">
1367 <p id="section-toc.1-1.9.1"><a href="#section-appendix.c" class="xref"></a><a href="#name-authors-address" class="xref">Author's Address</a><a href="#section-toc.1-1.9.1" class="pilcrow">¶</a></p>
1368 </li>
1369 </ul>
1370 </nav>
1371 </section>
1372 </div>
1373 <div id="intro">
1374 <section id="section-1">
1375 <h2 id="name-introduction">
1376 <a href="#section-1" class="section-number selfRef">1. </a><a href="#name-introduction" class="section-name selfRef">Introduction</a>
1377 </h2>
1378 <p id="section-1-1">This document describes two new cipher suites, a signature algorithm and a
1379 key exchange mechanism for the Transport Layer
1380 Security (TLS) protocol version 1.3 (TLS 1.3) (<span>[<a href="#RFC8446" class="xref">RFC8446</a>]</span>).
1381 These all utilize several ShangMi (SM) cryptographic algorithms
1382 to fulfill the authentication and confidentiality requirements of TLS 1.3.
1383 The new cipher suites are as follows (see also <a href="#proposed" class="xref">Section 2</a>):<a href="#section-1-1" class="pilcrow">¶</a></p>
1384 <div id="section-1-2">
1385 <pre class="sourcecode">
1386 CipherSuite TLS_SM4_GCM_SM3 = { 0x00, 0xC6 };
1387 CipherSuite TLS_SM4_CCM_SM3 = { 0x00, 0xC7 };
1388 </pre><a href="#section-1-2" class="pilcrow">¶</a>
1389 </div>
1390 <p id="section-1-3">For a more detailed
1391 introduction to SM cryptographic algorithms, please see <a href="#sm-algos" class="xref">Section 1.1</a>.
1392 These cipher suites follow the TLS 1.3 requirements. Specifically,
1393 all the cipher suites use SM4 in either Galois/Counter (GCM) mode
1394 or Counter with CBC-MAC (CCM) mode to meet the needs of TLS 1.3 to have an encryption algorithm that is Authenticated Encryption with Associated Data (AEAD) capable.
1395 The key exchange mechanism utilizes Elliptic Curve Diffie-Hellman
1396 Ephemeral (ECDHE) over the SM2 elliptic curve, and the signature algorithm combines
1397 the SM3 hash function and the SM2 elliptic curve signature scheme.<a href="#section-1-3" class="pilcrow">¶</a></p>
1398 <p id="section-1-4">For details about how these mechanisms negotiate shared encryption
1399 keys, authenticate the peer(s), and protect the record structure, please see
1400 <a href="#definitions" class="xref">Section 3</a>.<a href="#section-1-4" class="pilcrow">¶</a></p>
1401 <p id="section-1-5">The cipher suites, signature algorithm, and key exchange mechanism
1402 defined in this document are not recommended by the IETF. The SM
1403 algorithms are becoming mandatory in China, so this document
1404 provides a description of how to use them with TLS 1.3 and specifies
1405 a profile of TLS 1.3 so that implementers can produce interworking
1406 implementations.<a href="#section-1-5" class="pilcrow">¶</a></p>
1407 <div id="sm-algos">
1408 <section id="section-1.1">
1409 <h3 id="name-the-sm-algorithms">
1410 <a href="#section-1.1" class="section-number selfRef">1.1. </a><a href="#name-the-sm-algorithms" class="section-name selfRef">The SM Algorithms</a>
1411 </h3>
1412 <p id="section-1.1-1">Several different SM
1413 cryptographic algorithms are used to integrate with TLS 1.3,
1414 including SM2 for authentication, SM4 for
1415 encryption, and SM3 as the hash function.<a href="#section-1.1-1" class="pilcrow">¶</a></p>
1416 <p id="section-1.1-2">SM2 is a set of cryptographic algorithms based on elliptic curve cryptography, including a digital
1417 signature, public key encryption and key exchange scheme.
1418
1419 In this document, only
1420 the SM2 digital signature algorithm and basic key exchange scheme are involved, which have already been added
1421 to ISO/IEC 14888-3:2018 <span>[<a href="#ISO-SM2" class="xref">ISO-SM2</a>]</span> (as well as to <span>[<a href="#GBT.32918.2-2016" class="xref">GBT.32918.2-2016</a>]</span>).
1422 SM4 is a block cipher defined in <span>[<a href="#GBT.32907-2016" class="xref">GBT.32907-2016</a>]</span> and now is being standardized
1423 by ISO to ISO/IEC 18033-3:2010 <span>[<a href="#ISO-SM4" class="xref">ISO-SM4</a>]</span>. SM3 is a hash function that produces an output of 256 bits. SM3 has already been accepted by ISO in
1424 ISO/IEC 10118-3:2018 <span>[<a href="#ISO-SM3" class="xref">ISO-SM3</a>]</span> and has also been described by <span>[<a href="#GBT.32905-2016" class="xref">GBT.32905-2016</a>]</span>.<a href="#section-1.1-2" class="pilcrow">¶</a></p>
1425 </section>
1426 </div>
1427 <div id="term">
1428 <section id="section-1.2">
1429 <h3 id="name-terminology">
1430 <a href="#section-1.2" class="section-number selfRef">1.2. </a><a href="#name-terminology" class="section-name selfRef">Terminology</a>
1431 </h3>
1432 <p id="section-1.2-1">
1433 The key words "<span class="bcp14">MUST</span>", "<span class="bcp14">MUST NOT</span>", "<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>", "<span class="bcp14">RECOMMENDED</span>", "<span class="bcp14">NOT RECOMMENDED</span>",
1434 "<span class="bcp14">MAY</span>", and "<span class="bcp14">OPTIONAL</span>" in this document are to be interpreted as
1435 described in BCP 14 <span>[<a href="#RFC2119" class="xref">RFC2119</a>]</span> <span>[<a href="#RFC8174" class="xref">RFC8174</a>]</span>
1436 when, and only when, they appear in all capitals, as shown here.<a href="#section-1.2-1" class="pilcrow">¶</a></p>
1437 <p id="section-1.2-2">Although this document is not an IETF Standards Track publication, it
1438 adopts the conventions for normative language to provide clarity of
1439 instruction to the implementer and to indicate requirement levels
1440 for compliant TLS 1.3 implementations.<a href="#section-1.2-2" class="pilcrow">¶</a></p>
1441 </section>
1442 </div>
1443 </section>
1444 </div>
1445 <div id="proposed">
1446 <section id="section-2">
1447 <h2 id="name-algorithm-identifiers">
1448 <a href="#section-2" class="section-number selfRef">2. </a><a href="#name-algorithm-identifiers" class="section-name selfRef">Algorithm Identifiers</a>
1449 </h2>
1450 <p id="section-2-1">The cipher suites defined here have the following identifiers:<a href="#section-2-1" class="pilcrow">¶</a></p>
1451 <div id="section-2-2">
1452 <pre class="sourcecode">
1453 CipherSuite TLS_SM4_GCM_SM3 = { 0x00, 0xC6 };
1454 CipherSuite TLS_SM4_CCM_SM3 = { 0x00, 0xC7 };
1455 </pre><a href="#section-2-2" class="pilcrow">¶</a>
1456 </div>
1457 <p id="section-2-3">To accomplish a TLS 1.3 handshake, additional objects have been introduced along with
1458 the cipher suites as follows:<a href="#section-2-3" class="pilcrow">¶</a></p>
1459 <ul class="normal">
1460 <li class="normal" id="section-2-4.1">The combination of the SM2 signature algorithm and SM3 hash function used in the Signature Algorithm
1461 extension is defined in <span><a href="https://www.rfc-editor.org/rfc/rfc8446#appendix-B.3.1.3" class="relref">Appendix B.3.1.3</a> of [<a href="#RFC8446" class="xref">RFC8446</a>]</span>:<a href="#section-2-4.1" class="pilcrow">¶</a>
1462 </li>
1463 </ul>
1464 <div id="section-2-5">
1465 <pre class="sourcecode">
1466 SignatureScheme sm2sig_sm3 = { 0x0708 };
1467 </pre><a href="#section-2-5" class="pilcrow">¶</a>
1468 </div>
1469 <ul class="normal">
1470 <li class="normal" id="section-2-6.1">The SM2 elliptic curve ID used in the Supported Groups extension is defined in <span><a href="https://www.rfc-editor.org/rfc/rfc8446#appendix-B.3.1.4" class="relref">Appendix B.3.1.4</a> of [<a href="#RFC8446" class="xref">RFC8446</a>]</span>:<a href="#section-2-6.1" class="pilcrow">¶</a>
1471 </li>
1472 </ul>
1473 <div id="section-2-7">
1474 <pre class="sourcecode">
1475 NamedGroup curveSM2 = { 41 };
1476 </pre><a href="#section-2-7" class="pilcrow">¶</a>
1477 </div>
1478 </section>
1479 </div>
1480 <div id="definitions">
1481 <section id="section-3">
1482 <h2 id="name-algorithm-definitions">
1483 <a href="#section-3" class="section-number selfRef">3. </a><a href="#name-algorithm-definitions" class="section-name selfRef">Algorithm Definitions</a>
1484 </h2>
1485 <div id="tls-versions">
1486 <section id="section-3.1">
1487 <h3 id="name-tls-versions">
1488 <a href="#section-3.1" class="section-number selfRef">3.1. </a><a href="#name-tls-versions" class="section-name selfRef">TLS Versions</a>
1489 </h3>
1490 <p id="section-3.1-1">The new cipher suites defined in this document are only applicable to TLS 1.3.
1491 Implementations of this document <span class="bcp14">MUST NOT</span> apply these cipher suites to any older
1492 versions of TLS.<a href="#section-3.1-1" class="pilcrow">¶</a></p>
1493 </section>
1494 </div>
1495 <div id="authentication">
1496 <section id="section-3.2">
1497 <h3 id="name-authentication">
1498 <a href="#section-3.2" class="section-number selfRef">3.2. </a><a href="#name-authentication" class="section-name selfRef">Authentication</a>
1499 </h3>
1500 <div id="sm2-signature-scheme">
1501 <section id="section-3.2.1">
1502 <h4 id="name-sm2-signature-scheme">
1503 <a href="#section-3.2.1" class="section-number selfRef">3.2.1. </a><a href="#name-sm2-signature-scheme" class="section-name selfRef">SM2 Signature Scheme</a>
1504 </h4>
1505 <p id="section-3.2.1-1">The Chinese government requires the use of the SM2 signature algorithm.
1506 This section specifies the use of the SM2 signature algorithm
1507 as the authentication method for a TLS 1.3 handshake.<a href="#section-3.2.1-1" class="pilcrow">¶</a></p>
1508 <p id="section-3.2.1-2">The SM2 signature algorithm is defined in <span>[<a href="#ISO-SM2" class="xref">ISO-SM2</a>]</span>. The SM2 signature algorithm is
1509 based on elliptic curves. The SM2 signature algorithm uses a fixed elliptic curve
1510 parameter set defined in <span>[<a href="#GBT.32918.5-2017" class="xref">GBT.32918.5-2017</a>]</span>. This curve is named "curveSM2" and has been assigned the value 41, as shown in <a href="#proposed" class="xref">Section 2</a>. Unlike other public key algorithms based on elliptic curve cryptography like the Elliptic Curve Digital Signature Algorithm (ECDSA), SM2 <span class="bcp14">MUST NOT</span> select other elliptic curves.
1511 But it is acceptable to write test cases that use other elliptic curve parameter
1512 sets for SM2; see Annex F.14 of <span>[<a href="#ISO-SM2" class="xref">ISO-SM2</a>]</span> as a reference.<a href="#section-3.2.1-2" class="pilcrow">¶</a></p>
1513 <p id="section-3.2.1-3">Implementations of the signature scheme and key exchange mechanism defined in this document <span class="bcp14">MUST</span> conform to
1514 what <span>[<a href="#GBT.32918.5-2017" class="xref">GBT.32918.5-2017</a>]</span> requires; that is to say, the only valid elliptic curve
1515 parameter set for the SM2 signature algorithm (a.k.a. curveSM2) is defined as follows:<a href="#section-3.2.1-3" class="pilcrow">¶</a></p>
1516 <span class="break"></span><dl class="dlParallel" id="section-3.2.1-4">
1517 <dt id="section-3.2.1-4.1">curveSM2:</dt>
1518 <dd style="margin-left: 1.5em" id="section-3.2.1-4.2">A prime field of 256 bits.<a href="#section-3.2.1-4.2" class="pilcrow">¶</a>
1519 </dd>
1520 <dd class="break"></dd>
1521 </dl>
1522 <p id="section-3.2.1-5">y<sup>2</sup> = x<sup>3</sup> + ax + b<a href="#section-3.2.1-5" class="pilcrow">¶</a></p>
1523 <div id="section-3.2.1-6">
1524 <pre class="sourcecode">
1525 p = FFFFFFFE FFFFFFFF FFFFFFFF FFFFFFFF
1526 FFFFFFFF 00000000 FFFFFFFF FFFFFFFF
1527 a = FFFFFFFE FFFFFFFF FFFFFFFF FFFFFFFF
1528 FFFFFFFF 00000000 FFFFFFFF FFFFFFFC
1529 b = 28E9FA9E 9D9F5E34 4D5A9E4B CF6509A7
1530 F39789F5 15AB8F92 DDBCBD41 4D940E93
1531 n = FFFFFFFE FFFFFFFF FFFFFFFF FFFFFFFF
1532 7203DF6B 21C6052B 53BBF409 39D54123
1533 Gx = 32C4AE2C 1F198119 5F990446 6A39C994
1534 8FE30BBF F2660BE1 715A4589 334C74C7
1535 Gy = BC3736A2 F4F6779C 59BDCEE3 6B692153
1536 D0A9877C C62A4740 02DF32E5 2139F0A0
1537 </pre><a href="#section-3.2.1-6" class="pilcrow">¶</a>
1538 </div>
1539 <p id="section-3.2.1-7">The SM2 signature algorithm requests an identifier value when generating or verifying
1540 a signature. In all uses except when a client of a server needs to verify a peer's
1541 SM2 certificate in the Certificate message, an implementation of this document
1542 <span class="bcp14">MUST</span> use the following ASCII string value as the SM2 identifier when doing a
1543 TLS 1.3 key exchange:<a href="#section-3.2.1-7" class="pilcrow">¶</a></p>
1544 <div id="section-3.2.1-8">
1545 <pre class="sourcecode">
1546 TLSv1.3+GM+Cipher+Suite
1547 </pre><a href="#section-3.2.1-8" class="pilcrow">¶</a>
1548 </div>
1549 <p id="section-3.2.1-9">If either a client or a server needs to verify the peer's SM2 certificate
1550 contained in the Certificate message, then the following ASCII string value <span class="bcp14">MUST</span> be
1551 used as the SM2 identifier according to <span>[<a href="#GMT.0009-2012" class="xref">GMT.0009-2012</a>]</span>:<a href="#section-3.2.1-9" class="pilcrow">¶</a></p>
1552 <div id="section-3.2.1-10">
1553 <pre class="sourcecode">
1554 1234567812345678
1555 </pre><a href="#section-3.2.1-10" class="pilcrow">¶</a>
1556 </div>
1557 <p id="section-3.2.1-11">Expressed as octets, this is:<a href="#section-3.2.1-11" class="pilcrow">¶</a></p>
1558 <div id="section-3.2.1-12">
1559 <pre class="sourcecode">
1560 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
1561 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38
1562 </pre><a href="#section-3.2.1-12" class="pilcrow">¶</a>
1563 </div>
1564 <p id="section-3.2.1-13">In practice, the SM2 identifier used in a certificate signature depends on the
1565 certificate authority (CA) who signs that certificate. CAs may choose values other than the ones mentioned
1566 above. Implementations of this document <span class="bcp14">SHOULD</span> confirm this information by themselves.<a href="#section-3.2.1-13" class="pilcrow">¶</a></p>
1567 </section>
1568 </div>
1569 </section>
1570 </div>
1571 <div id="kx">
1572 <section id="section-3.3">
1573 <h3 id="name-key-exchange">
1574 <a href="#section-3.3" class="section-number selfRef">3.3. </a><a href="#name-key-exchange" class="section-name selfRef">Key Exchange</a>
1575 </h3>
1576 <div id="hello-messages">
1577 <section id="section-3.3.1">
1578 <h4 id="name-hello-messages">
1579 <a href="#section-3.3.1" class="section-number selfRef">3.3.1. </a><a href="#name-hello-messages" class="section-name selfRef">Hello Messages</a>
1580 </h4>
1581 <p id="section-3.3.1-1">The use of the algorithms defined by this document is negotiated during
1582 the TLS handshake with information exchanged in the Hello messages.<a href="#section-3.3.1-1" class="pilcrow">¶</a></p>
1583 <div id="clienthello">
1584 <section id="section-3.3.1.1">
1585 <h5 id="name-clienthello">
1586 <a href="#section-3.3.1.1" class="section-number selfRef">3.3.1.1. </a><a href="#name-clienthello" class="section-name selfRef">ClientHello</a>
1587 </h5>
1588 <p id="section-3.3.1.1-1">To use the cipher suites defined by this document, a TLS 1.3 client includes
1589 the new cipher suites in the "cipher_suites"
1590 array of the ClientHello structure defined in <span><a href="https://www.rfc-editor.org/rfc/rfc8446#section-4.1.2" class="relref">Section 4.1.2</a> of [<a href="#RFC8446" class="xref">RFC8446</a>]</span>.<a href="#section-3.3.1.1-1" class="pilcrow">¶</a></p>
1591 <p id="section-3.3.1.1-2">Other requirements of this TLS 1.3 profile on the extensions of
1592 ClientHello message are as follows:<a href="#section-3.3.1.1-2" class="pilcrow">¶</a></p>
1593 <ul class="normal">
1594 <li class="normal" id="section-3.3.1.1-3.1">For the supported_groups extension, "curveSM2" <span class="bcp14">MUST</span> be included.<a href="#section-3.3.1.1-3.1" class="pilcrow">¶</a>
1595 </li>
1596 <li class="normal" id="section-3.3.1.1-3.2">For the signature_algorithms extension, "sm2sig_sm3" <span class="bcp14">MUST</span> be included.<a href="#section-3.3.1.1-3.2" class="pilcrow">¶</a>
1597 </li>
1598 <li class="normal" id="section-3.3.1.1-3.3">For the signature_algorithms_cert extension (if present), "sm2sig_sm3" <span class="bcp14">MUST</span> be included.<a href="#section-3.3.1.1-3.3" class="pilcrow">¶</a>
1599 </li>
1600 <li class="normal" id="section-3.3.1.1-3.4">For the key_share extension, a KeyShareEntry for the "curveSM2" group <span class="bcp14">MUST</span> be included.<a href="#section-3.3.1.1-3.4" class="pilcrow">¶</a>
1601 </li>
1602 </ul>
1603 </section>
1604 </div>
1605 <div id="serverhello">
1606 <section id="section-3.3.1.2">
1607 <h5 id="name-serverhello">
1608 <a href="#section-3.3.1.2" class="section-number selfRef">3.3.1.2. </a><a href="#name-serverhello" class="section-name selfRef">ServerHello</a>
1609 </h5>
1610 <p id="section-3.3.1.2-1">If a TLS 1.3 server receives a ClientHello message containing the algorithms
1611 defined in this document, it <span class="bcp14">MAY</span> choose to use them. If
1612 so, then the server <span class="bcp14">MUST</span> put one of the new cipher suites defined in this
1613 document into its ServerHello's "cipher_suites" array and eventually send it
1614 to the client side.<a href="#section-3.3.1.2-1" class="pilcrow">¶</a></p>
1615 <p id="section-3.3.1.2-2">A TLS 1.3 server's choice of what cipher suite to use depends on the configuration
1616 of the server. For instance, a TLS 1.3 server may or not be configured to include the
1617 new cipher suites defined in this document. Typical TLS 1.3
1618 server applications also provide a mechanism that configures the cipher suite
1619 preference on the server side. If a server is not configured to use the cipher suites
1620 defined in this document, it <span class="bcp14">SHOULD</span> choose another cipher suite in the list that
1621 the TLS 1.3 client provides; otherwise, the server <span class="bcp14">MUST</span> abort the handshake with
1622 an "illegal_parameter" alert.<a href="#section-3.3.1.2-2" class="pilcrow">¶</a></p>
1623 <p id="section-3.3.1.2-3">The following extension <span class="bcp14">MUST</span> conform to the new requirements:<a href="#section-3.3.1.2-3" class="pilcrow">¶</a></p>
1624 <ul class="normal">
1625 <li class="normal" id="section-3.3.1.2-4.1">For the key_share extension, a KeyShareEntry with SM2-related values <span class="bcp14">MUST</span> be added
1626 if the server wants to conform to this profile.<a href="#section-3.3.1.2-4.1" class="pilcrow">¶</a>
1627 </li>
1628 </ul>
1629 </section>
1630 </div>
1631 </section>
1632 </div>
1633 <div id="certificaterequest">
1634 <section id="section-3.3.2">
1635 <h4 id="name-certificaterequest">
1636 <a href="#section-3.3.2" class="section-number selfRef">3.3.2. </a><a href="#name-certificaterequest" class="section-name selfRef">CertificateRequest</a>
1637 </h4>
1638 <p id="section-3.3.2-1">If a CertificateRequest message is sent by the server to require the client
1639 to send its certificate for authentication purposes, for conformance to this
1640 profile, the following is <span class="bcp14">REQUIRED</span>:<a href="#section-3.3.2-1" class="pilcrow">¶</a></p>
1641 <ul class="normal">
1642 <li class="normal" id="section-3.3.2-2.1">The only valid signature algorithm present in "signature_algorithms" extension
1643 <span class="bcp14">MUST</span> be "sm2sig_sm3". That is to say, if the server chooses to conform to this profile,
1644 the signature algorithm for the client's certificate <span class="bcp14">MUST</span> use the SM2/SM3 procedure specified by this document.<a href="#section-3.3.2-2.1" class="pilcrow">¶</a>
1645 </li>
1646 </ul>
1647 </section>
1648 </div>
1649 <div id="certificate">
1650 <section id="section-3.3.3">
1651 <h4 id="name-certificate">
1652 <a href="#section-3.3.3" class="section-number selfRef">3.3.3. </a><a href="#name-certificate" class="section-name selfRef">Certificate</a>
1653 </h4>
1654 <p id="section-3.3.3-1">When a server sends the Certificate message containing the server certificate
1655 to the client side, several new rules are added that will affect the certificate
1656 selection:<a href="#section-3.3.3-1" class="pilcrow">¶</a></p>
1657 <ul class="normal">
1658 <li class="normal" id="section-3.3.3-2.1">The public key in the certificate <span class="bcp14">MUST</span> be a valid SM2 public key.<a href="#section-3.3.3-2.1" class="pilcrow">¶</a>
1659 </li>
1660 <li class="normal" id="section-3.3.3-2.2">The signature algorithm used by the CA to sign the current certificate <span class="bcp14">MUST</span> be
1661 "sm2sig_sm3".<a href="#section-3.3.3-2.2" class="pilcrow">¶</a>
1662 </li>
1663 <li class="normal" id="section-3.3.3-2.3">The certificate <span class="bcp14">MUST</span> be capable of signing; e.g., the digitalSignature bit
1664 of X.509's Key Usage extension is set.<a href="#section-3.3.3-2.3" class="pilcrow">¶</a>
1665 </li>
1666 </ul>
1667 </section>
1668 </div>
1669 <div id="certificateverify">
1670 <section id="section-3.3.4">
1671 <h4 id="name-certificateverify">
1672 <a href="#section-3.3.4" class="section-number selfRef">3.3.4. </a><a href="#name-certificateverify" class="section-name selfRef">CertificateVerify</a>
1673 </h4>
1674 <p id="section-3.3.4-1">In the CertificateVerify message, the signature algorithm <span class="bcp14">MUST</span> be "sm2sig_sm3",
1675 indicating that the hash function <span class="bcp14">MUST</span> be SM3 and the signature algorithm <span class="bcp14">MUST</span> be
1676 SM2.<a href="#section-3.3.4-1" class="pilcrow">¶</a></p>
1677 </section>
1678 </div>
1679 </section>
1680 </div>
1681 <div id="key-scheduling">
1682 <section id="section-3.4">
1683 <h3 id="name-key-scheduling">
1684 <a href="#section-3.4" class="section-number selfRef">3.4. </a><a href="#name-key-scheduling" class="section-name selfRef">Key Scheduling</a>
1685 </h3>
1686 <p id="section-3.4-1">As described in <a href="#sm-algos" class="xref">Section 1.1</a>, SM2 is actually a set of cryptographic
1687 algorithms, including one key exchange protocol that defines methods such as
1688 key derivation function, etc. This document does not define an SM2 key exchange
1689 protocol, and an SM2 key exchange protocol <span class="bcp14">SHALL NOT</span> be used in the key exchange
1690 steps defined in <a href="#kx" class="xref">Section 3.3</a>. Implementations of this document <span class="bcp14">MUST</span> always conform to
1691 what TLS 1.3 <span>[<a href="#RFC8446" class="xref">RFC8446</a>]</span> and its successors require regarding the key derivation and
1692 related methods.<a href="#section-3.4-1" class="pilcrow">¶</a></p>
1693 </section>
1694 </div>
1695 <div id="cipher">
1696 <section id="section-3.5">
1697 <h3 id="name-cipher">
1698 <a href="#section-3.5" class="section-number selfRef">3.5. </a><a href="#name-cipher" class="section-name selfRef">Cipher</a>
1699 </h3>
1700 <p id="section-3.5-1">The new cipher suites introduced in this document add two new AEAD encryption
1701 algorithms, AEAD_SM4_GCM and AEAD_SM4_CCM, which stand for SM4 cipher in Galois/Counter
1702 mode and SM4 cipher <span>[<a href="#GBT.32907-2016" class="xref">GBT.32907-2016</a>]</span> in Counter with CBC-MAC mode, respectively.
1703 The hash function for both cipher suites is SM3 (<span>[<a href="#ISO-SM3" class="xref">ISO-SM3</a>]</span>).<a href="#section-3.5-1" class="pilcrow">¶</a></p>
1704 <p id="section-3.5-2">This section defines the AEAD_SM4_GCM and AEAD_SM4_CCM AEAD algorithms in a
1705 style similar to what <span>[<a href="#RFC5116" class="xref">RFC5116</a>]</span> used to define AEAD ciphers based on the AES cipher.<a href="#section-3.5-2" class="pilcrow">¶</a></p>
1706 <div id="aeadsm4gcm">
1707 <section id="section-3.5.1">
1708 <h4 id="name-aead_sm4_gcm">
1709 <a href="#section-3.5.1" class="section-number selfRef">3.5.1. </a><a href="#name-aead_sm4_gcm" class="section-name selfRef">AEAD_SM4_GCM</a>
1710 </h4>
1711 <p id="section-3.5.1-1">The AEAD_SM4_GCM authenticated encryption algorithm works as specified in <span>[<a href="#GCM" class="xref">GCM</a>]</span>,
1712 using SM4 as the block cipher, by providing the key, nonce, plaintext, and
1713 associated data to that mode of operation. An authentication tag conforming to
1714 the requirements of TLS 1.3 as specified in <span><a href="https://www.rfc-editor.org/rfc/rfc8446#section-5.2" class="relref">Section 5.2</a> of [<a href="#RFC8446" class="xref">RFC8446</a>]</span> <span class="bcp14">MUST</span> be constructed using
1715 the details in the TLS record header. The additional data input that forms the
1716 authentication tag <span class="bcp14">MUST</span> be the TLS record header. The AEAD_SM4_GCM ciphertext is formed by
1717 appending the authentication tag provided as an output to the GCM encryption
1718 operation to the ciphertext that is output by that operation. AEAD_SM4_GCM has
1719 four inputs: an SM4 key, an initialization vector (IV), a plaintext content, and optional
1720 additional authenticated data (AAD). AEAD_SM4_GCM generates two outputs: a ciphertext
1721 and message authentication code (also called an authentication tag). To have a common
1722 set of terms for AEAD_SM4_GCM and AEAD_SM4_CCM, the AEAD_SM4_GCM IV is referred to as a
1723 nonce in the remainder of this document. A simple test vector of AEAD_SM4_GCM and
1724 AEAD_SM4_CCM is given in <a href="#test-vectors" class="xref">Appendix A</a> of this document.<a href="#section-3.5.1-1" class="pilcrow">¶</a></p>
1725 <p id="section-3.5.1-2">The nonce is generated by the party performing the authenticated encryption operation.
1726 Within the scope of any authenticated encryption key, the nonce value <span class="bcp14">MUST</span> be unique.
1727 That is, the set of nonce values used with any given key <span class="bcp14">MUST NOT</span> contain any duplicates.
1728 Using the same nonce for two different messages encrypted with the same key
1729 destroys the security properties of GCM mode. To generate the nonce, implementations of this document
1730 <span class="bcp14">MUST</span> conform to TLS 1.3 (see <span>[<a href="#RFC8446" class="xref">RFC8446</a>], <a href="https://www.rfc-editor.org/rfc/rfc8446#section-5.3" class="relref">Section 5.3</a></span>).<a href="#section-3.5.1-2" class="pilcrow">¶</a></p>
1731 <p id="section-3.5.1-3">The input and output lengths are as follows:<a href="#section-3.5.1-3" class="pilcrow">¶</a></p>
1732 <ul class="normal ulEmpty">
1733 <li class="normal ulEmpty" id="section-3.5.1-4.1">The SM4 key length is 16 octets.<a href="#section-3.5.1-4.1" class="pilcrow">¶</a>
1734 </li>
1735 <li class="normal ulEmpty" id="section-3.5.1-4.2">The max plaintext length is 2<sup>36</sup> - 31 octets.<a href="#section-3.5.1-4.2" class="pilcrow">¶</a>
1736 </li>
1737 <li class="normal ulEmpty" id="section-3.5.1-4.3">The max AAD length is 2<sup>61</sup> - 1 octets.<a href="#section-3.5.1-4.3" class="pilcrow">¶</a>
1738 </li>
1739 <li class="normal ulEmpty" id="section-3.5.1-4.4">The nonce length is 12 octets.<a href="#section-3.5.1-4.4" class="pilcrow">¶</a>
1740 </li>
1741 <li class="normal ulEmpty" id="section-3.5.1-4.5">The authentication tag length is 16 octets.<a href="#section-3.5.1-4.5" class="pilcrow">¶</a>
1742 </li>
1743 <li class="normal ulEmpty" id="section-3.5.1-4.6">The max ciphertext length is 2<sup>36</sup> - 15 octets.<a href="#section-3.5.1-4.6" class="pilcrow">¶</a>
1744 </li>
1745 </ul>
1746 <p id="section-3.5.1-5">A security analysis of GCM is available in <span>[<a href="#MV04" class="xref">MV04</a>]</span>.<a href="#section-3.5.1-5" class="pilcrow">¶</a></p>
1747 </section>
1748 </div>
1749 <div id="aeadsm4ccm">
1750 <section id="section-3.5.2">
1751 <h4 id="name-aead_sm4_ccm">
1752 <a href="#section-3.5.2" class="section-number selfRef">3.5.2. </a><a href="#name-aead_sm4_ccm" class="section-name selfRef">AEAD_SM4_CCM</a>
1753 </h4>
1754 <p id="section-3.5.2-1">The AEAD_SM4_CCM authenticated encryption algorithm works as specified in <span>[<a href="#CCM" class="xref">CCM</a>]</span>
1755 using SM4 as the block cipher. AEAD_SM4_CCM has four inputs: an SM4 key, a nonce,
1756 a plaintext, and optional additional authenticated data (AAD). AEAD_SM4_CCM
1757 generates two outputs: a ciphertext and a message authentication code (also called
1758 an authentication tag). The formatting and counter generation functions are as
1759 specified in Appendix A of <span>[<a href="#CCM" class="xref">CCM</a>]</span>, and the values of the parameters
1760 identified in that appendix are as follows:<a href="#section-3.5.2-1" class="pilcrow">¶</a></p>
1761 <ul class="normal ulEmpty">
1762 <li class="normal ulEmpty" id="section-3.5.2-2.1">The nonce length n is 12.<a href="#section-3.5.2-2.1" class="pilcrow">¶</a>
1763 </li>
1764 <li class="normal ulEmpty" id="section-3.5.2-2.2">The tag length t is 16.<a href="#section-3.5.2-2.2" class="pilcrow">¶</a>
1765 </li>
1766 <li class="normal ulEmpty" id="section-3.5.2-2.3">The value of q is 3.<a href="#section-3.5.2-2.3" class="pilcrow">¶</a>
1767 </li>
1768 </ul>
1769 <p id="section-3.5.2-3">An authentication tag is also used in AEAD_SM4_CCM. The generation of the authentication
1770 tag <span class="bcp14">MUST</span> conform to TLS 1.3 (See <span>[<a href="#RFC8446" class="xref">RFC8446</a>], <a href="https://www.rfc-editor.org/rfc/rfc8446#section-5.2" class="relref">Section 5.2</a></span>).
1771 The AEAD_SM4_CCM ciphertext is formed by appending the authentication tag provided
1772 as an output to the CCM encryption operation to the ciphertext that is output
1773 by that operation. The input and output lengths are as follows:<a href="#section-3.5.2-3" class="pilcrow">¶</a></p>
1774 <ul class="normal ulEmpty">
1775 <li class="normal ulEmpty" id="section-3.5.2-4.1"> The SM4 key length is 16 octets.<a href="#section-3.5.2-4.1" class="pilcrow">¶</a>
1776 </li>
1777 <li class="normal ulEmpty" id="section-3.5.2-4.2"> The max plaintext length is 2<sup>24</sup> - 1 octets.<a href="#section-3.5.2-4.2" class="pilcrow">¶</a>
1778 </li>
1779 <li class="normal ulEmpty" id="section-3.5.2-4.3"> The max AAD length is 2<sup>64</sup> - 1 octets.<a href="#section-3.5.2-4.3" class="pilcrow">¶</a>
1780 </li>
1781 <li class="normal ulEmpty" id="section-3.5.2-4.4"> The max ciphertext length is 2<sup>24</sup> + 15 octets.<a href="#section-3.5.2-4.4" class="pilcrow">¶</a>
1782 </li>
1783 </ul>
1784 <p id="section-3.5.2-5">To generate the nonce, implementations of this document <span class="bcp14">MUST</span> conform to
1785 TLS 1.3 (see <span>[<a href="#RFC8446" class="xref">RFC8446</a>], <a href="https://www.rfc-editor.org/rfc/rfc8446#section-5.3" class="relref">Section 5.3</a></span>).<a href="#section-3.5.2-5" class="pilcrow">¶</a></p>
1786 <p id="section-3.5.2-6">A security analysis of CCM is available in <span>[<a href="#J02" class="xref">J02</a>]</span>.<a href="#section-3.5.2-6" class="pilcrow">¶</a></p>
1787 </section>
1788 </div>
1789 </section>
1790 </div>
1791 </section>
1792 </div>
1793 <div id="iana-considerations">
1794 <section id="section-4">
1795 <h2 id="name-iana-considerations">
1796 <a href="#section-4" class="section-number selfRef">4. </a><a href="#name-iana-considerations" class="section-name selfRef">IANA Considerations</a>
1797 </h2>
1798 <p id="section-4-1">IANA has assigned the values {0x00,0xC6} and {0x00,0xC7} with the names
1799 "TLS_SM4_GCM_SM3" and "TLS_SM4_CCM_SM3"
1800 to the "TLS Cipher Suites" registry with this document as reference:<a href="#section-4-1" class="pilcrow">¶</a></p>
1801 <table class="center" id="table-1">
1802 <caption><a href="#table-1" class="selfRef">Table 1</a></caption>
1803 <thead>
1804 <tr>
1805 <th class="text-left" rowspan="1" colspan="1">Value</th>
1806 <th class="text-left" rowspan="1" colspan="1">Description</th>
1807 <th class="text-left" rowspan="1" colspan="1">DTLS-OK</th>
1808 <th class="text-left" rowspan="1" colspan="1">Recommended</th>
1809 <th class="text-left" rowspan="1" colspan="1">Reference</th>
1810 </tr>
1811 </thead>
1812 <tbody>
1813 <tr>
1814 <td class="text-right" rowspan="1" colspan="1">0x00,0xC6</td>
1815 <td class="text-left" rowspan="1" colspan="1">TLS_SM4_GCM_SM3</td>
1816 <td class="text-left" rowspan="1" colspan="1">No</td>
1817 <td class="text-left" rowspan="1" colspan="1">No</td>
1818 <td class="text-left" rowspan="1" colspan="1">RFC 8998</td>
1819 </tr>
1820 <tr>
1821 <td class="text-right" rowspan="1" colspan="1">0x00,0xC7</td>
1822 <td class="text-left" rowspan="1" colspan="1">TLS_SM4_CCM_SM3</td>
1823 <td class="text-left" rowspan="1" colspan="1">No</td>
1824 <td class="text-left" rowspan="1" colspan="1">No</td>
1825 <td class="text-left" rowspan="1" colspan="1">RFC 8998</td>
1826 </tr>
1827 </tbody>
1828 </table>
1829 <p id="section-4-3">IANA has assigned the value 0x0708 with the name "sm2sig_sm3" to the
1830 "TLS SignatureScheme" registry:<a href="#section-4-3" class="pilcrow">¶</a></p>
1831 <table class="center" id="table-2">
1832 <caption><a href="#table-2" class="selfRef">Table 2</a></caption>
1833 <thead>
1834 <tr>
1835 <th class="text-right" rowspan="1" colspan="1">Value</th>
1836 <th class="text-left" rowspan="1" colspan="1">Description</th>
1837 <th class="text-left" rowspan="1" colspan="1">Recommended</th>
1838 <th class="text-left" rowspan="1" colspan="1">Reference</th>
1839 </tr>
1840 </thead>
1841 <tbody>
1842 <tr>
1843 <td class="text-right" rowspan="1" colspan="1">0x0708</td>
1844 <td class="text-left" rowspan="1" colspan="1">sm2sig_sm3</td>
1845 <td class="text-left" rowspan="1" colspan="1">No</td>
1846 <td class="text-left" rowspan="1" colspan="1">RFC 8998</td>
1847 </tr>
1848 </tbody>
1849 </table>
1850 <p id="section-4-5">IANA has assigned the value 41 with the name "curveSM2" to the
1851 "TLS Supported Groups" registry:<a href="#section-4-5" class="pilcrow">¶</a></p>
1852 <table class="center" id="table-3">
1853 <caption><a href="#table-3" class="selfRef">Table 3</a></caption>
1854 <thead>
1855 <tr>
1856 <th class="text-right" rowspan="1" colspan="1">Value</th>
1857 <th class="text-left" rowspan="1" colspan="1">Description</th>
1858 <th class="text-left" rowspan="1" colspan="1">DTLS-OK</th>
1859 <th class="text-left" rowspan="1" colspan="1">Recommended</th>
1860 <th class="text-left" rowspan="1" colspan="1">Reference</th>
1861 </tr>
1862 </thead>
1863 <tbody>
1864 <tr>
1865 <td class="text-right" rowspan="1" colspan="1">41</td>
1866 <td class="text-left" rowspan="1" colspan="1">curveSM2</td>
1867 <td class="text-left" rowspan="1" colspan="1">No</td>
1868 <td class="text-left" rowspan="1" colspan="1">No</td>
1869 <td class="text-left" rowspan="1" colspan="1">RFC 8998</td>
1870 </tr>
1871 </tbody>
1872 </table>
1873 </section>
1874 </div>
1875 <div id="security-considerations">
1876 <section id="section-5">
1877 <h2 id="name-security-considerations">
1878 <a href="#section-5" class="section-number selfRef">5. </a><a href="#name-security-considerations" class="section-name selfRef">Security Considerations</a>
1879 </h2>
1880 <p id="section-5-1">At the time of writing, there are no known weak keys for SM
1881 cryptographic algorithms SM2, SM3 and SM4, and no security issues
1882 have been found for these algorithms.<a href="#section-5-1" class="pilcrow">¶</a></p>
1883 <p id="section-5-2">A security analysis of GCM is available in <span>[<a href="#MV04" class="xref">MV04</a>]</span>.<a href="#section-5-2" class="pilcrow">¶</a></p>
1884 <p id="section-5-3">A security analysis of CCM is available in <span>[<a href="#J02" class="xref">J02</a>]</span>.<a href="#section-5-3" class="pilcrow">¶</a></p>
1885 </section>
1886 </div>
1887 <section id="section-6">
1888 <h2 id="name-references">
1889 <a href="#section-6" class="section-number selfRef">6. </a><a href="#name-references" class="section-name selfRef">References</a>
1890 </h2>
1891 <section id="section-6.1">
1892 <h3 id="name-normative-references">
1893 <a href="#section-6.1" class="section-number selfRef">6.1. </a><a href="#name-normative-references" class="section-name selfRef">Normative References</a>
1894 </h3>
1895 <dl class="references">
1896 <dt id="CCM">[CCM]</dt>
1897 <dd>
1898 <span class="refAuthor">Dworkin, M.</span>, <span class="refTitle">"Recommendation for Block Cipher Modes of Operation: the CCM Mode for Authentication and Confidentiality"</span>, <span class="seriesInfo">Special Publication 800-38C</span>, <span class="seriesInfo">DOI 10.6028/NIST.SP.800-38C</span>, <time datetime="2004-05" class="refDate">May 2004</time>, <span>&lt;<a href="http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C.pdf">http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C.pdf</a>&gt;</span>. </dd>
1899 <dd class="break"></dd>
1900 <dt id="GCM">[GCM]</dt>
1901 <dd>
1902 <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">Special Publication 800-38D</span>, <span class="seriesInfo">DOI 10.6028/NIST.SP.800-38D</span>, <time datetime="2007-11" class="refDate">November 2007</time>, <span>&lt;<a href="http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf">http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf</a>&gt;</span>. </dd>
1903 <dd class="break"></dd>
1904 <dt id="ISO-SM2">[ISO-SM2]</dt>
1905 <dd>
1906 <span class="refAuthor">International Organization for Standardization</span>, <span class="refTitle">"IT Security techniques -- Digital signatures with appendix -- Part 3: Discrete logarithm based mechanisms"</span>, <span class="seriesInfo">ISO/IEC 14888-3:2018</span>, <time datetime="2018-11" class="refDate">November 2018</time>, <span>&lt;<a href="https://www.iso.org/standard/76382.html">https://www.iso.org/standard/76382.html</a>&gt;</span>. </dd>
1907 <dd class="break"></dd>
1908 <dt id="ISO-SM3">[ISO-SM3]</dt>
1909 <dd>
1910 <span class="refAuthor">International Organization for Standardization</span>, <span class="refTitle">"IT Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions"</span>, <span class="seriesInfo">ISO/IEC 10118-3:2018</span>, <time datetime="2018-10" class="refDate">October 2018</time>, <span>&lt;<a href="https://www.iso.org/standard/67116.html">https://www.iso.org/standard/67116.html</a>&gt;</span>. </dd>
1911 <dd class="break"></dd>
1912 <dt id="ISO-SM4">[ISO-SM4]</dt>
1913 <dd>
1914 <span class="refAuthor">International Organization for Standardization</span>, <span class="refTitle">"Information technology -- Security techniques -- Encryption algorithms -- Part 3: Block ciphers"</span>, <span class="seriesInfo">ISO/IEC 18033-3:2010</span>, <time datetime="2010-12" class="refDate">December 2010</time>, <span>&lt;<a href="https://www.iso.org/standard/54531.html">https://www.iso.org/standard/54531.html</a>&gt;</span>. </dd>
1915 <dd class="break"></dd>
1916 <dt id="RFC2119">[RFC2119]</dt>
1917 <dd>
1918 <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>
1919 <dd class="break"></dd>
1920 <dt id="RFC5116">[RFC5116]</dt>
1921 <dd>
1922 <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>
1923 <dd class="break"></dd>
1924 <dt id="RFC8174">[RFC8174]</dt>
1925 <dd>
1926 <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>
1927 <dd class="break"></dd>
1928 <dt id="RFC8446">[RFC8446]</dt>
1929 <dd>
1930 <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>
1931 <dd class="break"></dd>
1932 </dl>
1933 </section>
1934 <section id="section-6.2">
1935 <h3 id="name-informative-references">
1936 <a href="#section-6.2" class="section-number selfRef">6.2. </a><a href="#name-informative-references" class="section-name selfRef">Informative References</a>
1937 </h3>
1938 <dl class="references">
1939 <dt id="GBT.32905-2016">[GBT.32905-2016]</dt>
1940 <dd>
1941 <span class="refAuthor">Standardization Administration of China</span>, <span class="refTitle">"Information security technology --- SM3 cryptographic hash algorithm"</span>, <span class="seriesInfo">GB/T 32905-2016</span>, <time datetime="2017-03" class="refDate">March 2017</time>, <span>&lt;<a href="http://www.gmbz.org.cn/upload/2018-07-24/1532401392982079739.pdf">http://www.gmbz.org.cn/upload/2018-07-24/1532401392982079739.pdf</a>&gt;</span>. </dd>
1942 <dd class="break"></dd>
1943 <dt id="GBT.32907-2016">[GBT.32907-2016]</dt>
1944 <dd>
1945 <span class="refAuthor">Standardization Administration of the People's Republic of China</span>, <span class="refTitle">"Information security technology -- SM4 block cipher algorithm"</span>, <span class="seriesInfo">GB/T 32907-2016</span>, <time datetime="2017-03" class="refDate">March 2017</time>, <span>&lt;<a href="http://www.gmbz.org.cn/upload/2018-04-04/1522788048733065051.pdf">http://www.gmbz.org.cn/upload/2018-04-04/1522788048733065051.pdf</a>&gt;</span>. </dd>
1946 <dd class="break"></dd>
1947 <dt id="GBT.32918.2-2016">[GBT.32918.2-2016]</dt>
1948 <dd>
1949 <span class="refAuthor">Standardization Administration of the People's Republic of China</span>, <span class="refTitle">"Information security technology --- Public key cryptographic algorithm SM2 based on elliptic curves --- Part 2: Digital signature algorithm"</span>, <span class="seriesInfo">GB/T 32918.2-2016</span>, <time datetime="2017-03" class="refDate">March 2017</time>, <span>&lt;<a href="http://www.gmbz.org.cn/upload/2018-07-24/1532401673138056311.pdf">http://www.gmbz.org.cn/upload/2018-07-24/1532401673138056311.pdf</a>&gt;</span>. </dd>
1950 <dd class="break"></dd>
1951 <dt id="GBT.32918.5-2017">[GBT.32918.5-2017]</dt>
1952 <dd>
1953 <span class="refAuthor">Standardization Administration of the People's Republic of China</span>, <span class="refTitle">"Information security technology --- Public key cryptographic algorithm SM2 based on elliptic curves --- Part 5: Parameter definition"</span>, <span class="seriesInfo">GB/T 32918.5-2017</span>, <time datetime="2017-12" class="refDate">December 2017</time>, <span>&lt;<a href="http://www.gmbz.org.cn/upload/2018-07-24/1532401863206085511.pdf">http://www.gmbz.org.cn/upload/2018-07-24/1532401863206085511.pdf</a>&gt;</span>. </dd>
1954 <dd class="break"></dd>
1955 <dt id="GMT.0009-2012">[GMT.0009-2012]</dt>
1956 <dd>
1957 <span class="refAuthor">State Cryptography Administration</span>, <span class="refTitle">"SM2 cryptography algorithm application specification"</span>, <span class="seriesInfo">GM/T 0009-2012</span>, <time datetime="2012-11" class="refDate">November 2012</time>, <span>&lt;<a href="http://www.gmbz.org.cn/main/viewfile/2018011001400692565.html">http://www.gmbz.org.cn/main/viewfile/2018011001400692565.html</a>&gt;</span>. </dd>
1958 <dd class="break"></dd>
1959 <dt id="J02">[J02]</dt>
1960 <dd>
1961 <span class="refAuthor">Jonsson, J.</span>, <span class="refTitle">"On the Security of CTR + CBC-MAC"</span>, <span class="seriesInfo">DOI 10.1007/3-540-36492-7_7</span>, <time datetime="2003-02" class="refDate">February 2003</time>, <span>&lt;<a href="https://link.springer.com/chapter/10.1007%2F3-540-36492-7_7">https://link.springer.com/chapter/10.1007%2F3-540-36492-7_7</a>&gt;</span>. </dd>
1962 <dd class="break"></dd>
1963 <dt id="MV04">[MV04]</dt>
1964 <dd>
1965 <span class="refAuthor">McGrew, D.</span><span class="refAuthor"> and J. Viega</span>, <span class="refTitle">"The Security and Performance of the Galois/Counter Mode of Operation"</span>, <span class="seriesInfo">DOI 10.1007/978-3-540-30556-9_27</span>, <time datetime="2004-12" class="refDate">December 2004</time>, <span>&lt;<a href="http://eprint.iacr.org/2004/193">http://eprint.iacr.org/2004/193</a>&gt;</span>. </dd>
1966 <dd class="break"></dd>
1967 </dl>
1968 </section>
1969 </section>
1970 <div id="test-vectors">
1971 <section id="section-appendix.a">
1972 <h2 id="name-test-vectors">
1973 <a href="#section-appendix.a" class="section-number selfRef">Appendix A. </a><a href="#name-test-vectors" class="section-name selfRef">Test Vectors</a>
1974 </h2>
1975 <p id="section-appendix.a-1">All values are in hexadecimal and are in network byte order (big endian).<a href="#section-appendix.a-1" class="pilcrow">¶</a></p>
1976 <div id="sm4-gcm-test-vectors">
1977 <section id="section-a.1">
1978 <h2 id="name-sm4-gcm-test-vectors">
1979 <a href="#section-a.1" class="section-number selfRef">A.1. </a><a href="#name-sm4-gcm-test-vectors" class="section-name selfRef">SM4-GCM Test Vectors</a>
1980 </h2>
1981 <div id="section-a.1-1">
1982 <pre class="sourcecode">
1983 Initialization Vector: 00001234567800000000ABCD
1984 Key: 0123456789ABCDEFFEDCBA9876543210
1985 Plaintext: AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB
1986 CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDD
1987 EEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFF
1988 EEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAA
1989 Associated Data: FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
1990 CipherText: 17F399F08C67D5EE19D0DC9969C4BB7D
1991 5FD46FD3756489069157B282BB200735
1992 D82710CA5C22F0CCFA7CBF93D496AC15
1993 A56834CBCF98C397B4024A2691233B8D
1994 Authentication Tag: 83DE3541E4C2B58177E065A9BF7B62EC
1995 </pre><a href="#section-a.1-1" class="pilcrow">¶</a>
1996 </div>
1997 </section>
1998 </div>
1999 <div id="sm4-ccm-test-vectors">
2000 <section id="section-a.2">
2001 <h2 id="name-sm4-ccm-test-vectors">
2002 <a href="#section-a.2" class="section-number selfRef">A.2. </a><a href="#name-sm4-ccm-test-vectors" class="section-name selfRef">SM4-CCM Test Vectors</a>
2003 </h2>
2004 <div id="section-a.2-1">
2005 <pre class="sourcecode">
2006 Initialization Vector: 00001234567800000000ABCD
2007 Key: 0123456789ABCDEFFEDCBA9876543210
2008 Plaintext: AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB
2009 CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDD
2010 EEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFF
2011 EEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAA
2012 Associated Data: FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
2013 CipherText: 48AF93501FA62ADBCD414CCE6034D895
2014 DDA1BF8F132F042098661572E7483094
2015 FD12E518CE062C98ACEE28D95DF4416B
2016 ED31A2F04476C18BB40C84A74B97DC5B
2017 Authentication Tag: 16842D4FA186F56AB33256971FA110F4
2018 </pre><a href="#section-a.2-1" class="pilcrow">¶</a>
2019 </div>
2020 </section>
2021 </div>
2022 </section>
2023 </div>
2024 <div id="contributors">
2025 <section id="section-appendix.b">
2026 <h2 id="name-contributors">
2027 <a href="#name-contributors" class="section-name selfRef">Contributors</a>
2028 </h2>
2029 <address class="vcard">
2030 <div dir="auto" class="left"><span class="fn nameRole">Qin Long</span></div>
2031 <div dir="auto" class="left"><span class="org">Ant Group</span></div>
2032 <div class="email">
2033 <span>Email:</span>
2034 <a href="mailto:[email protected]" class="email">[email protected]</a>
2035 </div>
2036 </address>
2037 <address class="vcard">
2038 <div dir="auto" class="left"><span class="fn nameRole">Kepeng Li</span></div>
2039 <div dir="auto" class="left"><span class="org">Ant Group</span></div>
2040 <div class="email">
2041 <span>Email:</span>
2042 <a href="mailto:[email protected]" class="email">[email protected]</a>
2043 </div>
2044 </address>
2045 <address class="vcard">
2046 <div dir="auto" class="left"><span class="fn nameRole">Ke Zeng</span></div>
2047 <div dir="auto" class="left"><span class="org">Ant Group</span></div>
2048 <div class="email">
2049 <span>Email:</span>
2050 <a href="mailto:[email protected]" class="email">[email protected]</a>
2051 </div>
2052 </address>
2053 <address class="vcard">
2054 <div dir="auto" class="left"><span class="fn nameRole">Han Xiao</span></div>
2055 <div dir="auto" class="left"><span class="org">Ant Group</span></div>
2056 <div class="email">
2057 <span>Email:</span>
2058 <a href="mailto:[email protected]" class="email">[email protected]</a>
2059 </div>
2060 </address>
2061 <address class="vcard">
2062 <div dir="auto" class="left"><span class="fn nameRole">Zhi Guan</span></div>
2063 <div dir="auto" class="left"><span class="org">Peking University</span></div>
2064 <div class="email">
2065 <span>Email:</span>
2066 <a href="mailto:[email protected]" class="email">[email protected]</a>
2067 </div>
2068 </address>
2069 </section>
2070 </div>
2071 <div id="authors-addresses">
2072 <section id="section-appendix.c">
2073 <h2 id="name-authors-address">
2074 <a href="#name-authors-address" class="section-name selfRef">Author's Address</a>
2075 </h2>
2076 <address class="vcard">
2077 <div dir="auto" class="left"><span class="fn nameRole">Paul Yang</span></div>
2078 <div dir="auto" class="left"><span class="org">Ant Group</span></div>
2079 <div dir="auto" class="left"><span class="street-address">No. 77 Xueyuan Road</span></div>
2080 <div dir="auto" class="left"><span class="locality">Hangzhou</span></div>
2081 <div dir="auto" class="left"><span class="postal-code">310000</span></div>
2082 <div dir="auto" class="left"><span class="country-name">China</span></div>
2083 <div class="tel">
2084 <span>Phone:</span>
2085 <a href="tel:+86-571-2688-8888" class="tel">+86-571-2688-8888</a>
2086 </div>
2087 <div class="email">
2088 <span>Email:</span>
2089 <a href="mailto:[email protected]" class="email">[email protected]</a>
2090 </div>
2091 </address>
2092 </section>
2093 </div>
2094 <script>const toc = document.getElementById("toc");
2095 toc.querySelector("h2").addEventListener("click", e => {
2096 toc.classList.toggle("active");
2097 });
2098 toc.querySelector("nav").addEventListener("click", e => {
2099 toc.classList.remove("active");
2100 });
2101 </script>
2102 </body>
2103 </html>