-
Notifications
You must be signed in to change notification settings - Fork 309
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
Release v1.7.0 #266
Release v1.7.0 #266
Conversation
1.7.0 (2019-10-11)Bug Fixes
Features
Reverts |
This comment has been minimized.
This comment has been minimized.
This reverts commit 29ef1c9.
This comment has been minimized.
This comment has been minimized.
This reverts commit 87210f7.
0152e8a
to
e38cefd
Compare
|
||
const jwk = await CryptoKeyToJsonWebKey(key) | ||
if (!jwk.x || !jwk.y) throw new Error('Invalid key') | ||
const hash = (await Gun.SEA.work(jwk.x! + jwk.y!, hashPair))! |
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.
Apologies for being laaaaaate to the new payload party, but we really can just get away with only hashing x
as long as we are on EC. Let's fix that before -38 gets released and formalized. And may I ask what's exactly in the hashPair
? Is somehow derived from the name K256? If not, we should fix that with something like jwk.kty + jwk.alg as salt.
PS: I don't see the point of doing a PBKDF2 on a public key when all we need is a fingerprint. Gun.SEA.work can use SHA-256.
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.
hashPair is a random UUID. You can think it is some type of salt but shared to generate a stable output between clients.
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.
jwk.x
or jwk.x + jwk.y
is not important, we just need a hash, does the current way looks good to you?
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.
No, because by only hashing the points we are throwing away algorithmic information previously provided by hashing the entire thing. This breaks the #191 mandate of being able to stably process a multitude of curves.
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.
You can see we cut the N chars of the hash. return hash.substring(0, N)
.
This is not a full hash, it's more like a "partition"
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.
"Hashing the entire thing" does not mean taking the full hash. It means that we used to hash the entire JWK object, which contained information about the algorithm in jwk.kty + jwk.alg
. We are not including it anymore, which is a short-sighted view especially given that the current salt has no use.
You are trying to go through this quick by dismissing everything without reading them through.
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.
The design here is from the https://github.com/DimensionDev/Maskbook/wiki/Data-structure-on-Gun-version-2 . Maskbook is only using the a part of "feature" of the key, it should be stable, but it's content is not important
Fresh install tests
Upgrade install tests
Release
Changes:
v1.6.0...29ef1c9