mirror of
https://github.com/bitcoin/bips.git
synced 2026-05-04 16:41:51 +00:00
Add optional message to DLEQ
This commit is contained in:
@@ -38,6 +38,7 @@ Input:
|
||||
* The public key ''B'': a point on the curve
|
||||
* The generator point ''G'': a point on the curve
|
||||
* Auxiliary random data ''r'': a 32-byte array
|
||||
* An optional message ''m'': a 32-byte array
|
||||
|
||||
The algorithm ''GenerateProof(a, B, r)'' is defined as:
|
||||
* Fail if ''a = 0'' or ''a ≥ n''.
|
||||
@@ -50,7 +51,8 @@ The algorithm ''GenerateProof(a, B, r)'' is defined as:
|
||||
* Fail if ''k = 0''.
|
||||
* Let ''R<sub>1</sub> = k⋅G''.
|
||||
* Let ''R<sub>2</sub> = k⋅B''.
|
||||
* Let ''e = int(hash<sub>BIP0???/challenge</sub>(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R<sub>1</sub>) || cbytes(R<sub>2</sub>)))''.
|
||||
* Let ''m' = m if m is provided, otherwise an empty byte array''.
|
||||
* Let ''e = int(hash<sub>BIP0???/challenge</sub>(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R<sub>1</sub>) || cbytes(R<sub>2</sub>) || cbytes(m')))''.
|
||||
* Let ''s = (k + e⋅a) mod n''.
|
||||
* Let ''proof = bytes(32, e) || bytes(32, s)''.
|
||||
* If ''VerifyProof(A, B, C, proof)'' (see below) returns failure, abort.
|
||||
@@ -64,6 +66,7 @@ Input:
|
||||
* The result of multiplying the secret and public keys used in the proof generation ''C'': a point on the curve
|
||||
* The generator point used in the proof generation ''G'': a point on the curve
|
||||
* A proof ''proof'': a 64-byte array
|
||||
* An optional message ''m'': a 32-byte array
|
||||
|
||||
The algorithm ''VerifyProof(A, B, C, G, proof)'' is defined as:
|
||||
* Let ''e = int(proof[0:32])''.
|
||||
@@ -72,7 +75,8 @@ The algorithm ''VerifyProof(A, B, C, G, proof)'' is defined as:
|
||||
* Fail if ''is_infinite(R<sub>1</sub>)''.
|
||||
* Let ''R<sub>2</sub> = s⋅B - e⋅C''.
|
||||
* Fail if ''is_infinite(R<sub>2</sub>)''.
|
||||
* Fail if ''e ≠ int(hash<sub>BIP0???/challenge</sub>(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R<sub>1</sub>) || cbytes(R<sub>2</sub>)))''.
|
||||
* Let ''m' = m if m is provided, otherwise an empty byte array''.
|
||||
* Fail if ''e ≠ int(hash<sub>BIP0???/challenge</sub>(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R<sub>1</sub>) || cbytes(R<sub>2</sub>) || cbytes(m')))''.
|
||||
* Return success iff no failure occurred before reaching this point.
|
||||
|
||||
== Test Vectors and Reference Code ==
|
||||
|
||||
Reference in New Issue
Block a user