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 support for encoding/decoding compressed EC keys #56

Open
huskcasaca opened this issue Dec 4, 2024 · 1 comment
Open

Add support for encoding/decoding compressed EC keys #56

huskcasaca opened this issue Dec 4, 2024 · 1 comment

Comments

@huskcasaca
Copy link
Contributor

            public sealed class RAW : Format() {
                public companion object : RAW() {
                    override val name: String get() = "RAW"
                }
                public data object COMPRESSED : RAW() {
                    override val name: String get() = "RAW_COMPRESSED"
                }
            }

Hi, @whyoleg currently the EC public key encoder/decoder only supports the uncompressed format which starts with 04. I plan to add a new compressed format in RAW format. What do you think :)

@whyoleg
Copy link
Owner

whyoleg commented Dec 5, 2024

Hey!
Yeah, that should be fine with minor API addition: let's add a name for companion object, so that it will be:

public companion object Uncompressed : RAW()

In this way, both Format.RAW and Format.RAW.Uncompressed will be resolved and first could be used in most of the cases, while explicit name could be used for cases when you need to handle both variants.

Also, on current moment formats with multiple representations uses / as a separator in name, so let's use RAW/COMPRESSED

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

2 participants