This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
forked from cfrg/draft-irtf-cfrg-hash-to-curve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rfc9380.xml
8916 lines (8642 loc) · 556 KB
/
rfc9380.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" number="9380" docName="draft-irtf-cfrg-hash-to-curve-16" category="info" submissionType="IRTF" consensus="true" xml:lang="en" tocInclude="true" sortRefs="true" symRefs="true" prepTime="2023-08-11T16:42:12" indexInclude="true" scripts="Common,Latin" tocDepth="3">
<link href="https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve-16" rel="prev"/>
<link href="https://dx.doi.org/10.17487/rfc9380" rel="alternate"/>
<link href="urn:issn:2070-1721" rel="alternate"/>
<front>
<title>Hashing to Elliptic Curves</title>
<seriesInfo name="RFC" value="9380" stream="IRTF"/>
<author initials="A." surname="Faz-Hernandez" fullname="Armando Faz-Hernandez">
<organization showOnFrontPage="true">Cloudflare, Inc.</organization>
<address>
<postal>
<street>101 Townsend St</street>
<city>San Francisco</city>
<region>CA</region>
<code>94107</code>
<country>United States of America</country>
</postal>
<email>armfazh@cloudflare.com</email>
</address>
</author>
<author initials="S." surname="Scott" fullname="Sam Scott">
<organization showOnFrontPage="true">Oso Security, Inc.</organization>
<address>
<postal>
<street>335 Madison Ave</street>
<city>New York</city>
<region>NY</region>
<code>10017</code>
<country>United States of America</country>
</postal>
<email>sam.scott89@gmail.com</email>
</address>
</author>
<author initials="N." surname="Sullivan" fullname="Nick Sullivan">
<organization showOnFrontPage="true">Cloudflare, Inc.</organization>
<address>
<postal>
<street>101 Townsend St</street>
<city>San Francisco</city>
<region>CA</region>
<code>94107</code>
<country>United States of America</country>
</postal>
<email>nicholas.sullivan@gmail.com</email>
</address>
</author>
<author initials="R. S." surname="Wahby" fullname="Riad S. Wahby">
<organization showOnFrontPage="true">Stanford University</organization>
<address>
<email>rsw@cs.stanford.edu</email>
</address>
</author>
<author initials="C. A." surname="Wood" fullname="Christopher A. Wood">
<organization showOnFrontPage="true">Cloudflare, Inc.</organization>
<address>
<postal>
<street>101 Townsend St</street>
<city>San Francisco</city>
<region>CA</region>
<code>94107</code>
<country>United States of America</country>
</postal>
<email>caw@heapingbits.net</email>
</address>
</author>
<date month="08" year="2023"/>
<workgroup>Crypto Forum</workgroup>
<abstract pn="section-abstract">
<t indent="0" pn="section-abstract-1">This document specifies a number of algorithms for encoding or hashing an
arbitrary string to a point on an elliptic curve. This document is a product
of the Crypto Forum Research Group (CFRG) in the IRTF.</t>
</abstract>
<boilerplate>
<section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
<name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
<t indent="0" pn="section-boilerplate.1-1">
This document is not an Internet Standards Track specification; it is
published for informational purposes.
</t>
<t indent="0" pn="section-boilerplate.1-2">
This document is a product of the Internet Research Task Force
(IRTF). The IRTF publishes the results of Internet-related
research and development activities. These results might not be
suitable for deployment. This RFC represents the consensus of the Crypto Forum
Research Group of the Internet Research Task Force (IRTF).
Documents approved for publication by the IRSG are not
candidates for any level of Internet Standard; see Section 2 of RFC
7841.
</t>
<t indent="0" pn="section-boilerplate.1-3">
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
<eref target="https://www.rfc-editor.org/info/rfc9380" brackets="none"/>.
</t>
</section>
<section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
<name slugifiedName="name-copyright-notice">Copyright Notice</name>
<t indent="0" pn="section-boilerplate.2-1">
Copyright (c) 2023 IETF Trust and the persons identified as the
document authors. All rights reserved.
</t>
<t indent="0" pn="section-boilerplate.2-2">
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with
respect to this document.
</t>
</section>
</boilerplate>
<toc>
<section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
<name slugifiedName="name-table-of-contents">Table of Contents</name>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
<li pn="section-toc.1-1.1">
<t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.1.2">
<li pn="section-toc.1-1.1.2.1">
<t indent="0" keepWithNext="true" pn="section-toc.1-1.1.2.1.1"><xref derivedContent="1.1" format="counter" sectionFormat="of" target="section-1.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-requirements-notation">Requirements Notation</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.2">
<t indent="0" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-background">Background</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2">
<li pn="section-toc.1-1.2.2.1">
<t indent="0" keepWithNext="true" pn="section-toc.1-1.2.2.1.1"><xref derivedContent="2.1" format="counter" sectionFormat="of" target="section-2.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-elliptic-curves">Elliptic Curves</xref></t>
</li>
<li pn="section-toc.1-1.2.2.2">
<t indent="0" pn="section-toc.1-1.2.2.2.1"><xref derivedContent="2.2" format="counter" sectionFormat="of" target="section-2.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology">Terminology</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.2.2.2.2">
<li pn="section-toc.1-1.2.2.2.2.1">
<t indent="0" pn="section-toc.1-1.2.2.2.2.1.1"><xref derivedContent="2.2.1" format="counter" sectionFormat="of" target="section-2.2.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-mappings">Mappings</xref></t>
</li>
<li pn="section-toc.1-1.2.2.2.2.2">
<t indent="0" pn="section-toc.1-1.2.2.2.2.2.1"><xref derivedContent="2.2.2" format="counter" sectionFormat="of" target="section-2.2.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-encodings">Encodings</xref></t>
</li>
<li pn="section-toc.1-1.2.2.2.2.3">
<t indent="0" pn="section-toc.1-1.2.2.2.2.3.1"><xref derivedContent="2.2.3" format="counter" sectionFormat="of" target="section-2.2.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-random-oracle-encodings">Random Oracle Encodings</xref></t>
</li>
<li pn="section-toc.1-1.2.2.2.2.4">
<t indent="0" pn="section-toc.1-1.2.2.2.2.4.1"><xref derivedContent="2.2.4" format="counter" sectionFormat="of" target="section-2.2.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-serialization">Serialization</xref></t>
</li>
<li pn="section-toc.1-1.2.2.2.2.5">
<t indent="0" pn="section-toc.1-1.2.2.2.2.5.1"><xref derivedContent="2.2.5" format="counter" sectionFormat="of" target="section-2.2.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-domain-separation">Domain Separation</xref></t>
</li>
</ul>
</li>
</ul>
</li>
<li pn="section-toc.1-1.3">
<t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-encoding-byte-strings-to-el">Encoding Byte Strings to Elliptic Curves</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
<li pn="section-toc.1-1.3.2.1">
<t indent="0" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-domain-separation-requireme">Domain Separation Requirements</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.4">
<t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-utility-functions">Utility Functions</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.4.2">
<li pn="section-toc.1-1.4.2.1">
<t indent="0" pn="section-toc.1-1.4.2.1.1"><xref derivedContent="4.1" format="counter" sectionFormat="of" target="section-4.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-the-sgn0-function">The sgn0 Function</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.5">
<t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-hashing-to-a-finite-field">Hashing to a Finite Field</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2">
<li pn="section-toc.1-1.5.2.1">
<t indent="0" pn="section-toc.1-1.5.2.1.1"><xref derivedContent="5.1" format="counter" sectionFormat="of" target="section-5.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-efficiency-considerations-i">Efficiency Considerations in Extension Fields</xref></t>
</li>
<li pn="section-toc.1-1.5.2.2">
<t indent="0" pn="section-toc.1-1.5.2.2.1"><xref derivedContent="5.2" format="counter" sectionFormat="of" target="section-5.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-hash_to_field-implementatio">hash_to_field Implementation</xref></t>
</li>
<li pn="section-toc.1-1.5.2.3">
<t indent="0" pn="section-toc.1-1.5.2.3.1"><xref derivedContent="5.3" format="counter" sectionFormat="of" target="section-5.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message">expand_message</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.5.2.3.2">
<li pn="section-toc.1-1.5.2.3.2.1">
<t indent="0" pn="section-toc.1-1.5.2.3.2.1.1"><xref derivedContent="5.3.1" format="counter" sectionFormat="of" target="section-5.3.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xmd">expand_message_xmd</xref></t>
</li>
<li pn="section-toc.1-1.5.2.3.2.2">
<t indent="0" pn="section-toc.1-1.5.2.3.2.2.1"><xref derivedContent="5.3.2" format="counter" sectionFormat="of" target="section-5.3.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xof">expand_message_xof</xref></t>
</li>
<li pn="section-toc.1-1.5.2.3.2.3">
<t indent="0" pn="section-toc.1-1.5.2.3.2.3.1"><xref derivedContent="5.3.3" format="counter" sectionFormat="of" target="section-5.3.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-using-dsts-longer-than-255-">Using DSTs Longer than 255 Bytes</xref></t>
</li>
<li pn="section-toc.1-1.5.2.3.2.4">
<t indent="0" pn="section-toc.1-1.5.2.3.2.4.1"><xref derivedContent="5.3.4" format="counter" sectionFormat="of" target="section-5.3.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-defining-other-expand_messa">Defining Other expand_message Variants</xref></t>
</li>
</ul>
</li>
</ul>
</li>
<li pn="section-toc.1-1.6">
<t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-deterministic-mappings">Deterministic Mappings</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2">
<li pn="section-toc.1-1.6.2.1">
<t indent="0" pn="section-toc.1-1.6.2.1.1"><xref derivedContent="6.1" format="counter" sectionFormat="of" target="section-6.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-choosing-a-mapping-function">Choosing a Mapping Function</xref></t>
</li>
<li pn="section-toc.1-1.6.2.2">
<t indent="0" pn="section-toc.1-1.6.2.2.1"><xref derivedContent="6.2" format="counter" sectionFormat="of" target="section-6.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-interface">Interface</xref></t>
</li>
<li pn="section-toc.1-1.6.2.3">
<t indent="0" pn="section-toc.1-1.6.2.3.1"><xref derivedContent="6.3" format="counter" sectionFormat="of" target="section-6.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-notation">Notation</xref></t>
</li>
<li pn="section-toc.1-1.6.2.4">
<t indent="0" pn="section-toc.1-1.6.2.4.1"><xref derivedContent="6.4" format="counter" sectionFormat="of" target="section-6.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-sign-of-the-resulting-point">Sign of the Resulting Point</xref></t>
</li>
<li pn="section-toc.1-1.6.2.5">
<t indent="0" pn="section-toc.1-1.6.2.5.1"><xref derivedContent="6.5" format="counter" sectionFormat="of" target="section-6.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-exceptional-cases">Exceptional Cases</xref></t>
</li>
<li pn="section-toc.1-1.6.2.6">
<t indent="0" pn="section-toc.1-1.6.2.6.1"><xref derivedContent="6.6" format="counter" sectionFormat="of" target="section-6.6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-mappings-for-weierstrass-cu">Mappings for Weierstrass Curves</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2.6.2">
<li pn="section-toc.1-1.6.2.6.2.1">
<t indent="0" pn="section-toc.1-1.6.2.6.2.1.1"><xref derivedContent="6.6.1" format="counter" sectionFormat="of" target="section-6.6.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-shallue-van-de-woestijne-me">Shallue-van de Woestijne Method</xref></t>
</li>
<li pn="section-toc.1-1.6.2.6.2.2">
<t indent="0" pn="section-toc.1-1.6.2.6.2.2.1"><xref derivedContent="6.6.2" format="counter" sectionFormat="of" target="section-6.6.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-simplified-shallue-van-de-w">Simplified Shallue-van de Woestijne-Ulas Method</xref></t>
</li>
<li pn="section-toc.1-1.6.2.6.2.3">
<t indent="0" pn="section-toc.1-1.6.2.6.2.3.1"><xref derivedContent="6.6.3" format="counter" sectionFormat="of" target="section-6.6.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-simplified-swu-for-ab-0">Simplified SWU for AB == 0</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.6.2.7">
<t indent="0" pn="section-toc.1-1.6.2.7.1"><xref derivedContent="6.7" format="counter" sectionFormat="of" target="section-6.7"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-mappings-for-montgomery-cur">Mappings for Montgomery Curves</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2.7.2">
<li pn="section-toc.1-1.6.2.7.2.1">
<t indent="0" pn="section-toc.1-1.6.2.7.2.1.1"><xref derivedContent="6.7.1" format="counter" sectionFormat="of" target="section-6.7.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-elligator-2-method">Elligator 2 Method</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.6.2.8">
<t indent="0" pn="section-toc.1-1.6.2.8.1"><xref derivedContent="6.8" format="counter" sectionFormat="of" target="section-6.8"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-mappings-for-twisted-edward">Mappings for Twisted Edwards Curves</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.6.2.8.2">
<li pn="section-toc.1-1.6.2.8.2.1">
<t indent="0" pn="section-toc.1-1.6.2.8.2.1.1"><xref derivedContent="6.8.1" format="counter" sectionFormat="of" target="section-6.8.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-rational-maps-from-montgome">Rational Maps from Montgomery to Twisted Edwards Curves</xref></t>
</li>
<li pn="section-toc.1-1.6.2.8.2.2">
<t indent="0" pn="section-toc.1-1.6.2.8.2.2.1"><xref derivedContent="6.8.2" format="counter" sectionFormat="of" target="section-6.8.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-elligator-2-method-2">Elligator 2 Method</xref></t>
</li>
</ul>
</li>
</ul>
</li>
<li pn="section-toc.1-1.7">
<t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-clearing-the-cofactor">Clearing the Cofactor</xref></t>
</li>
<li pn="section-toc.1-1.8">
<t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="8" format="counter" sectionFormat="of" target="section-8"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-hashing">Suites for Hashing</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2">
<li pn="section-toc.1-1.8.2.1">
<t indent="0" pn="section-toc.1-1.8.2.1.1"><xref derivedContent="8.1" format="counter" sectionFormat="of" target="section-8.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-implementing-a-hash-to-curv">Implementing a Hash-to-Curve Suite</xref></t>
</li>
<li pn="section-toc.1-1.8.2.2">
<t indent="0" pn="section-toc.1-1.8.2.2.1"><xref derivedContent="8.2" format="counter" sectionFormat="of" target="section-8.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-nist-p-256">Suites for NIST P-256</xref></t>
</li>
<li pn="section-toc.1-1.8.2.3">
<t indent="0" pn="section-toc.1-1.8.2.3.1"><xref derivedContent="8.3" format="counter" sectionFormat="of" target="section-8.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-nist-p-384">Suites for NIST P-384</xref></t>
</li>
<li pn="section-toc.1-1.8.2.4">
<t indent="0" pn="section-toc.1-1.8.2.4.1"><xref derivedContent="8.4" format="counter" sectionFormat="of" target="section-8.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-nist-p-521">Suites for NIST P-521</xref></t>
</li>
<li pn="section-toc.1-1.8.2.5">
<t indent="0" pn="section-toc.1-1.8.2.5.1"><xref derivedContent="8.5" format="counter" sectionFormat="of" target="section-8.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-curve25519-and-e">Suites for curve25519 and edwards25519</xref></t>
</li>
<li pn="section-toc.1-1.8.2.6">
<t indent="0" pn="section-toc.1-1.8.2.6.1"><xref derivedContent="8.6" format="counter" sectionFormat="of" target="section-8.6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-curve448-and-edw">Suites for curve448 and edwards448</xref></t>
</li>
<li pn="section-toc.1-1.8.2.7">
<t indent="0" pn="section-toc.1-1.8.2.7.1"><xref derivedContent="8.7" format="counter" sectionFormat="of" target="section-8.7"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-secp256k1">Suites for secp256k1</xref></t>
</li>
<li pn="section-toc.1-1.8.2.8">
<t indent="0" pn="section-toc.1-1.8.2.8.1"><xref derivedContent="8.8" format="counter" sectionFormat="of" target="section-8.8"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suites-for-bls12-381">Suites for BLS12-381</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.8.2.8.2">
<li pn="section-toc.1-1.8.2.8.2.1">
<t indent="0" pn="section-toc.1-1.8.2.8.2.1.1"><xref derivedContent="8.8.1" format="counter" sectionFormat="of" target="section-8.8.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12-381-g1">BLS12-381 G1</xref></t>
</li>
<li pn="section-toc.1-1.8.2.8.2.2">
<t indent="0" pn="section-toc.1-1.8.2.8.2.2.1"><xref derivedContent="8.8.2" format="counter" sectionFormat="of" target="section-8.8.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12-381-g2">BLS12-381 G2</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.8.2.9">
<t indent="0" pn="section-toc.1-1.8.2.9.1"><xref derivedContent="8.9" format="counter" sectionFormat="of" target="section-8.9"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-defining-a-new-hash-to-curv">Defining a New Hash-to-Curve Suite</xref></t>
</li>
<li pn="section-toc.1-1.8.2.10">
<t indent="0" pn="section-toc.1-1.8.2.10.1"><xref derivedContent="8.10" format="counter" sectionFormat="of" target="section-8.10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suite-id-naming-conventions">Suite ID Naming Conventions</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.9">
<t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="9" format="counter" sectionFormat="of" target="section-9"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
</li>
<li pn="section-toc.1-1.10">
<t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="10" format="counter" sectionFormat="of" target="section-10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.10.2">
<li pn="section-toc.1-1.10.2.1">
<t indent="0" pn="section-toc.1-1.10.2.1.1"><xref derivedContent="10.1" format="counter" sectionFormat="of" target="section-10.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-properties-of-encodings">Properties of Encodings</xref></t>
</li>
<li pn="section-toc.1-1.10.2.2">
<t indent="0" pn="section-toc.1-1.10.2.2.1"><xref derivedContent="10.2" format="counter" sectionFormat="of" target="section-10.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-hashing-passwords">Hashing Passwords</xref></t>
</li>
<li pn="section-toc.1-1.10.2.3">
<t indent="0" pn="section-toc.1-1.10.2.3.1"><xref derivedContent="10.3" format="counter" sectionFormat="of" target="section-10.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-constant-time-requirements">Constant-Time Requirements</xref></t>
</li>
<li pn="section-toc.1-1.10.2.4">
<t indent="0" pn="section-toc.1-1.10.2.4.1"><xref derivedContent="10.4" format="counter" sectionFormat="of" target="section-10.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-encode_to_curve-output-dist">encode_to_curve: Output Distribution and Indifferentiability</xref></t>
</li>
<li pn="section-toc.1-1.10.2.5">
<t indent="0" pn="section-toc.1-1.10.2.5.1"><xref derivedContent="10.5" format="counter" sectionFormat="of" target="section-10.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-hash_to_field-security">hash_to_field Security</xref></t>
</li>
<li pn="section-toc.1-1.10.2.6">
<t indent="0" pn="section-toc.1-1.10.2.6.1"><xref derivedContent="10.6" format="counter" sectionFormat="of" target="section-10.6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xmd-security">expand_message_xmd Security</xref></t>
</li>
<li pn="section-toc.1-1.10.2.7">
<t indent="0" pn="section-toc.1-1.10.2.7.1"><xref derivedContent="10.7" format="counter" sectionFormat="of" target="section-10.7"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-domain-separation-for-expan">Domain Separation for expand_message Variants</xref></t>
</li>
<li pn="section-toc.1-1.10.2.8">
<t indent="0" pn="section-toc.1-1.10.2.8.1"><xref derivedContent="10.8" format="counter" sectionFormat="of" target="section-10.8"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-target-security-levels">Target Security Levels</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.11">
<t indent="0" pn="section-toc.1-1.11.1"><xref derivedContent="11" format="counter" sectionFormat="of" target="section-11"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.11.2">
<li pn="section-toc.1-1.11.2.1">
<t indent="0" pn="section-toc.1-1.11.2.1.1"><xref derivedContent="11.1" format="counter" sectionFormat="of" target="section-11.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
</li>
<li pn="section-toc.1-1.11.2.2">
<t indent="0" pn="section-toc.1-1.11.2.2.1"><xref derivedContent="11.2" format="counter" sectionFormat="of" target="section-11.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.12">
<t indent="0" pn="section-toc.1-1.12.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-related-work">Related Work</xref></t>
</li>
<li pn="section-toc.1-1.13">
<t indent="0" pn="section-toc.1-1.13.1"><xref derivedContent="Appendix B" format="default" sectionFormat="of" target="section-appendix.b"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-hashing-to-ristretto255">Hashing to ristretto255</xref></t>
</li>
<li pn="section-toc.1-1.14">
<t indent="0" pn="section-toc.1-1.14.1"><xref derivedContent="Appendix C" format="default" sectionFormat="of" target="section-appendix.c"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-hashing-to-decaf448">Hashing to decaf448</xref></t>
</li>
<li pn="section-toc.1-1.15">
<t indent="0" pn="section-toc.1-1.15.1"><xref derivedContent="Appendix D" format="default" sectionFormat="of" target="section-appendix.d"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-rational-maps">Rational Maps</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.15.2">
<li pn="section-toc.1-1.15.2.1">
<t indent="0" pn="section-toc.1-1.15.2.1.1"><xref derivedContent="D.1" format="counter" sectionFormat="of" target="section-appendix.d.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-generic-mapping-from-montgo">Generic Mapping from Montgomery to Twisted Edwards</xref></t>
</li>
<li pn="section-toc.1-1.15.2.2">
<t indent="0" pn="section-toc.1-1.15.2.2.1"><xref derivedContent="D.2" format="counter" sectionFormat="of" target="section-appendix.d.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-mapping-from-weierstrass-to">Mapping from Weierstrass to Montgomery</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.16">
<t indent="0" pn="section-toc.1-1.16.1"><xref derivedContent="Appendix E" format="default" sectionFormat="of" target="section-appendix.e"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-isogeny-maps-for-suites">Isogeny Maps for Suites</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.16.2">
<li pn="section-toc.1-1.16.2.1">
<t indent="0" pn="section-toc.1-1.16.2.1.1"><xref derivedContent="E.1" format="counter" sectionFormat="of" target="section-appendix.e.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-3-isogeny-map-for-secp256k1">3-Isogeny Map for secp256k1</xref></t>
</li>
<li pn="section-toc.1-1.16.2.2">
<t indent="0" pn="section-toc.1-1.16.2.2.1"><xref derivedContent="E.2" format="counter" sectionFormat="of" target="section-appendix.e.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-11-isogeny-map-for-bls12-38">11-Isogeny Map for BLS12-381 G1</xref></t>
</li>
<li pn="section-toc.1-1.16.2.3">
<t indent="0" pn="section-toc.1-1.16.2.3.1"><xref derivedContent="E.3" format="counter" sectionFormat="of" target="section-appendix.e.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-3-isogeny-map-for-bls12-381">3-Isogeny Map for BLS12-381 G2</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.17">
<t indent="0" pn="section-toc.1-1.17.1"><xref derivedContent="Appendix F" format="default" sectionFormat="of" target="section-appendix.f"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-straight-line-implementatio">Straight-Line Implementations of Deterministic Mappings</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.17.2">
<li pn="section-toc.1-1.17.2.1">
<t indent="0" pn="section-toc.1-1.17.2.1.1"><xref derivedContent="F.1" format="counter" sectionFormat="of" target="section-appendix.f.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-shallue-van-de-woestijne-met">Shallue-van de Woestijne Method</xref></t>
</li>
<li pn="section-toc.1-1.17.2.2">
<t indent="0" pn="section-toc.1-1.17.2.2.1"><xref derivedContent="F.2" format="counter" sectionFormat="of" target="section-appendix.f.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-simplified-swu-method">Simplified SWU Method</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.17.2.2.2">
<li pn="section-toc.1-1.17.2.2.2.1">
<t indent="0" pn="section-toc.1-1.17.2.2.2.1.1"><xref derivedContent="F.2.1" format="counter" sectionFormat="of" target="section-appendix.f.2.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-sqrt_ratio-subroutine">sqrt_ratio Subroutine</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.17.2.3">
<t indent="0" pn="section-toc.1-1.17.2.3.1"><xref derivedContent="F.3" format="counter" sectionFormat="of" target="section-appendix.f.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-elligator-2-method-3">Elligator 2 Method</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.18">
<t indent="0" pn="section-toc.1-1.18.1"><xref derivedContent="Appendix G" format="default" sectionFormat="of" target="section-appendix.g"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve-specific-optimized-sa">Curve-Specific Optimized Sample Code</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.18.2">
<li pn="section-toc.1-1.18.2.1">
<t indent="0" pn="section-toc.1-1.18.2.1.1"><xref derivedContent="G.1" format="counter" sectionFormat="of" target="section-appendix.g.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-interface-and-projective-co">Interface and Projective Coordinate Systems</xref></t>
</li>
<li pn="section-toc.1-1.18.2.2">
<t indent="0" pn="section-toc.1-1.18.2.2.1"><xref derivedContent="G.2" format="counter" sectionFormat="of" target="section-appendix.g.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-elligator-2">Elligator 2</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.18.2.2.2">
<li pn="section-toc.1-1.18.2.2.2.1">
<t indent="0" pn="section-toc.1-1.18.2.2.2.1.1"><xref derivedContent="G.2.1" format="counter" sectionFormat="of" target="section-appendix.g.2.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve25519-q-5-mod-8-k-1">curve25519 (q = 5 (mod 8), K = 1)</xref></t>
</li>
<li pn="section-toc.1-1.18.2.2.2.2">
<t indent="0" pn="section-toc.1-1.18.2.2.2.2.1"><xref derivedContent="G.2.2" format="counter" sectionFormat="of" target="section-appendix.g.2.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards25519">edwards25519</xref></t>
</li>
<li pn="section-toc.1-1.18.2.2.2.3">
<t indent="0" pn="section-toc.1-1.18.2.2.2.3.1"><xref derivedContent="G.2.3" format="counter" sectionFormat="of" target="section-appendix.g.2.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve448-q-3-mod-4-k-1">curve448 (q = 3 (mod 4), K = 1)</xref></t>
</li>
<li pn="section-toc.1-1.18.2.2.2.4">
<t indent="0" pn="section-toc.1-1.18.2.2.2.4.1"><xref derivedContent="G.2.4" format="counter" sectionFormat="of" target="section-appendix.g.2.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards448">edwards448</xref></t>
</li>
<li pn="section-toc.1-1.18.2.2.2.5">
<t indent="0" pn="section-toc.1-1.18.2.2.2.5.1"><xref derivedContent="G.2.5" format="counter" sectionFormat="of" target="section-appendix.g.2.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-montgomery-curves-with-q-3-">Montgomery Curves with q = 3 (mod 4)</xref></t>
</li>
<li pn="section-toc.1-1.18.2.2.2.6">
<t indent="0" pn="section-toc.1-1.18.2.2.2.6.1"><xref derivedContent="G.2.6" format="counter" sectionFormat="of" target="section-appendix.g.2.6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-montgomery-curves-with-q-5-">Montgomery Curves with q = 5 (mod 8)</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.18.2.3">
<t indent="0" pn="section-toc.1-1.18.2.3.1"><xref derivedContent="G.3" format="counter" sectionFormat="of" target="section-appendix.g.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-cofactor-clearing-for-bls12">Cofactor Clearing for BLS12-381 G2</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.19">
<t indent="0" pn="section-toc.1-1.19.1"><xref derivedContent="Appendix H" format="default" sectionFormat="of" target="section-appendix.h"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-scripts-for-parameter-gener">Scripts for Parameter Generation</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.19.2">
<li pn="section-toc.1-1.19.2.1">
<t indent="0" pn="section-toc.1-1.19.2.1.1"><xref derivedContent="H.1" format="counter" sectionFormat="of" target="section-appendix.h.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-finding-z-for-the-shallue-v">Finding Z for the Shallue-van de Woestijne Map</xref></t>
</li>
<li pn="section-toc.1-1.19.2.2">
<t indent="0" pn="section-toc.1-1.19.2.2.1"><xref derivedContent="H.2" format="counter" sectionFormat="of" target="section-appendix.h.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-finding-z-for-simplified-sw">Finding Z for Simplified SWU</xref></t>
</li>
<li pn="section-toc.1-1.19.2.3">
<t indent="0" pn="section-toc.1-1.19.2.3.1"><xref derivedContent="H.3" format="counter" sectionFormat="of" target="section-appendix.h.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-finding-z-for-elligator-2">Finding Z for Elligator 2</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.20">
<t indent="0" pn="section-toc.1-1.20.1"><xref derivedContent="Appendix I" format="default" sectionFormat="of" target="section-appendix.i"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-sqrt-and-is_square-function">sqrt and is_square Functions</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.20.2">
<li pn="section-toc.1-1.20.2.1">
<t indent="0" pn="section-toc.1-1.20.2.1.1"><xref derivedContent="I.1" format="counter" sectionFormat="of" target="section-appendix.i.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-sqrt-for-q-3-mod-4">sqrt for q = 3 (mod 4)</xref></t>
</li>
<li pn="section-toc.1-1.20.2.2">
<t indent="0" pn="section-toc.1-1.20.2.2.1"><xref derivedContent="I.2" format="counter" sectionFormat="of" target="section-appendix.i.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-sqrt-for-q-5-mod-8">sqrt for q = 5 (mod 8)</xref></t>
</li>
<li pn="section-toc.1-1.20.2.3">
<t indent="0" pn="section-toc.1-1.20.2.3.1"><xref derivedContent="I.3" format="counter" sectionFormat="of" target="section-appendix.i.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-sqrt-for-q-9-mod-16">sqrt for q = 9 (mod 16)</xref></t>
</li>
<li pn="section-toc.1-1.20.2.4">
<t indent="0" pn="section-toc.1-1.20.2.4.1"><xref derivedContent="I.4" format="counter" sectionFormat="of" target="section-appendix.i.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-constant-time-tonelli-shank">Constant-Time Tonelli-Shanks Algorithm</xref></t>
</li>
<li pn="section-toc.1-1.20.2.5">
<t indent="0" pn="section-toc.1-1.20.2.5.1"><xref derivedContent="I.5" format="counter" sectionFormat="of" target="section-appendix.i.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-is_square-for-f-gfp2">is_square for F = GF(p^2)</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21">
<t indent="0" pn="section-toc.1-1.21.1"><xref derivedContent="Appendix J" format="default" sectionFormat="of" target="section-appendix.j"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-suite-test-vectors">Suite Test Vectors</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2">
<li pn="section-toc.1-1.21.2.1">
<t indent="0" pn="section-toc.1-1.21.2.1.1"><xref derivedContent="J.1" format="counter" sectionFormat="of" target="section-appendix.j.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-nist-p-256">NIST P-256</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.1.2">
<li pn="section-toc.1-1.21.2.1.2.1">
<t indent="0" pn="section-toc.1-1.21.2.1.2.1.1"><xref derivedContent="J.1.1" format="counter" sectionFormat="of" target="section-appendix.j.1.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-p256_xmdsha-256_sswu_ro_">P256_XMD:SHA-256_SSWU_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.1.2.2">
<t indent="0" pn="section-toc.1-1.21.2.1.2.2.1"><xref derivedContent="J.1.2" format="counter" sectionFormat="of" target="section-appendix.j.1.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-p256_xmdsha-256_sswu_nu_">P256_XMD:SHA-256_SSWU_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.2">
<t indent="0" pn="section-toc.1-1.21.2.2.1"><xref derivedContent="J.2" format="counter" sectionFormat="of" target="section-appendix.j.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-nist-p-384">NIST P-384</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.2.2">
<li pn="section-toc.1-1.21.2.2.2.1">
<t indent="0" pn="section-toc.1-1.21.2.2.2.1.1"><xref derivedContent="J.2.1" format="counter" sectionFormat="of" target="section-appendix.j.2.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-p384_xmdsha-384_sswu_ro_">P384_XMD:SHA-384_SSWU_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.2.2.2">
<t indent="0" pn="section-toc.1-1.21.2.2.2.2.1"><xref derivedContent="J.2.2" format="counter" sectionFormat="of" target="section-appendix.j.2.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-p384_xmdsha-384_sswu_nu_">P384_XMD:SHA-384_SSWU_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.3">
<t indent="0" pn="section-toc.1-1.21.2.3.1"><xref derivedContent="J.3" format="counter" sectionFormat="of" target="section-appendix.j.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-nist-p-521">NIST P-521</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.3.2">
<li pn="section-toc.1-1.21.2.3.2.1">
<t indent="0" pn="section-toc.1-1.21.2.3.2.1.1"><xref derivedContent="J.3.1" format="counter" sectionFormat="of" target="section-appendix.j.3.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-p521_xmdsha-512_sswu_ro_">P521_XMD:SHA-512_SSWU_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.3.2.2">
<t indent="0" pn="section-toc.1-1.21.2.3.2.2.1"><xref derivedContent="J.3.2" format="counter" sectionFormat="of" target="section-appendix.j.3.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-p521_xmdsha-512_sswu_nu_">P521_XMD:SHA-512_SSWU_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.4">
<t indent="0" pn="section-toc.1-1.21.2.4.1"><xref derivedContent="J.4" format="counter" sectionFormat="of" target="section-appendix.j.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve25519">curve25519</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.4.2">
<li pn="section-toc.1-1.21.2.4.2.1">
<t indent="0" pn="section-toc.1-1.21.2.4.2.1.1"><xref derivedContent="J.4.1" format="counter" sectionFormat="of" target="section-appendix.j.4.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve25519_xmdsha-512_ell2_">curve25519_XMD:SHA-512_ELL2_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.4.2.2">
<t indent="0" pn="section-toc.1-1.21.2.4.2.2.1"><xref derivedContent="J.4.2" format="counter" sectionFormat="of" target="section-appendix.j.4.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve25519_xmdsha-512_ell2_n">curve25519_XMD:SHA-512_ELL2_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.5">
<t indent="0" pn="section-toc.1-1.21.2.5.1"><xref derivedContent="J.5" format="counter" sectionFormat="of" target="section-appendix.j.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards25519-2">edwards25519</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.5.2">
<li pn="section-toc.1-1.21.2.5.2.1">
<t indent="0" pn="section-toc.1-1.21.2.5.2.1.1"><xref derivedContent="J.5.1" format="counter" sectionFormat="of" target="section-appendix.j.5.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards25519_xmdsha-512_ell">edwards25519_XMD:SHA-512_ELL2_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.5.2.2">
<t indent="0" pn="section-toc.1-1.21.2.5.2.2.1"><xref derivedContent="J.5.2" format="counter" sectionFormat="of" target="section-appendix.j.5.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards25519_xmdsha-512_ell2">edwards25519_XMD:SHA-512_ELL2_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.6">
<t indent="0" pn="section-toc.1-1.21.2.6.1"><xref derivedContent="J.6" format="counter" sectionFormat="of" target="section-appendix.j.6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve448">curve448</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.6.2">
<li pn="section-toc.1-1.21.2.6.2.1">
<t indent="0" pn="section-toc.1-1.21.2.6.2.1.1"><xref derivedContent="J.6.1" format="counter" sectionFormat="of" target="section-appendix.j.6.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve448_xofshake256_ell2_r">curve448_XOF:SHAKE256_ELL2_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.6.2.2">
<t indent="0" pn="section-toc.1-1.21.2.6.2.2.1"><xref derivedContent="J.6.2" format="counter" sectionFormat="of" target="section-appendix.j.6.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-curve448_xofshake256_ell2_n">curve448_XOF:SHAKE256_ELL2_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.7">
<t indent="0" pn="section-toc.1-1.21.2.7.1"><xref derivedContent="J.7" format="counter" sectionFormat="of" target="section-appendix.j.7"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards448-2">edwards448</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.7.2">
<li pn="section-toc.1-1.21.2.7.2.1">
<t indent="0" pn="section-toc.1-1.21.2.7.2.1.1"><xref derivedContent="J.7.1" format="counter" sectionFormat="of" target="section-appendix.j.7.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards448_xofshake256_ell2">edwards448_XOF:SHAKE256_ELL2_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.7.2.2">
<t indent="0" pn="section-toc.1-1.21.2.7.2.2.1"><xref derivedContent="J.7.2" format="counter" sectionFormat="of" target="section-appendix.j.7.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-edwards448_xofshake256_ell2_">edwards448_XOF:SHAKE256_ELL2_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.8">
<t indent="0" pn="section-toc.1-1.21.2.8.1"><xref derivedContent="J.8" format="counter" sectionFormat="of" target="section-appendix.j.8"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-secp256k1">secp256k1</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.8.2">
<li pn="section-toc.1-1.21.2.8.2.1">
<t indent="0" pn="section-toc.1-1.21.2.8.2.1.1"><xref derivedContent="J.8.1" format="counter" sectionFormat="of" target="section-appendix.j.8.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-secp256k1_xmdsha-256_sswu_r">secp256k1_XMD:SHA-256_SSWU_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.8.2.2">
<t indent="0" pn="section-toc.1-1.21.2.8.2.2.1"><xref derivedContent="J.8.2" format="counter" sectionFormat="of" target="section-appendix.j.8.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-secp256k1_xmdsha-256_sswu_n">secp256k1_XMD:SHA-256_SSWU_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.9">
<t indent="0" pn="section-toc.1-1.21.2.9.1"><xref derivedContent="J.9" format="counter" sectionFormat="of" target="section-appendix.j.9"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12-381-g1-2">BLS12-381 G1</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.9.2">
<li pn="section-toc.1-1.21.2.9.2.1">
<t indent="0" pn="section-toc.1-1.21.2.9.2.1.1"><xref derivedContent="J.9.1" format="counter" sectionFormat="of" target="section-appendix.j.9.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12381g1_xmdsha-256_sswu_">BLS12381G1_XMD:SHA-256_SSWU_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.9.2.2">
<t indent="0" pn="section-toc.1-1.21.2.9.2.2.1"><xref derivedContent="J.9.2" format="counter" sectionFormat="of" target="section-appendix.j.9.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12381g1_xmdsha-256_sswu_n">BLS12381G1_XMD:SHA-256_SSWU_NU_</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.21.2.10">
<t indent="0" pn="section-toc.1-1.21.2.10.1"><xref derivedContent="J.10" format="counter" sectionFormat="of" target="section-appendix.j.10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12-381-g2-2">BLS12-381 G2</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.21.2.10.2">
<li pn="section-toc.1-1.21.2.10.2.1">
<t indent="0" pn="section-toc.1-1.21.2.10.2.1.1"><xref derivedContent="J.10.1" format="counter" sectionFormat="of" target="section-appendix.j.10.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12381g2_xmdsha-256_sswu_">BLS12381G2_XMD:SHA-256_SSWU_RO_</xref></t>
</li>
<li pn="section-toc.1-1.21.2.10.2.2">
<t indent="0" pn="section-toc.1-1.21.2.10.2.2.1"><xref derivedContent="J.10.2" format="counter" sectionFormat="of" target="section-appendix.j.10.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-bls12381g2_xmdsha-256_sswu_n">BLS12381G2_XMD:SHA-256_SSWU_NU_</xref></t>
</li>
</ul>
</li>
</ul>
</li>
<li pn="section-toc.1-1.22">
<t indent="0" pn="section-toc.1-1.22.1"><xref derivedContent="Appendix K" format="default" sectionFormat="of" target="section-appendix.k"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand-test-vectors">Expand Test Vectors</xref></t>
<ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.22.2">
<li pn="section-toc.1-1.22.2.1">
<t indent="0" pn="section-toc.1-1.22.2.1.1"><xref derivedContent="K.1" format="counter" sectionFormat="of" target="section-appendix.k.1"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xmdsha-256">expand_message_xmd(SHA-256)</xref></t>
</li>
<li pn="section-toc.1-1.22.2.2">
<t indent="0" pn="section-toc.1-1.22.2.2.1"><xref derivedContent="K.2" format="counter" sectionFormat="of" target="section-appendix.k.2"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xmdsha-256-l">expand_message_xmd(SHA-256) (Long DST)</xref></t>
</li>
<li pn="section-toc.1-1.22.2.3">
<t indent="0" pn="section-toc.1-1.22.2.3.1"><xref derivedContent="K.3" format="counter" sectionFormat="of" target="section-appendix.k.3"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xmdsha-512">expand_message_xmd(SHA-512)</xref></t>
</li>
<li pn="section-toc.1-1.22.2.4">
<t indent="0" pn="section-toc.1-1.22.2.4.1"><xref derivedContent="K.4" format="counter" sectionFormat="of" target="section-appendix.k.4"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xofshake128">expand_message_xof(SHAKE128)</xref></t>
</li>
<li pn="section-toc.1-1.22.2.5">
<t indent="0" pn="section-toc.1-1.22.2.5.1"><xref derivedContent="K.5" format="counter" sectionFormat="of" target="section-appendix.k.5"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xofshake128-">expand_message_xof(SHAKE128) (Long DST)</xref></t>
</li>
<li pn="section-toc.1-1.22.2.6">
<t indent="0" pn="section-toc.1-1.22.2.6.1"><xref derivedContent="K.6" format="counter" sectionFormat="of" target="section-appendix.k.6"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-expand_message_xofshake256">expand_message_xof(SHAKE256)</xref></t>
</li>
</ul>
</li>
<li pn="section-toc.1-1.23">
<t indent="0" pn="section-toc.1-1.23.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.l"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
</li>
<li pn="section-toc.1-1.24">
<t indent="0" pn="section-toc.1-1.24.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.m"/><xref derivedContent="" format="title" sectionFormat="of" target="name-contributors">Contributors</xref></t>
</li>
<li pn="section-toc.1-1.25">
<t indent="0" pn="section-toc.1-1.25.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.n"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
</li>
</ul>
</section>
</toc>
</front>
<middle>
<section anchor="introduction" numbered="true" removeInRFC="false" toc="include" pn="section-1">
<name slugifiedName="name-introduction">Introduction</name>
<t indent="0" pn="section-1-1">Many cryptographic protocols require a procedure that encodes an arbitrary input,
e.g., a password, to a point on an elliptic curve. This procedure is known
as hashing to an elliptic curve, where the hashing procedure provides collision
resistance and does not reveal the discrete logarithm of the output point.
Prominent examples of cryptosystems that hash to elliptic curves include
password-authenticated key exchanges <xref target="BM92" format="default" sectionFormat="of" derivedContent="BM92"/> <xref target="J96" format="default" sectionFormat="of" derivedContent="J96"/> <xref target="BMP00" format="default" sectionFormat="of" derivedContent="BMP00"/> <xref target="p1363.2" format="default" sectionFormat="of" derivedContent="p1363.2"/>, Identity-Based
Encryption <xref target="BF01" format="default" sectionFormat="of" derivedContent="BF01"/>, Boneh-Lynn-Shacham signatures <xref target="BLS01" format="default" sectionFormat="of" derivedContent="BLS01"/> <xref target="I-D.irtf-cfrg-bls-signature" format="default" sectionFormat="of" derivedContent="BLS-SIG"/>,
Verifiable Random Functions <xref target="MRV99" format="default" sectionFormat="of" derivedContent="MRV99"/> <xref target="I-D.irtf-cfrg-vrf" format="default" sectionFormat="of" derivedContent="VRF"/>, and Oblivious Pseudorandom
Functions <xref target="NR97" format="default" sectionFormat="of" derivedContent="NR97"/> <xref target="I-D.irtf-cfrg-voprf" format="default" sectionFormat="of" derivedContent="OPRFs"/>.</t>
<t indent="0" pn="section-1-2">Unfortunately for implementors, the precise hash function that is suitable
for a given protocol implemented using a given elliptic curve is often unclear
from the protocol's description. Meanwhile, an incorrect choice of hash
function can have disastrous consequences for security.</t>
<t indent="0" pn="section-1-3">This document aims to bridge this gap by providing a comprehensive set of
recommended algorithms for a range of curve types.
Each algorithm conforms to a common interface: it takes as input an arbitrary-length
byte string and produces as output a point on an elliptic curve.
We provide implementation details for each algorithm, describe
the security rationale behind each recommendation, and give guidance for
elliptic curves that are not explicitly covered. We also present optimized
implementations for internal functions used by these algorithms.</t>
<t indent="0" pn="section-1-4">Readers wishing to quickly specify or implement a conforming hash function
should consult <xref target="suites" format="default" sectionFormat="of" derivedContent="Section 8"/>, which lists recommended hash-to-curve suites
and describes both how to implement an existing suite and how to specify
a new one.</t>
<t indent="0" pn="section-1-5">This document does not specify probabilistic rejection sampling methods, sometimes
referred to as "try-and-increment" or "hunt-and-peck," because the
goal is to specify algorithms that can plausibly be computed in
constant time. Use of these probabilistic rejection methods is <bcp14>NOT RECOMMENDED</bcp14>, because they have been a perennial cause of side-channel
vulnerabilities. See Dragonblood <xref target="VR20" format="default" sectionFormat="of" derivedContent="VR20"/> as one example of this
problem in practice, and see <xref target="related" format="default" sectionFormat="of" derivedContent="Appendix A"/> for an informal description of rejection
sampling methods and the timing side-channels they introduce.</t>
<t indent="0" pn="section-1-6">This document represents the consensus of the Crypto Forum Research Group (CFRG).</t>
<section anchor="requirements-notation" numbered="true" removeInRFC="false" toc="include" pn="section-1.1">
<name slugifiedName="name-requirements-notation">Requirements Notation</name>
<t indent="0" pn="section-1.1-1">The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
</section>
</section>
<section anchor="background" numbered="true" removeInRFC="false" toc="include" pn="section-2">
<name slugifiedName="name-background">Background</name>
<section anchor="bg-curves" numbered="true" removeInRFC="false" toc="include" pn="section-2.1">
<name slugifiedName="name-elliptic-curves">Elliptic Curves</name>
<t indent="0" pn="section-2.1-1">The following is a brief definition of elliptic curves, with an emphasis on
important parameters and their relation to hashing to curves.
For further reference on elliptic curves, consult <xref target="CFADLNV05" format="default" sectionFormat="of" derivedContent="CFADLNV05"/> or <xref target="W08" format="default" sectionFormat="of" derivedContent="W08"/>.</t>
<t indent="0" pn="section-2.1-2">Let F be the finite field GF(q) of prime characteristic p > 3.
(This document does not consider elliptic curves over fields of characteristic 2 or 3.)
In most cases, F is a prime field, so q = p.
Otherwise, F is an extension field, so q = p^m for an integer m > 1.
This document writes elements of extension fields
in a primitive element or polynomial basis, i.e., as a vector
of m elements of GF(p) written in ascending order by degree.
The entries of this vector are indexed in ascending order starting from 1,
i.e., x = (x_1, x_2, ..., x_m).
For example, if q = p^2 and the primitive element basis is (1, I),
then x = (a, b) corresponds to the element a + b * I, where
x_1 = a and x_2 = b.
(Note that all choices of basis are isomorphic, but certain choices may
result in a more efficient implementation; this document does not make
any particular assumptions about choice of basis.)</t>
<t indent="0" pn="section-2.1-3">An elliptic curve E is specified by an equation in two variables and a
finite field F. An elliptic curve equation takes one of several standard forms,
including (but not limited to) Weierstrass, Montgomery, and Edwards.</t>
<t indent="0" pn="section-2.1-4">The curve E induces an algebraic group of order n, meaning that the group
has n distinct elements.
(This document uses additive notation for the elliptic curve group operation.)
Elements of an elliptic curve group are points with affine coordinates (x, y)
satisfying the curve equation, where x and y are elements of F.
In addition, all elliptic curve groups have a distinguished element, the identity
point, which acts as the identity element for the group operation.
On certain curves (including Weierstrass and Montgomery curves), the identity
point cannot be represented as an (x, y) coordinate pair.</t>
<t indent="0" pn="section-2.1-5">For security reasons, cryptographic applications of elliptic curves generally require
using a (sub)group of prime order.
Let G be such a subgroup of the curve of prime order r, where n = h * r.
In this equation, h is an integer called the cofactor.
An algorithm that takes as input an arbitrary point on the curve E and
produces as output a point in the subgroup G of E is said to "clear
the cofactor." Such algorithms are discussed in <xref target="cofactor-clearing" format="default" sectionFormat="of" derivedContent="Section 7"/>.</t>
<t indent="0" pn="section-2.1-6">Certain hash-to-curve algorithms restrict the form of the curve equation, the
characteristic of the field, or the parameters of the curve. For each
algorithm presented, this document lists the relevant restrictions.</t>
<t indent="0" pn="section-2.1-7">The table below summarizes quantities relevant to hashing to curves:</t>
<table anchor="definition-table" align="center" pn="table-1">
<name slugifiedName="name-summary-of-symbols-and-thei">Summary of Symbols and Their Definitions</name>
<thead>
<tr>
<th align="center" colspan="1" rowspan="1">Symbol</th>
<th align="left" colspan="1" rowspan="1">Meaning</th>
<th align="left" colspan="1" rowspan="1">Relevance</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center" colspan="1" rowspan="1">F,q,p</td>
<td align="left" colspan="1" rowspan="1">A finite field F of characteristic p and #F = q = p^m.</td>
<td align="left" colspan="1" rowspan="1">For prime fields, q = p; otherwise, q = p^m and m>1.</td>
</tr>
<tr>
<td align="center" colspan="1" rowspan="1">E</td>
<td align="left" colspan="1" rowspan="1">Elliptic curve.</td>
<td align="left" colspan="1" rowspan="1">E is specified by an equation and a field F.</td>
</tr>
<tr>
<td align="center" colspan="1" rowspan="1">n</td>
<td align="left" colspan="1" rowspan="1">Number of points on the elliptic curve E.</td>
<td align="left" colspan="1" rowspan="1">n = h * r, for h and r defined below.</td>
</tr>
<tr>
<td align="center" colspan="1" rowspan="1">G</td>
<td align="left" colspan="1" rowspan="1">A prime-order subgroup of the points on E.</td>
<td align="left" colspan="1" rowspan="1">G is a destination group to which byte strings are encoded.</td>
</tr>
<tr>
<td align="center" colspan="1" rowspan="1">r</td>
<td align="left" colspan="1" rowspan="1">Order of G.</td>
<td align="left" colspan="1" rowspan="1">r is a prime factor of n (usually, the largest such factor).</td>
</tr>
<tr>
<td align="center" colspan="1" rowspan="1">h</td>
<td align="left" colspan="1" rowspan="1">Cofactor, h >= 1.</td>
<td align="left" colspan="1" rowspan="1">h is an integer satisfying n = h * r.</td>
</tr>
</tbody>
</table>
</section>
<section anchor="terminology" numbered="true" removeInRFC="false" toc="include" pn="section-2.2">
<name slugifiedName="name-terminology">Terminology</name>
<t indent="0" pn="section-2.2-1">In this section, we define important terms used throughout the document.</t>
<section anchor="term-mapping" numbered="true" removeInRFC="false" toc="include" pn="section-2.2.1">
<name slugifiedName="name-mappings">Mappings</name>
<t indent="0" pn="section-2.2.1-1">A mapping is a deterministic function from an element of the field F to a point
on an elliptic curve E defined over F.</t>
<t indent="0" pn="section-2.2.1-2">In general, the set of all points that a mapping can produce over all
possible inputs may be only a subset of the points on an elliptic curve
(i.e., the mapping may not be surjective).
In addition, a mapping may output the same point for two or more distinct inputs
(i.e., the mapping may not be injective).
For example, consider a mapping from F to an elliptic curve having n points:
if the number of elements of F is not equal to n,
then this mapping cannot be bijective (i.e., both injective and surjective),
since the mapping is defined to be deterministic.</t>
<t indent="0" pn="section-2.2.1-3">Mappings may also be invertible, meaning that there is an efficient algorithm
that, for any point P output by the mapping, outputs an x in F such that
applying the mapping to x outputs P.
Some of the mappings given in <xref target="mappings" format="default" sectionFormat="of" derivedContent="Section 6"/> are invertible, but this
document does not discuss inversion algorithms.</t>
</section>
<section anchor="term-encoding" numbered="true" removeInRFC="false" toc="include" pn="section-2.2.2">
<name slugifiedName="name-encodings">Encodings</name>
<t indent="0" pn="section-2.2.2-1">Encodings are closely related to mappings.
Like a mapping, an encoding is a function that outputs a point on an elliptic curve.
In contrast to a mapping, however, the input to an encoding is an arbitrary-length
byte string.</t>
<t indent="0" pn="section-2.2.2-2">This document constructs deterministic encodings by composing a hash function Hf
with a deterministic mapping.
In particular, Hf takes as input an arbitrary string and outputs an element of F.
The deterministic mapping takes that element as input and outputs a point on an
elliptic curve E defined over F.
Since Hf takes arbitrary-length byte strings as inputs, it cannot be injective:
the set of inputs is larger than the set of outputs, so there must
be distinct inputs that give the same output (i.e., there must be collisions).
Thus, any encoding built from Hf is also not injective.</t>
<t indent="0" pn="section-2.2.2-3">Like mappings, encodings may be invertible, meaning that there is an
efficient algorithm that, for any point P output by the encoding,
outputs a string s such that applying the encoding to s outputs P.
However, the instantiation of Hf used by all encodings specified in
this document (<xref target="hashtofield" format="default" sectionFormat="of" derivedContent="Section 5"/>) is not invertible; thus, those encodings
are also not invertible.</t>
<t indent="0" pn="section-2.2.2-4">In some applications of hashing to elliptic curves, it is important that
encodings do not leak information through side channels.
<xref target="VR20" format="default" sectionFormat="of" derivedContent="VR20"/> is one example of this type of leakage leading to a security vulnerability.
See <xref target="security-considerations-constant" format="default" sectionFormat="of" derivedContent="Section 10.3"/> for further discussion.</t>
</section>
<section anchor="term-rom" numbered="true" removeInRFC="false" toc="include" pn="section-2.2.3">
<name slugifiedName="name-random-oracle-encodings">Random Oracle Encodings</name>
<t indent="0" pn="section-2.2.3-1">A random-oracle encoding satisfies a strong property: it can be proved
indifferentiable from a random oracle <xref target="MRH04" format="default" sectionFormat="of" derivedContent="MRH04"/> under a suitable assumption.</t>
<t indent="0" pn="section-2.2.3-2">Both constructions described in <xref target="roadmap" format="default" sectionFormat="of" derivedContent="Section 3"/> are indifferentiable from
random oracles <xref target="MRH04" format="default" sectionFormat="of" derivedContent="MRH04"/> when instantiated following the guidelines in this document.
The constructions differ in their output distributions: one gives a uniformly random
point on the curve, the other gives a point sampled from a nonuniform distribution.</t>
<t indent="0" pn="section-2.2.3-3">A random-oracle encoding with a uniform output distribution is suitable for use
in many cryptographic protocols proven secure in the random-oracle model.
See <xref target="security-considerations-props" format="default" sectionFormat="of" derivedContent="Section 10.1"/> for further discussion.</t>
</section>
<section anchor="term-serialization" numbered="true" removeInRFC="false" toc="include" pn="section-2.2.4">
<name slugifiedName="name-serialization">Serialization</name>
<t indent="0" pn="section-2.2.4-1">A procedure related to encoding is the conversion of an elliptic curve point to a bit string.
This is called serialization, and it is typically used for compactly storing or transmitting points.
The inverse operation, deserialization, converts a bit string to an elliptic curve point.
For example, <xref target="SEC1" format="default" sectionFormat="of" derivedContent="SEC1"/> and <xref target="p1363a" format="default" sectionFormat="of" derivedContent="p1363a"/> give standard methods for serialization and deserialization.</t>
<t indent="0" pn="section-2.2.4-2">Deserialization is different from encoding in that only certain strings
(namely, those output by the serialization procedure) can be deserialized.
In contrast, this document is concerned with encodings from arbitrary strings
to elliptic curve points.
This document does not cover serialization or deserialization.</t>
</section>
<section anchor="term-domain-separation" numbered="true" removeInRFC="false" toc="include" pn="section-2.2.5">
<name slugifiedName="name-domain-separation">Domain Separation</name>
<t indent="0" pn="section-2.2.5-1">Cryptographic protocols proven secure in the random-oracle model are often analyzed
under the assumption that the random oracle only answers queries associated
with that protocol (including queries made by adversaries) <xref target="BR93" format="default" sectionFormat="of" derivedContent="BR93"/>.
In practice, this assumption does not hold if two protocols use the
same function to instantiate the random oracle.
Concretely, consider protocols P1 and P2 that query a random-oracle RO:
if P1 and P2 both query RO on the same value x, the security analysis of
one or both protocols may be invalidated.</t>
<t indent="0" pn="section-2.2.5-2">A common way of addressing this issue is called domain separation,
which allows a single random oracle to simulate multiple, independent oracles.
This is effected by ensuring that each simulated oracle sees queries that are
distinct from those seen by all other simulated oracles.
For example, to simulate two oracles RO1 and RO2 given a single oracle RO,
one might define</t>
<artwork align="left" pn="section-2.2.5-3">
RO1(x) := RO("RO1" || x)
RO2(x) := RO("RO2" || x)
</artwork>
<t indent="0" pn="section-2.2.5-4">where || is the concatenation operator.
In this example, "RO1" and "RO2" are called domain separation tags (DSTs);
they ensure that queries to RO1 and RO2 cannot result in identical
queries to RO, meaning that it is safe to treat RO1 and RO2 as
independent oracles.</t>
<t indent="0" pn="section-2.2.5-5">In general, domain separation requires defining a distinct injective
encoding for each oracle being simulated.
In the above example, "RO1" and "RO2" have the same length and thus
satisfy this requirement when used as prefixes.
The algorithms specified in this document take a different approach to ensuring
injectivity; see Sections <xref format="counter" target="hashtofield-expand" sectionFormat="of" derivedContent="5.3"/> and <xref format="counter" target="security-considerations-domain-separation-expmsg-var" sectionFormat="of" derivedContent="10.7"/>
for more details.</t>
</section>
</section>
</section>
<section anchor="roadmap" numbered="true" removeInRFC="false" toc="include" pn="section-3">
<name slugifiedName="name-encoding-byte-strings-to-el">Encoding Byte Strings to Elliptic Curves</name>
<t indent="0" pn="section-3-1">This section presents a general framework and interface for encoding byte strings
to points on an elliptic curve. The constructions in this section rely on three
basic functions:</t>
<ul spacing="normal" bare="false" empty="false" indent="3" pn="section-3-2">
<li pn="section-3-2.1">
<t indent="0" pn="section-3-2.1.1">The function hash_to_field hashes arbitrary-length byte strings to a list
of one or more elements of a finite field F; its implementation is defined in
<xref target="hashtofield" format="default" sectionFormat="of" derivedContent="Section 5"/>. </t>
<sourcecode type="pseudocode" markers="false" pn="section-3-2.1.2">
hash_to_field(msg, count)
Input:
- msg, a byte string containing the message to hash.
- count, the number of elements of F to output.
Output:
- (u_0, ..., u_(count - 1)), a list of field elements.
Steps: defined in Section 5.
</sourcecode>
</li>
<li pn="section-3-2.2">
<t indent="0" pn="section-3-2.2.1">The function map_to_curve calculates a point on the elliptic curve E
from an element of the finite field F over which E is defined.
<xref target="mappings" format="default" sectionFormat="of" derivedContent="Section 6"/> describes mappings for a range of curve families. </t>
<sourcecode type="pseudocode" markers="false" pn="section-3-2.2.2">
map_to_curve(u)
Input: u, an element of field F.
Output: Q, a point on the elliptic curve E.
Steps: defined in Section 6.
</sourcecode>
</li>
<li pn="section-3-2.3">
<t indent="0" pn="section-3-2.3.1">The function clear_cofactor sends any point on the curve E to
the subgroup G of E. <xref target="cofactor-clearing" format="default" sectionFormat="of" derivedContent="Section 7"/> describes methods to perform
this operation. </t>
<sourcecode type="pseudocode" markers="false" pn="section-3-2.3.2">
clear_cofactor(Q)
Input: Q, a point on the elliptic curve E.
Output: P, a point in G.
Steps: defined in Section 7.
</sourcecode>
</li>
</ul>
<t indent="0" pn="section-3-3">The two encodings (<xref target="term-encoding" format="default" sectionFormat="of" derivedContent="Section 2.2.2"/>) defined in this section have the
same interface and are both random-oracle encodings (<xref target="term-rom" format="default" sectionFormat="of" derivedContent="Section 2.2.3"/>).
Both are implemented as a composition of the three basic functions above.
The difference between the two is that their outputs are sampled from
different distributions:</t>
<ul spacing="normal" bare="false" empty="false" indent="3" pn="section-3-4">
<li pn="section-3-4.1">
<t indent="0" pn="section-3-4.1.1">encode_to_curve is a nonuniform encoding from byte strings to points in G.
That is, the distribution of its output is not uniformly random in G:
the set of possible outputs of encode_to_curve is only a fraction of the
points in G, and some points in this set are more likely to be output than others.
<xref target="security-considerations-encode" format="default" sectionFormat="of" derivedContent="Section 10.4"/> gives a more precise definition of
encode_to_curve's output distribution. </t>
<sourcecode type="pseudocode" markers="false" pn="section-3-4.1.2">
encode_to_curve(msg)
Input: msg, an arbitrary-length byte string.
Output: P, a point in G.
Steps:
1. u = hash_to_field(msg, 1)
2. Q = map_to_curve(u[0])
3. P = clear_cofactor(Q)
4. return P
</sourcecode>
</li>
<li pn="section-3-4.2">
<t indent="0" pn="section-3-4.2.1">hash_to_curve is a uniform encoding from byte strings to points in G.
That is, the distribution of its output is statistically close to uniform in G. </t>
<t indent="0" pn="section-3-4.2.2">
This function is suitable for most applications requiring a random oracle
returning points in G, when instantiated with any of the map_to_curve
functions described in <xref target="mappings" format="default" sectionFormat="of" derivedContent="Section 6"/>.
See <xref target="security-considerations-props" format="default" sectionFormat="of" derivedContent="Section 10.1"/> for further discussion. </t>
<sourcecode type="pseudocode" markers="false" pn="section-3-4.2.3">
hash_to_curve(msg)
Input: msg, an arbitrary-length byte string.
Output: P, a point in G.
Steps:
1. u = hash_to_field(msg, 2)
2. Q0 = map_to_curve(u[0])
3. Q1 = map_to_curve(u[1])
4. R = Q0 + Q1 # Point addition
5. P = clear_cofactor(R)
6. return P
</sourcecode>
</li>
</ul>
<t indent="0" pn="section-3-5">Each hash-to-curve suite in <xref target="suites" format="default" sectionFormat="of" derivedContent="Section 8"/> instantiates one of these encoding
functions for a specific elliptic curve.</t>
<section anchor="domain-separation" numbered="true" removeInRFC="false" toc="include" pn="section-3.1">
<name slugifiedName="name-domain-separation-requireme">Domain Separation Requirements</name>
<t indent="0" pn="section-3.1-1">All uses of the encoding functions defined in this document <bcp14>MUST</bcp14> include
domain separation (<xref target="term-domain-separation" format="default" sectionFormat="of" derivedContent="Section 2.2.5"/>) to avoid interfering with
other uses of similar functionality.</t>
<t indent="0" pn="section-3.1-2">Applications that instantiate multiple, independent instances of either
hash_to_curve or encode_to_curve <bcp14>MUST</bcp14> enforce domain separation
between those instances.
This requirement applies in both the case of multiple instances targeting
the same curve and the case of multiple instances targeting different curves.
(This is because the internal hash_to_field primitive (<xref target="hashtofield" format="default" sectionFormat="of" derivedContent="Section 5"/>)
requires domain separation to guarantee independent outputs.)</t>
<t indent="0" pn="section-3.1-3">Domain separation is enforced with a domain separation tag (DST),
which is a byte string constructed according to the following requirements:</t>
<ol spacing="normal" type="1" indent="adaptive" start="1" pn="section-3.1-4"><li pn="section-3.1-4.1" derivedCounter="1.">Tags <bcp14>MUST</bcp14> be supplied as the DST parameter to hash_to_field, as
described in <xref target="hashtofield" format="default" sectionFormat="of" derivedContent="Section 5"/>.</li>
<li pn="section-3.1-4.2" derivedCounter="2.">Tags <bcp14>MUST</bcp14> have nonzero length. A minimum length of 16 bytes
is <bcp14>RECOMMENDED</bcp14> to reduce the chance of collisions with other
applications.</li>
<li pn="section-3.1-4.3" derivedCounter="3.">Tags <bcp14>SHOULD</bcp14> begin with a fixed identification string
that is unique to the application.</li>
<li pn="section-3.1-4.4" derivedCounter="4.">Tags <bcp14>SHOULD</bcp14> include a version number.</li>
<li pn="section-3.1-4.5" derivedCounter="5.">For applications that define multiple ciphersuites, each ciphersuite's
tag <bcp14>MUST</bcp14> be different. For this purpose, it is <bcp14>RECOMMENDED</bcp14> to
include a ciphersuite identifier in each tag.</li>
<li pn="section-3.1-4.6" derivedCounter="6.">For applications that use multiple encodings, to either the same curve
or different curves, each encoding <bcp14>MUST</bcp14> use a different tag.
For this purpose, it is <bcp14>RECOMMENDED</bcp14> to include the encoding's
Suite ID (<xref target="suites" format="default" sectionFormat="of" derivedContent="Section 8"/>) in the domain separation tag.
For independent encodings based on the same suite, each tag <bcp14>SHOULD</bcp14>
also include a distinct identifier, e.g., "ENC1" and "ENC2".</li>
</ol>
<t indent="0" pn="section-3.1-5">As an example, consider a fictional application named Quux
that defines several different ciphersuites, each for a different curve.
A reasonable choice of tag is "QUUX-V<xx>-CS<yy>-<suiteID>", where
<xx> and <yy> are two-digit numbers indicating the version and
ciphersuite, respectively, and <suiteID> is the Suite ID of the
encoding used in ciphersuite <yy>.</t>
<t indent="0" pn="section-3.1-6">As another example, consider a fictional application named Baz that requires
two independent random oracles to the same curve.
Reasonable choices of tags for these oracles are
"BAZ-V<xx>-CS<yy>-<suiteID>-ENC1" and "BAZ-V<xx>-CS<yy>-<suiteID>-ENC2",
respectively, where <xx>, <yy>, and <suiteID> are as described above.</t>
<t indent="0" pn="section-3.1-7">The example tags given above are assumed to be ASCII-encoded byte strings
without null termination, which is the <bcp14>RECOMMENDED</bcp14> format. Other encodings
can be used, but in all cases the encoding as a sequence of bytes <bcp14>MUST</bcp14> be
specified unambiguously.</t>
</section>
</section>
<section anchor="utility" numbered="true" removeInRFC="false" toc="include" pn="section-4">
<name slugifiedName="name-utility-functions">Utility Functions</name>