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

new PrivateKey() returns a key with shorter length than expected #1696

Closed
longfin opened this issue Jan 5, 2022 · 5 comments
Closed

new PrivateKey() returns a key with shorter length than expected #1696

longfin opened this issue Jan 5, 2022 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@longfin
Copy link
Member

longfin commented Jan 5, 2022

Sometimes re-encoding it fails because the new PrivateKey() constructor returns a private key that is less than 32 bytes in length.

var key = new PrivateKey();
var encoded = key.ToByteArray();
var decoded = new PrivateKey(encoded);  // throws ArgumentOutOfRangeException

Related to #1571

@longfin longfin added the bug Something isn't working label Jan 5, 2022
@dahlia dahlia added the good first issue Good for newcomers label Jan 22, 2022
@dahlia dahlia added this to To do in 202201 Sprint Seoul via automation Jan 22, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale The issue is stale label Apr 16, 2022
@longfin longfin removed the stale The issue is stale label May 28, 2022
@zeta6
Copy link
Contributor

zeta6 commented May 28, 2022

@longfin
Copy link
Member Author

longfin commented May 28, 2022

@zeta6

@longfin
Copy link
Member Author

longfin commented Jun 18, 2022

Related workaround: https://github.com/planetarium/9c-launcher/pull/1555/files

zeta6 pushed a commit to zeta6/libplanet that referenced this issue Jun 18, 2022
Modify GenerateKeyParam to return a new value
when .D.ToByteArrayUnsigned().Length != 32 Repeat until == 32
limebell added a commit that referenced this issue Jul 5, 2022
* fix: issue #1696

Modify GenerateKeyParam to return a new value
when .D.ToByteArrayUnsigned().Length != 32 Repeat until == 32

* Add change log

* Update PrivateKeyTest.cs

remove unused test

Co-authored-by: Ohjin <lazist134407@gmail.com>
Co-authored-by: Swen Mun <swen@planetariumhq.com>
Co-authored-by: Chanhyuck Ko <limeelbee@gmail.com>
@longfin
Copy link
Member Author

longfin commented Jul 18, 2022

It seemed that resolved by #2091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants