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

Update Secp256r1 Instruction with Message Length as Immediate #534

Closed
wants to merge 2 commits into from

Conversation

SilentCicero
Copy link
Member

@SilentCicero SilentCicero commented Nov 7, 2023

Abstract

The current specified implementation of the Secp256r1 opcode assumes a 32 byte message being signed over, however, in the current widespread use of the curve in WebAuthn and passkeys, the signed message is larger than 32 bytes (e.g. 69 bytes).

Solution

Allow the immediate value to specify a more flexible message length beyond or below 32 bytes.

Considerations

  • For consistency, we should perhaps also enable a more flexible message length for the secp256k1 opcode.

@Dentosal
Copy link
Member

Dentosal commented Nov 8, 2023

The thing we're signing with the opcode is not a message, but the hash of a message. In WebAuthn, the original message is condensed into the required 32 bytes using SHA-256, which is already available using S256 instruction.

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

Successfully merging this pull request may close these issues.

2 participants