diff options
| author | Vitor Pamplona <vitor@vitorpamplona.com> | 2024-09-03 08:37:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-03 08:37:21 -0400 |
| commit | a928d11fb5e968b732ad3d2d1f8944bc9d7d0f19 (patch) | |
| tree | 3cfd8916f2c8c53ef6f5f2eac814c70b33ce9603 /44.md | |
| parent | b4a2561df7325b8624bc5ffad154ec946ade2f1e (diff) | |
| parent | be17e5dcd9943c1d4854eccd5714241d4fe246e1 (diff) | |
Merge pull request #1466 from paulmillr/patch-2
nip44: clarify ecdh hashing
Diffstat (limited to '44.md')
| -rw-r--r-- | 44.md | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -142,6 +142,8 @@ validation rules, refer to BIP-340. | |||
| 142 | The operation produces a shared point, and we encode the shared point's 32-byte x coordinate, using method | 142 | The operation produces a shared point, and we encode the shared point's 32-byte x coordinate, using method |
| 143 | `bytes(P)` from BIP340. Private and public keys must be validated as per BIP340: pubkey must be a valid, | 143 | `bytes(P)` from BIP340. Private and public keys must be validated as per BIP340: pubkey must be a valid, |
| 144 | on-curve point, and private key must be a scalar in range `[1, secp256k1_order - 1]`. | 144 | on-curve point, and private key must be a scalar in range `[1, secp256k1_order - 1]`. |
| 145 | NIP44 doesn't do hashing of the output: keep this in mind, because some libraries hash it using sha256. | ||
| 146 | As an example, in libsecp256k1, unhashed version is available in `secp256k1_ec_pubkey_tweak_mul` | ||
| 145 | - Operators | 147 | - Operators |
| 146 | - `x[i:j]`, where `x` is a byte array and `i, j <= 0` returns a `(j - i)`-byte array with a copy of the | 148 | - `x[i:j]`, where `x` is a byte array and `i, j <= 0` returns a `(j - i)`-byte array with a copy of the |
| 147 | `i`-th byte (inclusive) to the `j`-th byte (exclusive) of `x`. | 149 | `i`-th byte (inclusive) to the `j`-th byte (exclusive) of `x`. |