js-ceramic icon indicating copy to clipboard operation
js-ceramic copied to clipboard

Export all functions from nist_wierstrauss_common and secp256r1, secp384r1, and secp521r1

Open bshambaugh opened this issue 2 years ago • 13 comments

This exports additional functions used in the library so that they are available for use.

I am using these functions in the following: https://github.com/bshambaugh/build-and-deconstruct-did-key https://github.com/bshambaugh/key-did-provider-p256

bshambaugh avatar Jun 28 '22 17:06 bshambaugh

Maybe it is better to create a package for the nist weierstrass, so that we could use it and you could use it too?

ukstv avatar Jun 29 '22 16:06 ukstv

What should I do about ECDecompress in secp256r1, secp384r1, and secp521r1?

bshambaugh avatar Jun 30 '22 20:06 bshambaugh

Maybe create a library for secp256r1 crypto tools in general?

oed avatar Jun 30 '22 21:06 oed

fwiw, this implementation is more general than creating ECDecompress for each NIST curve: https://github.com/transmute-industries/verifiable-data/blob/3fff2b0bf26350b8ea60d4f6d09cfb55f751b2a7/packages/web-crypto-key-pair/src/compression/ec-compression.ts#L41-L67

Something like this could move to the nist weierstrauss common package.

bshambaugh avatar Jun 30 '22 21:06 bshambaugh

I see what I can bake up. Thanks Sergey and Joel.

bshambaugh avatar Jun 30 '22 22:06 bshambaugh

I created a new package called nist-weierstrass @oed and @ukstv .

To test this, in code I have not commit yet, I have imported in the key-did-resolver package: import * as nist_weierstrass from '../../nist-weierstrass/src/index' import { base64urlPoint } from '../../nist-weierstrass/src/index'

Once the 'nist-weierstrass' package is public I hope be able to write: import * as nist_weierstrass from 'nist-weierstrass' import { base64urlPoint } from 'nist-weierstrass'

I am working on the package.json file to try to make this possible.

bshambaugh avatar Aug 06 '22 18:08 bshambaugh

oops big-int-modarith was updated. I'll need to include this. https://github.com/ceramicnetwork/js-ceramic/pull/2355

bshambaugh avatar Aug 06 '22 18:08 bshambaugh

That's really nice. Going to try it out.

I am thinking if the weierstrass package could be released and maintained as a standalone one, not part of Ceramic codebase. What do you think about that, pals?

ukstv avatar Aug 06 '22 18:08 ukstv

That's really nice. Going to try it out.

I am thinking if the weierstrass package could be released and maintained as a standalone one, not part of Ceramic codebase. What do you think about that, pals?

This sounds good to me. Would it be in any place special, or is my personal bshambaugh workable?

Here is sample of my draft key-did-resolver code for a preview*: https://github.com/bshambaugh/js-ceramic/blob/test-nist-w-with-key-did-resolver/packages/key-did-resolver/src/secp256r1.ts .

  • I've just been guessing about how the package will function with key-did-resolver once I npm publish An added benefit, in addition to reducing js-ceramic bloat, is that I can commit key-did-resolver code once I get the package up on npm.

bshambaugh avatar Aug 06 '22 19:08 bshambaugh

tl;dr: I hadn't thought about publishing an npm package locally for nist-weierstrauss and then plugging it into key-did-resolver js-ceramic code to test: https://medium.com/@debshish.pal/publish-a-npm-package-locally-for-testing-9a00015eb9fd (update: using this method appears to suggest that my package.json is acceptable now)

wherever you want me to put the git repository for the associated npm package for nist-weierstrauss I think I'm set.

bshambaugh avatar Aug 07 '22 17:08 bshambaugh

or is my personal bshambaugh workable

👍

oed avatar Aug 08 '22 06:08 oed

I hope referencing a new package called nist-weierstrauss is working well so far.

bshambaugh avatar Aug 23 '22 00:08 bshambaugh

@bshambaugh, can you please check this box on your PR so I can run the test workflow? It might be called "Allow edits and access to secrets by maintainers". image

smrz2001 avatar Sep 21 '22 13:09 smrz2001

cc @ukstv @smrz2001 @bshambaugh

is it possible to merge this still? we are moving key-did-resolver package to the dids repo, would be nice to merge/release here before moving over package codebase

zachferland avatar Oct 19 '22 13:10 zachferland

cc @ukstv @smrz2001 @bshambaugh

is it possible to merge this still? we are moving key-did-resolver package to the dids repo, would be nice to merge/release here before moving over package codebase

I can run the tests by hand today.

smrz2001 avatar Oct 19 '22 15:10 smrz2001

