feat: ed25519 & secp256k1 sig verification helper modules#3952
feat: ed25519 & secp256k1 sig verification helper modules#3952jacobcreech merged 14 commits intosolana-foundation:masterfrom
Conversation
|
Someone is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
601ec37 to
d1d65e4
Compare
swaroop-osec
left a comment
There was a problem hiding this comment.
Also why there is two folders signature_verifications and signature_verification?
Initially I created
|
|
Closes #3944 |
|
|
||
| expected.push(1u8); // num signatures | ||
| expected.extend_from_slice(&sig_offset.to_le_bytes()); | ||
| expected.push(0u8); // sig ix idx |
There was a problem hiding this comment.
Should we change this to always index into the current instruction (would require us to call solana_program::sysvar::instructions::load_current_index_checked) or add the index as an argument?
I think it's a bit confusing if verify_ed25519_ix operates on the current instruction, but verify_secp256k1_ix defaults to the first one.
Maybe both this functions should take an index as argument and we add two helper functions which always call them with the current index?
…ndation#3952) * feat: ed25519 & secp256k1 sig verification helper modules * fix: fmt/clippy * feat: workflow tests * fix: yarn lint * fix: yarn test * fix: workflow tests with ts-mocha & naming errors * fix: yarn lint * fix: review comments * fix: ref ix data itself for indecies * cargo fmt -- --check * cargo clippy * chore(feat): requseted changes for seperate current index and ix params functions --------- Co-authored-by: Akash Thota <your.email@example.com> Co-authored-by: Akash Thota <Otter-0x4ka5h@osec.io> Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com>
Changes summary
Added signature_verifications/ module with:
ed25519::verify_ed25519_ixandsecp256k1::verify_secp256k1_ix.Implementations:
program_id, no accounts, and bounds.Error handling:
Ed25519InvalidProgram, Secp256k1InvalidProgram, InstructionHasAccounts, MessageTooLong, DataLengthMismatch, InvalidRecoveryId, NumSigsAddrsMismatch.