Skip to content

Conversation

mbrandenburger
Copy link
Member

This allows to define the elliptic curve used by the PDO crypto via the
-DPDO_USE_ECDSA_CURVE flag during compile time. When not defined, the
default curve is secp256k1 as used in BTC. This commit is motivated by
the use of the PDO crypto with Fabric Private Chaincode. In Fabric,
however, the default ellipctic curve is secp256r1 (aka prime256v1). This
compile flag allows to change the curve when used with FPC to be
complient with Fabric.

Signed-off-by: Marcus Brandenburger bur@zurich.ibm.com

This allows to define the elliptic curve used by the PDO crypto via the
-DPDO_USE_ECDSA_CURVE flag during compile time. When not defined, the
default curve is secp256k1 as used in BTC. This commit is motivated by
the use of the PDO crypto with Fabric Private Chaincode. In Fabric,
however, the default ellipctic curve is secp256r1 (aka prime256v1). This
compile flag allows to change the curve when used with FPC to be
complient with Fabric.

Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
@mbrandenburger
Copy link
Member Author

mbrandenburger commented Jun 16, 2021

An example how this change is used is provided in the FPC PR #604. In particular, our CMakeLists.txt sets -DPDO_USE_ECDSA_CURVE.

I will keep this PR as draft until the work in the FPC PR is done

@cmickeyb cmickeyb self-assigned this Jun 16, 2021
#ifndef PDO_USE_ECDSA_CURVE
#define PDO_USE_ECDSA_CURVE NID_secp256k1
#endif

namespace pdo
Copy link
Contributor

Choose a reason for hiding this comment

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

I get the compile time option... but did you forget to use it in the constants below?

Copy link
Member Author

Choose a reason for hiding this comment

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

ouch - I missed to commit that :) Updated now

Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
@mbrandenburger mbrandenburger requested a review from cmickeyb June 17, 2021 10:54
@cmickeyb cmickeyb marked this pull request as ready for review June 28, 2021 22:35
@cmickeyb cmickeyb merged commit 7546768 into hyperledger-labs:main Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants