1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-06-29 17:39:57 +00:00

Optionally print intermediate values in reference code

and make reference code and pseudocode more consistent with each other
This commit is contained in:
Tim Ruffing
2020-03-04 21:21:36 +01:00
parent 39ba507e01
commit a6301c5af0
2 changed files with 56 additions and 18 deletions

View File

@@ -136,9 +136,9 @@ Input:
* The secret key ''sk'': a 32-byte array, freshly generated uniformly at random
The algorithm ''PubKey(sk)'' is defined as:
* Let ''d = int(sk)''.
* Fail if ''d = 0'' or ''d ≥ n''.
* Return ''bytes(d⋅G)''.
* Let ''d' = int(sk)''.
* Fail if ''d' = 0'' or ''d' ≥ n''.
* Return ''bytes(d'⋅G)''.
Note that we use a very different public key format (32 bytes) than the ones used by existing systems (which typically use elliptic curve points as public keys, or 33-byte or 65-byte encodings of them). A side effect is that ''PubKey(sk) = PubKey(bytes(n - int(sk))'', so every public key has two corresponding secret keys.