[ECDH API change] Support custom hash function #354
pull fanatid wants to merge 2 commits into bitcoin-core:master from fanatid:custom-ecdh-hash-function changing 5 files +101 −35-
fanatid commented at 8:52 am on November 12, 2015: contributorSolve #352
-
fanatid cross-referenced this on Jan 13, 2016 from issue RFC: non-hashed ecdh by axic
-
fanatid cross-referenced this on Feb 1, 2016 from issue 3.0.0 by wanderer
-
axic cross-referenced this on Apr 22, 2016 from issue Support custom hash functions in ECDH API by Kagami
-
fanatid commented at 10:15 am on April 27, 2016: contributorI think that
unsafeECDH
that return public key as result will be better thanecdh
with custom hash function, so I close this PR. -
fanatid closed this on Apr 27, 2016
-
fanatid deleted the branch on Jan 7, 2017
-
fanatid cross-referenced this on Mar 10, 2017 from issue ECDH: output compressed point by chfast
-
fanatid restored the branch on Mar 12, 2017
-
fanatid reopened this on Mar 12, 2017
-
fanatid force-pushed on Mar 12, 2017
-
fanatid force-pushed on Mar 12, 2017
-
chfast commented at 5:52 pm on March 21, 2017: none
Yes please :) For me it does not matter which variant it will be, but I need access to raw point coordinates (precisely only x).
Actually, this variant is a bit better than mine, because the serialized point is not useful for me directly.
-
in src/modules/ecdh/tests_impl.h:13 in 750782fef3 outdated
6@@ -7,6 +7,22 @@ 7 #ifndef _SECP256K1_MODULE_ECDH_TESTS_ 8 #define _SECP256K1_MODULE_ECDH_TESTS_ 9 10+int ecdh_hash_function_test_fail(unsigned char *output, const unsigned char *x, const unsigned char *y) { 11+ if (1) { 12+ return 0; 13+ }
dcousens commented at 10:41 pm on March 21, 2017:is this meant to be here?
fanatid commented at 1:58 pm on March 27, 2017:removedin include/secp256k1_ecdh.h:10 in 750782fef3 outdated
6@@ -7,21 +7,41 @@ 7 extern "C" { 8 # endif 9 10+/** A pointer to a function that apply hash function to a point
sipa commented at 11:56 pm on March 21, 2017:applies
fanatid commented at 1:58 pm on March 27, 2017:fixedsipa commented at 11:57 pm on March 21, 2017: contributorConcept ACKfanatid force-pushed on Mar 27, 2017chfast commented at 5:34 pm on August 8, 2017: noneHow is this going on?chfast commented at 4:57 pm on April 5, 2018: nonePing.apoelstra commented at 4:59 pm on April 5, 2018: contributorI’ll rebase and review it.apoelstra assigned apoelstra on Apr 5, 2018in include/secp256k1_ecdh.h:18 in f35568b58b outdated
12+ * Returns: 1 if a point was successfully hashed. 0 will cause ecdh to fail 13+ * Out: output: pointer to an array to be filled by the function 14+ * In: x: pointer to a 32-byte x coordinate 15+ * y: pointer to a 32-byte y coordinate 16+ */ 17+typedef int (*secp256k1_ecdh_hash_function)(
chfast commented at 9:07 pm on April 5, 2018:I’m not sure it’s not a bit too much to return bool from hash function. Not very practical to have a hash function that can fail.
apoelstra commented at 1:42 pm on April 6, 2018:I think it’s reasonable. Imagine a hash function that returns the x coordinate, but only if y is odd (or has Jacobi symbol 1, or whatever the parity is).apoelstra commented at 10:17 pm on April 5, 2018: contributor@fanatid I’m not able to rebase your PR it seems. Can you do it? If you want, my version of the commit is at https://github.com/apoelstra/secp256k1/tree/custom-ecdh-hash-functionfanatid force-pushed on Apr 6, 2018fanatid force-pushed on Apr 6, 2018fanatid force-pushed on Apr 6, 2018fanatid commented at 8:32 am on April 6, 2018: contributor@apoelstra rebasedin include/secp256k1_ecdh.h:37 in 1dedb7bdfe outdated
34- * secret computed from the point and scalar 35+ * Out: output: pointer to an array to be filled by the function 36 * In: pubkey: a pointer to a secp256k1_pubkey containing an 37 * initialized public key 38 * privkey: a 32-byte scalar with which to multiply the point 39+ * hashfp: pointer to a hash function. If NULL, secp256k1_ecdh_hash_function_sha256 is used
apoelstra commented at 1:44 pm on April 6, 2018:awkward spacing
fanatid commented at 2:09 pm on April 6, 2018:fixedapoelstra commented at 1:47 pm on April 6, 2018: contributorACK aside from spacing nitfanatid force-pushed on Apr 6, 2018chfast approvedchfast commented at 3:20 pm on April 9, 2018: noneWhat more is required to get it merged?sipa commented at 5:05 pm on April 10, 2018: contributorHmm, is there no need for a data parameter that gets passed to the hashing function? This way the hash function cannot access any application dependent data, unless through a global (which is not threadsafe)?chfast commented at 2:26 pm on May 16, 2018: noneHmm, is there no need for a data parameter that gets passed to the hashing function? This way the hash function cannot access any application dependent data, unless through a global (which is not threadsafe)?
Is this a recommended change in this PR?
[ECDH API change] Support custom hash function b00be65056fanatid force-pushed on May 16, 2018[ECDH API change] Allow pass arbitrary data to hash function c8fbc3c397fanatid force-pushed on May 16, 2018fanatid commented at 10:04 pm on May 16, 2018: contributorPointer to arbitrary data added to hash function.ofek commented at 2:11 am on May 23, 2018: noneIs this ready to be merged?sipa commented at 7:04 pm on May 31, 2018: contributorutACK c8fbc3c397b547bc64435a9bffb8f989cd23aba0apoelstra commented at 5:41 pm on July 4, 2018: contributorACKchfast commented at 2:40 pm on August 9, 2018: noneCan this be merged finally?chfast commented at 11:59 am on October 16, 2018: noneCan this be merged finally?
Can it?
sipa merged this on Oct 17, 2018sipa closed this on Oct 17, 2018
sipa referenced this in commit 1086fda4c1 on Oct 17, 2018fanatid deleted the branch on Oct 17, 2018fanatid cross-referenced this on Dec 20, 2018 from issue Update secp256k1 (support custom function for ECDH) by fanatidsipa cross-referenced this on Jan 7, 2020 from issue Review if ECDH is still experimental by ysangkok
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-25 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me