Skip to content

Shorten variable prefix for P256K1 types from P256k1 to two letters #167

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

Open
msgilligan opened this issue Apr 14, 2025 · 4 comments
Open

Comments

@msgilligan
Copy link
Member

msgilligan commented Apr 14, 2025

P256k1 as used in P256k1PrivKey, P256k1PubKey, etc. is a little unwieldy. And it is already inconsistent -- some instances are P256k1 and others are P256K1 (with a capital K)

Java Crypto and Bouncy Castle both use EC for Elliptic Curve. We are using the P256k1 subset of EC, so some possible two-letter prefixes are:

  1. PK -- P256K1
  2. SP -- SecP
  3. SJ -- Secp256k1-Jdk

I do think the prefix is needed because we already have collisions between the Java Crypto ECPoint and the Bouncy Castle ECPoint, etc. And our types will need to co-exist in the same source files.

I'm looking for feedback. Should we shorten to two-letters? If so, which two letters? I'm open to a three letter combination, too. Maybe SPK?

@schildbach @craigraw ?

@msgilligan
Copy link
Member Author

I think I like SP the best.

@craigraw
Copy link
Collaborator

Of the options, I would probably do SJ - seems the most defendable choice.

@msgilligan msgilligan changed the title Shorten variable prefix for P256K1 types form P256k1 to two letters Shorten variable prefix for P256K1 types from P256k1 to two letters Apr 15, 2025
@schildbach
Copy link
Member

PK feels a bit misleading because I read "private key".

I think I'd vote for SP too. But I haven't yet thought about more alternatives.

@schildbach
Copy link
Member

schildbach commented Apr 17, 2025

At the same time, I've got no problem with the full P256K1. At least it's very recognizable. In this case I'd just make casing consistent.

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

No branches or pull requests

3 participants