@@ -1151,7 +1151,8 @@ as "try-and-increment" or "hunt-and-peck," because the goal is to describe
1151
1151
algorithms that can plausibly be computed in constant time. Use of these rejection
1152
1152
methods is NOT RECOMMENDED, because they have been a perennial cause of
1153
1153
side-channel vulnerabilities. See Dragonblood {{VR20}} as one example of this
1154
- problem in practice.
1154
+ problem in practice, and see {{related}} for a further description of
1155
+ rejection sampling methods.
1155
1156
1156
1157
This document represents the consensus of the Crypto Forum Research Group (CFRG).
1157
1158
@@ -1272,7 +1273,7 @@ is not invertible. Thus, the encodings are also not invertible.
1272
1273
In some applications of hashing to elliptic curves, it is important that
1273
1274
encodings do not leak information through side channels.
1274
1275
{{VR20}} is one example of this type of leakage leading to a security vulnerability.
1275
- See {{security-considerations}} for further discussion.
1276
+ See {{security-considerations-constant }} for further discussion.
1276
1277
1277
1278
# ## Random oracle encodings {#term-rom}
1278
1279
@@ -1286,7 +1287,7 @@ point on the curve, the other gives a point sampled from a nonuniform distributi
1286
1287
1287
1288
A random-oracle encoding with a uniform output distribution is suitable for use
1288
1289
in many cryptographic protocols proven secure in the random oracle model.
1289
- See {{security-considerations}} for further discussion.
1290
+ See {{security-considerations-props }} for further discussion.
1290
1291
1291
1292
# ## Serialization {#term-serialization}
1292
1293
@@ -1333,7 +1334,7 @@ encoding for each oracle being simulated.
1333
1334
In the above example, "RO1" and "RO2" have the same length and thus
1334
1335
satisfy this requirement when used as prefixes.
1335
1336
The algorithms specified in this document take a different approach to ensuring
1336
- injectivity; see {{hashtofield-expand}} and {{security-considerations-domain-separation}}
1337
+ injectivity; see {{hashtofield-expand}} and {{security-considerations-domain-separation-expmsg-var }}
1337
1338
for more details.
1338
1339
1339
1340
# Encoding byte strings to elliptic curves {#roadmap}
@@ -1415,7 +1416,7 @@ different distributions:
1415
1416
This function is suitable for most applications requiring a random oracle
1416
1417
returning points in G, when instantiated with any of the map\_to\_curve
1417
1418
functions described in {{mappings}}.
1418
- See {{security-considerations}} for further discussion.
1419
+ See {{security-considerations-props }} for further discussion.
1419
1420
1420
1421
~~~ pseudocode
1421
1422
hash_to_curve(msg)
@@ -1505,7 +1506,7 @@ in brief, this means that execution time and memory access patterns SHOULD NOT
1505
1506
depend on the values of secret inputs, intermediate values, or outputs.
1506
1507
For such constant-time implementations, all arithmetic, comparisons, and
1507
1508
assignments MUST also be implemented in constant time.
1508
- {{security-considerations}} briefly discusses constant-time security issues.
1509
+ {{security-considerations-constant }} briefly discusses constant-time security issues.
1509
1510
1510
1511
Guidance on implementing low-level operations (in constant time or otherwise)
1511
1512
is beyond the scope of this document; readers should consult standard reference
@@ -1673,11 +1674,10 @@ For example, when hashing to the scalar field for an elliptic curve (sub)group
1673
1674
with prime order r, it suffices to instantiate hash\_to\_field with target field
1674
1675
GF(r).
1675
1676
1676
- # # Security considerations {#hashtofield-sec}
1677
-
1678
1677
The hash\_to\_field function is designed to be indifferentiable from a
1679
1678
random oracle {{MRH04}} when expand\_message ({{hashtofield-expand}})
1680
- is modeled as a random oracle (see {{security-considerations-hash-to-field}}).
1679
+ is modeled as a random oracle (see {{security-considerations-hash-to-field}}
1680
+ for details about its indifferentiability).
1681
1681
Ensuring indifferentiability requires care; to see why, consider a prime
1682
1682
p that is close to 3/4 * 2^256.
1683
1683
Reducing a random 256-bit integer modulo this p yields a value that is in
@@ -1696,7 +1696,7 @@ L uniform bytes, where
1696
1696
L = ceil((ceil(log2(p)) + k) / 8)
1697
1697
~~~
1698
1698
1699
- These uniform bytes are then interpreted as an integer via OS2IP {{RFC8017}} .
1699
+ These uniform bytes are then interpreted as an integer via OS2IP.
1700
1700
For example, for a 255-bit prime p, and k = 128-bit security,
1701
1701
L = ceil((255 + 128) / 8) = 48 bytes.
1702
1702
@@ -1713,7 +1713,7 @@ field GF(p^m), hash\_to\_field requires expanding msg into m * L bytes (for L as
1713
1713
For extension fields where log2(p) is significantly smaller than the security
1714
1714
level k, this approach is inefficient : it requires expand\_message to output
1715
1715
roughly m * log2(p) + m * k bits, whereas m * log2(p) + k bytes suffices to
1716
- generate an element of GF(p^m) with bias at most 2^-k. In such cases, an
1716
+ generate an element of GF(p^m) with bias at most 2^-k. In such cases,
1717
1717
applications MAY use an alternative hash\_to\_field function, provided it
1718
1718
meets the following security requirements :
1719
1719
@@ -1748,7 +1748,7 @@ Parameters:
1748
1748
parameter of the suite (e.g., k = 128).
1749
1749
- expand_message, a function that expands a byte string and
1750
1750
domain separation tag into a uniformly random byte string
1751
- (see Section 5.4 ).
1751
+ (see Section 5.3 ).
1752
1752
1753
1753
Inputs :
1754
1754
- msg, a byte string containing the message to hash.
@@ -2435,7 +2435,7 @@ When a curve admits a fast cofactor clearing method, clear\_cofactor
2435
2435
MAY be evaluated either via that method or via scalar multiplication
2436
2436
by the equivalent h\_eff; these two methods give the same result.
2437
2437
Note that in this case scalar multiplication by the cofactor h does not
2438
- generally give the same result as the fast method, and SHOULD NOT be used.
2438
+ generally give the same result as the fast method, and MUST NOT be used.
2439
2439
2440
2440
# Suites for hashing {#suites}
2441
2441
@@ -2465,7 +2465,7 @@ A hash-to-curve suite comprises the following parameters:
2465
2465
the polynomial basis used to represent extension field elements.
2466
2466
- k, the target security level of the suite in bits.
2467
2467
(See {{security-considerations-targets}} for discussion.)
2468
- - L, the length parameter for hash\_to\_field ({{hashtofield-sec }}).
2468
+ - L, the length parameter for hash\_to\_field ({{hashtofield}}).
2469
2469
- expand\_message, one of the variants specified in {{hashtofield-expand}}
2470
2470
plus any parameters required for the specified variant (for example, H,
2471
2471
the underlying hash function).
@@ -2604,7 +2604,7 @@ to P-521 is given in {{straightline-sswu}}.
2604
2604
# # Suites for curve25519 and edwards25519 {#suites-25519}
2605
2605
2606
2606
This section defines ciphersuites for curve25519 and edwards25519 {{!RFC7748}}.
2607
- Note that these ciphersuites SHOULD NOT be used when hashing to ristretto255
2607
+ Note that these ciphersuites MUST NOT be used when hashing to ristretto255
2608
2608
{{?I-D.irtf-cfrg-ristretto255-decaf448}}.
2609
2609
See {{appx-ristretto255}} for information on how to hash to that group.
2610
2610
@@ -2646,7 +2646,7 @@ Optimized example implementations of the above mappings are given in
2646
2646
# # Suites for curve448 and edwards448 {#suites-448}
2647
2647
2648
2648
This section defines ciphersuites for curve448 and edwards448 {{!RFC7748}}.
2649
- Note that these ciphersuites SHOULD NOT be used when hashing to decaf448
2649
+ Note that these ciphersuites MUST NOT be used when hashing to decaf448
2650
2650
{{I-D.irtf-cfrg-ristretto255-decaf448}}.
2651
2651
See {{appx-decaf448}} for information on how to hash to that group.
2652
2652
@@ -2783,7 +2783,8 @@ to the curve E' isogenous to BLS12-381 G2 is given in {{straightline-sswu}}.
2783
2783
2784
2784
# # Defining a new hash-to-curve suite {#new-suite}
2785
2785
2786
- The RECOMMENDED way to define a new hash-to-curve suite is :
2786
+ For elliptic curves not listed elsewhere in {{suites}}, a new hash-to-curve
2787
+ suite can be defined by :
2787
2788
2788
2789
1. E, F, p, and m are determined by the elliptic curve and its base field.
2789
2790
@@ -2794,7 +2795,7 @@ The RECOMMENDED way to define a new hash-to-curve suite is:
2794
2795
2795
2796
3. Choose encoding type, either hash\_to\_curve or encode\_to\_curve ({{roadmap}}).
2796
2797
2797
- 4. Compute L as described in {{hashtofield-sec }}.
2798
+ 4. Compute L as described in {{hashtofield}}.
2798
2799
2799
2800
5. Choose an expand\_message variant from {{hashtofield-expand}} plus any
2800
2801
underlying cryptographic primitives (e.g., a hash function H).
@@ -2808,9 +2809,6 @@ The RECOMMENDED way to define a new hash-to-curve suite is:
2808
2809
2809
2810
8. Construct a Suite ID following the guidelines in {{suiteIDformat}}.
2810
2811
2811
- When hashing to an elliptic curve not listed in this section, corresponding
2812
- hash-to-curve suites SHOULD be fully specified as described above.
2813
-
2814
2812
# # Suite ID naming conventions {#suiteIDformat}
2815
2813
2816
2814
Suite IDs MUST be constructed as follows :
@@ -2886,12 +2884,10 @@ This document has no IANA actions.
2886
2884
2887
2885
# Security considerations {#security-considerations}
2888
2886
2889
- {{domain-separation}} describes considerations related to domain separation.
2890
- See {{security-considerations-domain-separation}} for further discussion .
2887
+ This section contains additional security considerations about the hash-to-curve mechanisms
2888
+ described in this document .
2891
2889
2892
- {{hashtofield}} describes considerations for uniformly hashing to field elements;
2893
- see {{security-considerations-hash-to-field}} and {{security-considerations-expand-xmd}}
2894
- for further discussion.
2890
+ # # Properties of encodings {#security-considerations-props}
2895
2891
2896
2892
Each encoding type ({{roadmap}}) accepts an arbitrary byte string and maps
2897
2893
it to a point on the curve sampled from a distribution that depends on the
@@ -2928,6 +2924,8 @@ by indifferentiable functionalities.
2928
2924
This limitation should be considered when analyzing the security of protocols
2929
2925
relying on the hash\_to\_curve function.
2930
2926
2927
+ # # Hashing passwords {#security-considerations-passwords}
2928
+
2931
2929
When hashing passwords using any function described in this document, an adversary
2932
2930
who learns the output of the hash function (or potentially any intermediate value,
2933
2931
e.g., the output of hash\_to\_field) may be able to carry out a dictionary attack.
@@ -2938,6 +2936,8 @@ function to the target elliptic curve.
2938
2936
For collision resistance, the hash underlying the key derivation function
2939
2937
should be chosen according to the guidelines listed in {{hashtofield-expand-xmd}}.
2940
2938
2939
+ # # Constant-time requirements {#security-considerations-constant}
2940
+
2941
2941
Constant-time implementations of all functions in this document are STRONGLY
2942
2942
RECOMMENDED for all uses, to avoid leaking information via side channels.
2943
2943
It is especially important to use a constant-time implementation when inputs to
@@ -3055,12 +3055,13 @@ function meeting one of the above criteria.
3055
3055
Applications that use expand\_message\_xmd outside of hash\_to\_field should
3056
3056
ensure domain separation by picking a distinct value for DST.
3057
3057
3058
- # # Domain separation recommendations {#security-considerations-domain-separation}
3058
+ # # Domain separation for expand\_message variants {#security-considerations-domain-separation-expmsg-var }
3059
3059
3060
3060
As discussed in {{term-domain-separation}}, the purpose of domain separation
3061
3061
is to ensure that security analyses of cryptographic protocols that query
3062
3062
multiple independent random oracles remain valid even if all of these random
3063
3063
oracles are instantiated based on one underlying function H.
3064
+
3064
3065
The expand\_message variants in this document ({{hashtofield-expand}}) ensure
3065
3066
domain separation by appending a suffix-free-encoded domain separation tag
3066
3067
DST\_prime to all strings hashed by H, an underlying hash or
@@ -3246,9 +3247,10 @@ If x is the x-coordinate of a point on the elliptic curve, output that
3246
3247
point. Otherwise, generate a new value x in F and try again.
3247
3248
Since a random value x in F has probability about 1/2 of corresponding to
3248
3249
a point on the curve, the expected number of tries is just two.
3249
- However, the running time of this method depends on the input string,
3250
- which means that it is not safe to use in protocols sensitive to timing
3251
- side channels.
3250
+ However, the running time of this method, which is generally referred
3251
+ to as a probabilistic try-and-increment algorithm, depends on the input string.
3252
+ As such, it is not safe to use in protocols sensitive to timing
3253
+ side channels, as was exemplified by the Dragonblood attack {{VR20}}.
3252
3254
3253
3255
Schinzel and Skalba {{SS04}} introduce a method of constructing
3254
3256
elliptic curve points deterministically, for a restricted class of curves
@@ -3325,7 +3327,7 @@ The hash\_to\_ristretto255 function MUST be instantiated with an expand\_message
3325
3327
function that conforms to the requirements given in {{hashtofield-expand}}.
3326
3328
In addition, it MUST use a domain separation tag constructed as described
3327
3329
in {{domain-separation}}, and all domain separation recommendations given
3328
- in {{security-considerations-domain-separation}} apply when implementing
3330
+ in {{security-considerations-domain-separation-expmsg-var }} apply when implementing
3329
3331
protocols that use hash\_to\_ristretto255.
3330
3332
3331
3333
~~~ pseudocode
@@ -3378,7 +3380,7 @@ The hash\_to\_decaf448 function MUST be instantiated with an expand\_message
3378
3380
function that conforms to the requirements given in {{hashtofield-expand}}.
3379
3381
In addition, it MUST use a domain separation tag constructed as described
3380
3382
in {{domain-separation}}, and all domain separation recommendations given
3381
- in {{security-considerations-domain-separation}} apply when implementing
3383
+ in {{security-considerations-domain-separation-expmsg-var }} apply when implementing
3382
3384
protocols that use hash\_to\_decaf448.
3383
3385
3384
3386
~~~ pseudocode
0 commit comments