-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: adding backwards compatibility to manage key curve Secp256k1 and… #372
base: main
Are you sure you want to change the base?
Conversation
2105532
to
81ce220
Compare
… secp256k1 but forcing lowercase for newly created ones Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]> Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
…wards compatibility Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
1fccb9c
to
00d8346
Compare
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
export function isCurve(curve: string, curveEnum: Curve): boolean { | ||
return curve === curveEnum || | ||
// For backwards compatibility | ||
curve === 'Secp256k1'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look right, I don't think we should have hardcoded conditionals like this.
wouldn't this incorrectly evaluate, ie:
// curve value from somewhere
const crv = "Secp256k1"
if(isCurve(crv, Curve.ED25519)) {
... do something ed25519 related
}
@@ -188,7 +188,8 @@ export enum Usage { | |||
UNKNOWN_KEY = "unknownKey", | |||
} | |||
export function curveToAlg(curve: string) { | |||
if (curve === Curve.SECP256K1) { | |||
// For backwards compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this aiming for backwards compatibility with? I'd expect to see some tests that demonstrate and prove it?
Description:
Adding backwards compatible key curve Secp256k1 and secp256k1, but forcing from now on to use it in lowercase as stated in the specs.
Checklist: