You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-dijkhuis-cfrg-hdkeys.md
+116-43
Original file line number
Diff line number
Diff line change
@@ -407,7 +407,7 @@ Step 4 MAY be postponed to be combined with step 6. Steps 5 to 8 MAY be combined
407
407
408
408
## Using digital signatures
409
409
410
-
Instantiations of HDK using digital signatures require the following cryptographic constructs:
410
+
Instantiations of HDK using digital signatures require:
411
411
412
412
- `DSA`: A digital signature algorithm, consisting of the functions:
413
413
- GenerateKeyPair(): Outputs a new key pair `(sk, pk)` consisting of private key `sk` and public key `pk`.
@@ -433,7 +433,7 @@ msg = create_message(pk, nonce) # out of scope for this spec
433
433
Verify(signature, pk, msg)
434
434
~~~
435
435
436
-
Instantiations of HDK using digital signatures instantiat the following:
436
+
Instantiations of HDK using digital signatures provide:
437
437
438
438
- `BL`: A cryptographic construct that extends `DSA` as specified in [I-D.draft-irtf-cfrg-signature-key-blinding-07], implementing the interface from [Instantiation parameters](#instantiation-parameters).
439
439
@@ -454,7 +454,7 @@ Applications MUST bind the message to be signed to the blinded public key. This
454
454
455
455
## Using prime-order groups
456
456
457
-
Instantiations of HDK using prime-order groups require the following cryptographic constructs:
457
+
Instantiations of HDK using prime-order groups require:
458
458
459
459
- `G`: A prime-order group as defined in [RFC9497] with elements of type Element and scalars of type Scalar, consisting of the functions:
460
460
- RandomScalar(): Outputs a random Scalar `k`.
@@ -466,6 +466,8 @@ Instantiations of HDK using prime-order groups require the following cryptograph
466
466
- SerializeScalar(k): Outputs a byte string representing Scalar `k`.`
467
467
- HashToScalar(msg): Outputs the result of deterministically mapping a byte string `msg` to an element in the scalar field of the prime order subgroup of `G`, using the `hash_to_field` function from a hash-to-curve suite [RFC9380].
468
468
469
+
Instantiations of HDK using prime-order groups provide:
Note that DeriveBlindingFactor is compatible with the definitions in [I-D.draft-irtf-cfrg-signature-key-blinding-07].
488
+
Note that DeriveBlindingFactor is compatible with the definitions in [I-D.draft-irtf-cfrg-signature-key-blinding-07]. The function is almost compatible with the definitions in [I-D.draft-bradleylundberg-cfrg-arkg-02]: only in AKRG, the context string needs to be prefixed with `0x00`.
489
+
490
+
### Using additive blinding
491
+
492
+
Instantiations of HDK using additive blinding use:
487
493
488
-
## Using multiplicative blinding
494
+
- [prime-order groups](#using-prime-order-groups)
489
495
490
-
Such instantations of HDK [use prime-order groups](#using-prime-order-groups) and instantiate the following:
496
+
Instantiations of HDK using additive blinding provide:
491
497
492
498
~~~
493
499
def BlindPublicKey(pk, bk, ctx):
494
500
bf = DeriveBlindingFactor(bk, ctx)
495
-
pk' = ScalarMult(pk, bf)
501
+
pk' = Add(pk, ScalarBaseMult(bf))
496
502
return pk
497
503
498
504
def BlindPrivateKey(sk, bf):
499
-
sk' = sk * bf mod Order()
505
+
sk' = sk + bf mod Order()
500
506
return sk
501
507
502
508
def Combine(bf1, bf2):
503
-
bf = bf1 * bf2 mod Order()
509
+
bf = bf1 + bf2 mod Order()
504
510
return bf
505
511
~~~
506
512
507
-
## Using additive blinding
513
+
Note that all algorithms in [I-D.draft-bradleylundberg-cfrg-arkg-02] use additive blinding.
514
+
515
+
### Using multiplicative blinding
516
+
517
+
Instantiations of HDK using multiplicative blinding use:
518
+
519
+
- [prime-order groups](#using-prime-order-groups)
508
520
509
-
Such instantations of HDK use [use prime-order groups](#using-prime-order-groups) and instantiate the following:
521
+
Instantiations of HDK using multiplicative blinding provide:
510
522
511
523
~~~
512
524
def BlindPublicKey(pk, bk, ctx):
513
525
bf = DeriveBlindingFactor(bk, ctx)
514
-
pk' = Add(pk, ScalarBaseMult(bf))
526
+
pk' = ScalarMult(pk, bf)
515
527
return pk
516
528
517
529
def BlindPrivateKey(sk, bf):
518
-
sk' = sk + bf mod Order()
530
+
sk' = sk * bf mod Order()
519
531
return sk
520
532
521
533
def Combine(bf1, bf2):
522
-
bf = bf1 + bf2 mod Order()
534
+
bf = bf1 * bf2 mod Order()
523
535
return bf
524
536
~~~
525
537
526
-
## Using ECDH shared secrets
538
+
Note that all algorithms in [I-D.draft-irtf-cfrg-signature-key-blinding-07] use multiplicative blinding.
539
+
540
+
## Using elliptic curves
541
+
542
+
Instantiations of HDK using elliptic curves use:
543
+
544
+
- [prime-order groups](#using-prime-order-groups)
545
+
546
+
Instantiations of HDK using elliptic curves require:
547
+
548
+
- `DST`: A domain separation tag for use with HashToScalar.
549
+
- `H2C`: A hash-to-curve suite [RFC9380].
550
+
551
+
Instantiations of HDK using elliptic curves provide:
552
+
553
+
- `H`: `H`from `H2C`.
554
+
- `Ns`: The output size of `H`.
555
+
556
+
~~~
557
+
def HashToScalar(msg):
558
+
scalar = hash_to_field(msg, 1) with the parameters:
559
+
DST: DST
560
+
F: GF(Order()), the scalar field
561
+
of the prime order subgroup of EC
562
+
p: Order()
563
+
m: 1
564
+
L: as defined in H2C
565
+
expand_message: as defined in H2C
566
+
return scalar
567
+
~~~
568
+
569
+
### Using ECDH shared secrets
527
570
528
-
Such instantiations of HDK [use multiplicative blinding](#using-multiplicative-blinding) and require the following cryptographic construct:
571
+
Instantiations of HDK using ECDH shared secrets use:
529
572
530
-
- `DH`: An Elliptic Curve Key Agreement Algorithm - Diffie-Hellman (ECKA-DH) [TR03111] with elliptic curve `EC`, consisting of the functions:
Note that the value of `ScalarMult(pkR, bf)` does not need to be computed within the secure cryptographic device that protects `sk`.
572
620
573
-
## Using EC-SDSA signatures
621
+
### Using EC-SDSA signatures
622
+
623
+
Instantiations of HDK using EC-SDSA (Schnorr) signatures use:
574
624
575
-
Such instantiations of HDK [use digital signatures](#using-digital-signatures) and [use additive blinding](#using-additive-blinding) and instantiate the following:
625
+
- [additive blinding](#using-additive-blinding)
626
+
- [digital signatures](#using-digital-signatures)
627
+
- [elliptic curves](#using-elliptic-curves)
576
628
577
-
- `DSA`: An EC-SDSA (Schnorr) digital signature algorithm [TR03111], representing signatures as pairs `(c, s)`.
629
+
Instantiations of HDK using EC-SDSA signatures provide:
630
+
631
+
- `DSA`: An EC-SDSA digital signature algorithm [TR03111], representing signatures as pairs `(c, s)`.
578
632
579
633
Note that in this case, the following definition is equivalent to the original definition of BlindSign:
580
634
@@ -590,24 +644,16 @@ def BlindSign(sk, bf, msg):
590
644
return signature
591
645
~~~
592
646
593
-
## Using P-256
647
+
### Using P-256
594
648
595
-
Such instantiations of HDK [use prime-order groups](#using-prime-order-groups) and require the following parameter:
649
+
Instantiations of HDK using P-256 use:
596
650
597
-
- `DST`: A domain separation tag for use with HashToScalar.
651
+
- [elliptic curves](#using-elliptic-curves)
652
+
653
+
Instantiations of HDK using P-256 provide:
598
654
599
-
Such instantiations instantiate the following:
600
-
601
-
- `Ns`: 32
602
-
- `H`: SHA-256 [FIPS180-4].
603
-
- `G`: The NIST curve `secp256r1` (P-256) [SEC2] with:
604
-
- `HashToScalar(msg)`: Implemented by computing `hash_to_field(msg, 1)` with the parameters:
605
-
- `DST`: `DST`
606
-
- `F`: GF(EC-Order()), the scalar field of the prime order subgroup of `G`
607
-
- `p`: EC-Order()
608
-
- `m`: 1
609
-
- `L`: 48
610
-
- `expand_message`: `expand_message_xmd`with `H`
655
+
- `G`: The NIST curve `secp256r1` (P-256) [SEC2].
656
+
- `H2C`: P256_XMD:SHA-256_SSWU_RO_ [RFC9380], which uses SHA-256 [FIPS180-4] as `H`.
611
657
- `KEM`: DHKEM(P-256, HKDF-SHA256) [RFC9180].
612
658
613
659
# Concrete HDK instantiations
@@ -616,24 +662,51 @@ The RECOMMENDED instantiation is the HDK-ECDH-P256. This avoids the risk of havi
616
662
617
663
## HDK-ECDH-P256
618
664
619
-
This instantiation [uses P-256](#using-p-256) and [uses ECDH shared secrets](#using-ecdh-shared-secrets).
0 commit comments