Speaking of this, I will give you permission today. Sorry about the delay. most-weierstrauss was updated earlier this week.

On Wednesday, October 19, 2022, Mohsin Zaidi @.***> wrote:

cc @ukstv https://github.com/ukstv @smrz2001 https://github.com/smrz2001 @bshambaugh https://github.com/bshambaugh

is it possible to merge this still? we are moving key-did-resolver package to the dids repo, would be nice to merge/release here before moving over package codebase

I can run the tests by hand today.

— Reply to this email directly, view it on GitHub https://github.com/ceramicnetwork/js-ceramic/pull/2279#issuecomment-1284234409, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAC4YP5INOFXLTQITKTVWDWEAKT3ANCNFSM52DA6UHA . You are receiving this because you were mentioned.Message ID: @.***>

-- -Brent Shambaugh

GitHub: https://github.com/bshambaugh Website: http://bshambaugh.org/ LinkedIN: https://www.linkedin.com/in/brent-shambaugh-9b91259 Skype: brent.shambaugh Twitter: https://twitter.com/Brent_Shambaugh WebID: http://bshambaugh.org/foaf.rdf#me

bshambaugh avatar Oct 19 '22 16:10 bshambaugh

nist-weierstrauss…v 1.30… i will get my computer back in a few hours…minutes…etc…my sister has been borrowing it to do ballet on Zoom

On Wednesday, October 19, 2022, Brent Shambaugh @.***> wrote:

Speaking of this, I will give you permission today. Sorry about the delay. most-weierstrauss was updated earlier this week.

On Wednesday, October 19, 2022, Mohsin Zaidi @.***> wrote:

cc @ukstv https://github.com/ukstv @smrz2001 https://github.com/smrz2001 @bshambaugh https://github.com/bshambaugh

is it possible to merge this still? we are moving key-did-resolver package to the dids repo, would be nice to merge/release here before moving over package codebase

I can run the tests by hand today.

— Reply to this email directly, view it on GitHub https://github.com/ceramicnetwork/js-ceramic/pull/2279#issuecomment-1284234409, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAC4YP5INOFXLTQITKTVWDWEAKT3ANCNFSM52DA6UHA . You are receiving this because you were mentioned.Message ID: @.***>

-- -Brent Shambaugh

GitHub: https://github.com/bshambaugh Website: http://bshambaugh.org/ LinkedIN: https://www.linkedin.com/in/brent-shambaugh-9b91259 Skype: brent.shambaugh Twitter: https://twitter.com/Brent_Shambaugh WebID: http://bshambaugh.org/foaf.rdf#me

-- -Brent Shambaugh

GitHub: https://github.com/bshambaugh Website: http://bshambaugh.org/ LinkedIN: https://www.linkedin.com/in/brent-shambaugh-9b91259 Skype: brent.shambaugh Twitter: https://twitter.com/Brent_Shambaugh WebID: http://bshambaugh.org/foaf.rdf#me

bshambaugh avatar Oct 19 '22 16:10 bshambaugh

521F3963-1FC2-44B2-93A3-C9F8F4941823 This is a screenshot I managed to take on my phone.

bshambaugh avatar Oct 19 '22 16:10 bshambaugh

@bshambaugh, can you please check this box on your PR so I can run the test workflow? It might be called "Allow edits and access to secrets by maintainers". image

@smrz2001 Is this working now?

bshambaugh avatar Oct 19 '22 18:10 bshambaugh

@bshambaugh, can you please check this box on your PR so I can run the test workflow? It might be called "Allow edits and access to secrets by maintainers". image

@smrz2001 Is this working now?

Thanks for updating this, @bshambaugh. It seems we'll need a few more changes to support test workflows running on forks 😖

What I'm going to do for now is to merge your PR into a new branch (based on develop) that I've created, and create a PR from there that will run the tests in the context of our GitHub/CircleCI org.

Sorry for the trouble, we'll figure this out at some point - the extra work is because we trigger tests externally in CircleCI, which makes it a little complicated to figure out for external contributors.

smrz2001 avatar Oct 19 '22 21:10 smrz2001

@bshambaugh, in case additional changes are needed (hopefully not), it would be great if you could set bshambaugh-merge as your target branch, whether through re-opening this PR or a new one. That way, all changes will propagate to the new merge PR I created, and tests will get run.

smrz2001 avatar Oct 19 '22 21:10 smrz2001

Hey @bshambaugh I created a PR to your package https://github.com/bshambaugh/nist-weierstrauss/pull/1

As for now, the package contains some unnecessary dependencies. ts-jest as prod dependency is definitely not good.

ukstv avatar Oct 26 '22 15:10 ukstv