Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ellswift usage example #1551

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

theStack
Copy link
Contributor

This should hopefully be useful as orientation for users implementing the shared secret derivation part of BIP324. Conceptually the example is not very different to the ECDH one, so a lot of code/comments are just copied (e.g. context creation, secret key generation, shared secret comparison, console output, cleanup with secret key clearing).

Copy link
Contributor

@real-or-random real-or-random left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

CHANGELOG.md Outdated Show resolved Hide resolved
examples/ellswift.c Outdated Show resolved Hide resolved
examples/ellswift.c Outdated Show resolved Hide resolved
@real-or-random real-or-random added the user-documentation user-facing documentation label Jun 25, 2024
This should hopefully be useful as orientation for users implementing
the key exchange part of BIP324. Conceptually the example is not very
different to the ECDH one, so a lot of code/comments are just copied
(e.g. context creation, secret key generation, shared secret comparison,
console output, cleanup with secret key clearing).
@theStack
Copy link
Contributor Author

@real-or-random: Thanks for the quick review, force-pushed with all the suggestions taken.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

31f8459

I have reviewed both build systems changes and they look OK.

@@ -10,6 +10,7 @@ ctime_tests
ecdh_example
ecdsa_example
schnorr_example
ellswift_example
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I understand that this doesn’t adhere to the surrounding code, but, strictly speaking, it should be

Suggested change
ellswift_example
/ellswift_example

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, feel free to adjust this for the binaries, but I guess either variant is fine (we also have the pattern *.exe, which may in rare cases a bit too coarse`...)

Copy link
Contributor

@real-or-random real-or-random left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 31f8459

Copy link
Contributor

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 31f8459

@jonasnick jonasnick merged commit 0055b86 into bitcoin-core:master Jul 10, 2024
116 checks passed
@theStack theStack deleted the add_ellswift_example branch July 10, 2024 18:35
josibake added a commit to josibake/bitcoin that referenced this pull request Jul 15, 2024
0c63b8b191 automagically regenerate if testvectors change
a61335f2e5 ci: enable silentpayments module
0b6827182d tests: add BIP-352 test vectors
1858c33c55 silentpayments: add benchmark for `scan_outputs`
816796300a silentpayments: add examples/silentpayments.c
c1f85840dc silentpayments: receiving
2fb3ca6efe silentpayments: recipient label support
605096d3f4 silentpayments: sending
35f91359b8 build: add skeleton for new silentpayments (BIP352) module
0055b86780 Merge bitcoin-core/secp256k1#1551: Add ellswift usage example
ea2d5f0f17 Merge bitcoin-core/secp256k1#1563: doc: Add convention for defaults
ca06e58b2c Merge bitcoin-core/secp256k1#1564: build, ci: Adjust the default size of the precomputed table for signing
e2af491263 ci: Switch to the new default value of the precomputed table for signing
d94a9273f8 build: Adjust the default size of the precomputed table for signing
fcc5d7381b Merge bitcoin-core/secp256k1#1565: cmake: Bump CMake minimum required version up to 3.16
9420eece24 cmake: Bump CMake minimum required version up to 3.16
16685649d2 doc: Add convention for defaults
a5269373fa Merge bitcoin-core/secp256k1#1555: Fixed O3 replacement
b8fe33332b cmake: Fixed O3 replacement
31f84595c4 Add ellswift usage example
fe4fbaa7f3 examples: fix case typos in secret clearing paragraphs (s/, Or/, or/)

git-subtree-dir: src/secp256k1
git-subtree-split: 0c63b8b1911ef1183f411a5e232165b543c668ea
josibake added a commit to josibake/bitcoin that referenced this pull request Jul 15, 2024
00b0cb19a9 docs: update README
54b8bc8ec6 ci: enable silentpayments module
96bd71fb8a tests: add BIP-352 test vectors
c30bc013fe silentpayments: add benchmark for `scan_outputs`
91b1b3365b silentpayments: add examples/silentpayments.c
b4475ea80c silentpayments: receiving
23c7aead63 silentpayments: recipient label support
79562d0cd1 silentpayments: sending
35f91359b8 build: add skeleton for new silentpayments (BIP352) module
0055b86780 Merge bitcoin-core/secp256k1#1551: Add ellswift usage example
ea2d5f0f17 Merge bitcoin-core/secp256k1#1563: doc: Add convention for defaults
ca06e58b2c Merge bitcoin-core/secp256k1#1564: build, ci: Adjust the default size of the precomputed table for signing
e2af491263 ci: Switch to the new default value of the precomputed table for signing
d94a9273f8 build: Adjust the default size of the precomputed table for signing
fcc5d7381b Merge bitcoin-core/secp256k1#1565: cmake: Bump CMake minimum required version up to 3.16
9420eece24 cmake: Bump CMake minimum required version up to 3.16
16685649d2 doc: Add convention for defaults
a5269373fa Merge bitcoin-core/secp256k1#1555: Fixed O3 replacement
b8fe33332b cmake: Fixed O3 replacement
31f84595c4 Add ellswift usage example
fe4fbaa7f3 examples: fix case typos in secret clearing paragraphs (s/, Or/, or/)

git-subtree-dir: src/secp256k1
git-subtree-split: 00b0cb19a97718dfaab70aa7505ff157f22a31bd
fanquake added a commit to fanquake/bitcoin that referenced this pull request Aug 2, 2024
642c885b61 Merge bitcoin-core/secp256k1#1575: release: prepare for 0.5.1
cdf08c1a2b Merge bitcoin-core/secp256k1#1576: doc: mention `needs-changelog` github label in release process
40d87b8e45 release: prepare for 0.5.1
5770226176 changelog: clarify CMake option
759bd4bbc8 doc: mention `needs-changelog` github label in release process
fded437c4c Merge bitcoin-core/secp256k1#1574: Fix compilation when extrakeys module isn't enabled
763d938cf0 ci: only enable extrakeys module when schnorrsig is enabled
af551ab9db tests: do not use functions from extrakeys module
0055b86780 Merge bitcoin-core/secp256k1#1551: Add ellswift usage example
ea2d5f0f17 Merge bitcoin-core/secp256k1#1563: doc: Add convention for defaults
ca06e58b2c Merge bitcoin-core/secp256k1#1564: build, ci: Adjust the default size of the precomputed table for signing
e2af491263 ci: Switch to the new default value of the precomputed table for signing
d94a9273f8 build: Adjust the default size of the precomputed table for signing
fcc5d7381b Merge bitcoin-core/secp256k1#1565: cmake: Bump CMake minimum required version up to 3.16
9420eece24 cmake: Bump CMake minimum required version up to 3.16
16685649d2 doc: Add convention for defaults
a5269373fa Merge bitcoin-core/secp256k1#1555: Fixed O3 replacement
b8fe33332b cmake: Fixed O3 replacement
31f84595c4 Add ellswift usage example
fe4fbaa7f3 examples: fix case typos in secret clearing paragraphs (s/, Or/, or/)

git-subtree-dir: src/secp256k1
git-subtree-split: 642c885b6102725e25623738529895a95addc4f4
fanquake added a commit to bitcoin/bitcoin that referenced this pull request Aug 6, 2024
9ec776a Revert "build: pass --with-ecmult-gen-kb=86 to secp256k1" (fanquake)
41797f8 Squashed 'src/secp256k1/' changes from 4af241b320..642c885b61 (fanquake)

Pull request description:

  Updates the libsecp256k1 subtree to bitcoin-core/secp256k1@642c885 (which is the tag for the [`v0.5.1` release](https://github.com/bitcoin-core/secp256k1/releases/tag/v0.5.1)).
  Includes a handful of changes:
  * bitcoin-core/secp256k1#1551
  * bitcoin-core/secp256k1#1555
  * bitcoin-core/secp256k1#1563
  * bitcoin-core/secp256k1#1564
  * bitcoin-core/secp256k1#1565
  * bitcoin-core/secp256k1#1574

  Reverts a057869 given secps default has changed (bitcoin-core/secp256k1#1563):
  > As a rule of thumb, the default values for configuration options should target standard desktop machines and align with Bitcoin Core's defaults, and the tests should mostly exercise the default configuration (see [#1549](bitcoin-core/secp256k1#1549 (comment))).

ACKs for top commit:
  hebasto:
    ACK 9ec776a, I've reproduced the subtree update locally with the zero diff with this PR branch.

Tree-SHA512: 903ca0ff12dcc32b6cd86aee84e19de09803d35a1ee006ce890f3761dd27f1e96fe70c7bb4c279416a96ee57c406c9627614900f0ca6f76674c0088a3d270cd2
vmta added a commit to umkoin/umkoin that referenced this pull request Sep 3, 2024
3fdf146ba Merge bitcoin-core/secp256k1#1578: ci: Silent Homebrew's noisy reinstall warnings
f8c1b0e0e Merge bitcoin-core/secp256k1#1577: release cleanup: bump version after 0.5.1
7057d3c9a ci: Silent Homebrew's noisy reinstall warnings
c3e40d75d release cleanup: bump version after 0.5.1
642c885b6 Merge bitcoin-core/secp256k1#1575: release: prepare for 0.5.1
cdf08c1a2 Merge bitcoin-core/secp256k1#1576: doc: mention `needs-changelog` github label in release process
40d87b8e4 release: prepare for 0.5.1
577022617 changelog: clarify CMake option
759bd4bbc doc: mention `needs-changelog` github label in release process
fded437c4 Merge bitcoin-core/secp256k1#1574: Fix compilation when extrakeys module isn't enabled
763d938cf ci: only enable extrakeys module when schnorrsig is enabled
af551ab9d tests: do not use functions from extrakeys module
0055b8678 Merge bitcoin-core/secp256k1#1551: Add ellswift usage example
ea2d5f0f1 Merge bitcoin-core/secp256k1#1563: doc: Add convention for defaults
ca06e58b2 Merge bitcoin-core/secp256k1#1564: build, ci: Adjust the default size of the precomputed table for signing
e2af49126 ci: Switch to the new default value of the precomputed table for signing
d94a9273f build: Adjust the default size of the precomputed table for signing
fcc5d7381 Merge bitcoin-core/secp256k1#1565: cmake: Bump CMake minimum required version up to 3.16
9420eece2 cmake: Bump CMake minimum required version up to 3.16
16685649d doc: Add convention for defaults
31f84595c Add ellswift usage example
fe4fbaa7f examples: fix case typos in secret clearing paragraphs (s/, Or/, or/)

git-subtree-dir: src/secp256k1
git-subtree-split: 3fdf146bad042a17f6b2f490ef8bd9d8e774cdbd
vmta added a commit to umkoin/umkoin that referenced this pull request Sep 6, 2024
3fdf146ba Merge bitcoin-core/secp256k1#1578: ci: Silent Homebrew's noisy reinstall warnings
f8c1b0e0e Merge bitcoin-core/secp256k1#1577: release cleanup: bump version after 0.5.1
7057d3c9a ci: Silent Homebrew's noisy reinstall warnings
c3e40d75d release cleanup: bump version after 0.5.1
642c885b6 Merge bitcoin-core/secp256k1#1575: release: prepare for 0.5.1
cdf08c1a2 Merge bitcoin-core/secp256k1#1576: doc: mention `needs-changelog` github label in release process
40d87b8e4 release: prepare for 0.5.1
577022617 changelog: clarify CMake option
759bd4bbc doc: mention `needs-changelog` github label in release process
fded437c4 Merge bitcoin-core/secp256k1#1574: Fix compilation when extrakeys module isn't enabled
763d938cf ci: only enable extrakeys module when schnorrsig is enabled
af551ab9d tests: do not use functions from extrakeys module
0055b8678 Merge bitcoin-core/secp256k1#1551: Add ellswift usage example
ea2d5f0f1 Merge bitcoin-core/secp256k1#1563: doc: Add convention for defaults
ca06e58b2 Merge bitcoin-core/secp256k1#1564: build, ci: Adjust the default size of the precomputed table for signing
e2af49126 ci: Switch to the new default value of the precomputed table for signing
d94a9273f build: Adjust the default size of the precomputed table for signing
fcc5d7381 Merge bitcoin-core/secp256k1#1565: cmake: Bump CMake minimum required version up to 3.16
9420eece2 cmake: Bump CMake minimum required version up to 3.16
16685649d doc: Add convention for defaults
31f84595c Add ellswift usage example
fe4fbaa7f examples: fix case typos in secret clearing paragraphs (s/, Or/, or/)

git-subtree-dir: src/secp256k1
git-subtree-split: 3fdf146bad042a17f6b2f490ef8bd9d8e774cdbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user-documentation user-facing documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants