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

Use a consistent definition of Ed25519 #137

Open
4 of 6 tasks
Yawning opened this issue May 14, 2021 · 7 comments
Open
4 of 6 tasks

Use a consistent definition of Ed25519 #137

Yawning opened this issue May 14, 2021 · 7 comments
Labels
c:client-sdk/go Category: Go client SDK c:client-sdk/typescript Category: TypeScript client SDK c:runtime-sdk Category: Runtime SDK

Comments

@Yawning
Copy link
Contributor

Yawning commented May 14, 2021

aka "Just use Ristretto"

@kostko
Copy link
Member

kostko commented May 14, 2021

Go: Use github.com/oasisprotocol/oasis-core/go/common/crypto/signature for Ed25519.

Isn't this already the case?

@kostko kostko added c:client-sdk/go Category: Go client SDK c:client-sdk/typescript Category: TypeScript client SDK c:runtime-sdk Category: Runtime SDK labels May 14, 2021
@Yawning
Copy link
Contributor Author

Yawning commented May 17, 2021

Go: Use github.com/oasisprotocol/oasis-core/go/common/crypto/signature for Ed25519.

Isn't this already the case?

Yeah, just being thorough.

@Yawning
Copy link
Contributor Author

Yawning commented May 17, 2021

Looking over the JS/TS case, applying the retrofit to tweetnacl is non-trivial. I don't know of any JS/TS libraries that both provide what is required, that I have high confidence in, so the question would be "how much do we care that JS/TS behaves in an inconsistent manner"?

As is (assuming the rust code is fixed), all signatures that Rust/Go implementations consider to be valid will be verify with the JS/TS implementation, but not in the reverse (there will be signatures that JS/TS code considers to be valid that will be rejected).

@pro-wh
Copy link
Contributor

pro-wh commented May 18, 2021

maybe we should get rid of the signature verification in the ts library. can we still use tweetnacl to sign consistently with the rust and go libraries?

@Yawning
Copy link
Contributor Author

Yawning commented May 19, 2021

can we still use tweetnacl to sign consistently with the rust and go libraries?

Signing behavior is consistent across basically every Ed25519 implementation, yes.

@Yawning
Copy link
Contributor Author

Yawning commented May 19, 2021

There probably should be documentation somewhere that SDK developers will see concerning our Ed25519 verification semantics just so people don't try to do something exotic and end up surprised.

All of the verification behavior is triggered by key-pairs and signatures that won't ever be generated by a honest implementation, and I'm not sure how much behavioral consistency matters on the client side...

@kostko kostko closed this as completed Jul 22, 2021
@Yawning
Copy link
Contributor Author

Yawning commented Jul 26, 2021

Wait, why did you close this? It is 100% possible to produce signatures that will pass validation with the js/ts code that will not anywhere else, because ts-web/core/src/signature.ts is flat out incorrect.

At the very least, this behavioral inconsistency should be documented somewhere.

@Yawning Yawning reopened this Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:client-sdk/go Category: Go client SDK c:client-sdk/typescript Category: TypeScript client SDK c:runtime-sdk Category: Runtime SDK
Projects
None yet
Development

No branches or pull requests

3 participants