Skip to content

[rc-naga-2025-01-30] Compatibility #786

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

Draft
wants to merge 22 commits into
base: feat/naga-fix-bls-wasm-cleanup
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
756eb2c
add combiner for all
mikelodder7 Jan 27, 2025
eb24a01
fix generic-array version
mikelodder7 Jan 27, 2025
4ab5e93
remove unneeded code
mikelodder7 Jan 28, 2025
d3a198b
add tests for combine_and_verify that also print the results
mikelodder7 Jan 30, 2025
80b49b2
Merge pull request #779 from LIT-Protocol/ml/combine_all_signatures
Ansonhkg Jan 31, 2025
5d4ab05
feat: use rust unified combiner to support frost and multiple ecdsa s…
FedericoAmura Feb 11, 2025
63ac695
Merge branch 'refs/heads/feat/naga-fix-bls-wasm-cleanup' into feat/rc…
FedericoAmura Feb 12, 2025
e0b7b66
Merge branch 'refs/heads/feat/rc-naga-2025-01-30b' into feature/lit-4…
FedericoAmura Feb 12, 2025
fcc5757
feat: building fixes and cleanup
FedericoAmura Feb 12, 2025
6e736ff
feat: restore claims inside lit actions signature aggregation
FedericoAmura Feb 12, 2025
42a380f
feat: types unification
FedericoAmura Feb 12, 2025
d617a04
feat: removed unused types and executeJs return fixes
FedericoAmura Feb 12, 2025
f6213a4
feat: update PKPWallets with new signing schemes
FedericoAmura Feb 13, 2025
3112779
feat: linting fixes
FedericoAmura Feb 13, 2025
fe4c47b
feat: a missing linting fix that should complete ci check
FedericoAmura Feb 13, 2025
b04daad
fix: failing unit tests
FedericoAmura Feb 13, 2025
0f7a88e
fix: circular reference with PRODUCT_IDS
FedericoAmura Feb 14, 2025
341ea36
feat: clean ecdsa wasm
FedericoAmura Feb 14, 2025
b2734b7
feat: update pkpSign test to use verify all signing schemes and remov…
FedericoAmura Feb 14, 2025
976e3d7
feat: comment bls usage on pkpSign as it will not be supported yet
FedericoAmura Feb 14, 2025
685f759
feat: remove types import in constants
FedericoAmura Feb 17, 2025
df88cf5
Merge pull request #799 from LIT-Protocol/feature/lit-4007-js-sdk-add…
FedericoAmura Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unneeded code
Signed-off-by: Michael Lodder <mike@litprotocol.com>
  • Loading branch information
mikelodder7 committed Jan 28, 2025
commit 4ab5e93d6d66a7e05eb408baeb47c472f06fec8f
2 changes: 1 addition & 1 deletion packages/wasm/rust/src/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ where
<ecdsa::VerifyingKey<C> as PrehashVerifier<Signature<C>>>::verify_prehash(
&vk, &message, &signature,
)
.map_err(|_| JsError::new("ecdsa verification failed"))?;
.map_err(|_| JsError::new("ecdsa signature verification failed"))?;

let digest_bytes = hex::decode(&shares[0].digest).map_err(|_| JsError::new("digest"))?;
let rid = RecoveryId::trial_recovery_from_prehash(&vk, &digest_bytes, &signature)
Expand Down
79 changes: 0 additions & 79 deletions packages/wasm/rust/src/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,85 +258,6 @@ where
}
}

/// Perform all three functions at once
#[wasm_bindgen(js_name = "ecdsaCombineAndVerifyWithDerivedKey")]
pub fn ecdsa_combine_and_verify_with_derived_key(
variant: EcdsaVariant,
pre_signature: Uint8Array,
signature_shares: Vec<Uint8Array>,
message_hash: Uint8Array,
id: Uint8Array,
public_keys: Vec<Uint8Array>,
) -> JsResult<EcdsaSignature> {
match variant {
EcdsaVariant::K256 => Ecdsa::<Secp256k1>::combine_and_verify_with_derived_key(
pre_signature,
signature_shares,
message_hash,
id,
public_keys,
),
EcdsaVariant::P256 => Ecdsa::<NistP256>::combine_and_verify_with_derived_key(
pre_signature,
signature_shares,
message_hash,
id,
public_keys,
),
}
}

/// Perform combine and verify with a specified public key
#[wasm_bindgen(js_name = "ecdsaCombineAndVerify")]
pub fn ecdsa_combine_and_verify(
variant: EcdsaVariant,
pre_signature: Uint8Array,
signature_shares: Vec<Uint8Array>,
message_hash: Uint8Array,
public_key: Uint8Array,
) -> JsResult<EcdsaSignature> {
match variant {
EcdsaVariant::K256 => Ecdsa::<Secp256k1>::combine_and_verify_with_specified_key(
pre_signature,
signature_shares,
message_hash,
public_key,
),
EcdsaVariant::P256 => Ecdsa::<NistP256>::combine_and_verify_with_specified_key(
pre_signature,
signature_shares,
message_hash,
public_key,
),
}
}

/// Combine ECDSA signatures shares
#[wasm_bindgen(js_name = "ecdsaCombine")]
pub fn ecdsa_combine(
variant: EcdsaVariant,
presignature: Uint8Array,
signature_shares: Vec<Uint8Array>,
) -> JsResult<EcdsaSignature> {
match variant {
EcdsaVariant::K256 => Ecdsa::<Secp256k1>::combine(presignature, signature_shares),
EcdsaVariant::P256 => Ecdsa::<NistP256>::combine(presignature, signature_shares),
}
}

#[wasm_bindgen(js_name = "ecdsaVerify")]
pub fn ecdsa_verify(
variant: EcdsaVariant,
message_hash: Uint8Array,
public_key: Uint8Array,
signature: EcdsaSignature,
) -> JsResult<()> {
match variant {
EcdsaVariant::K256 => Ecdsa::<Secp256k1>::verify(message_hash, public_key, signature),
EcdsaVariant::P256 => Ecdsa::<NistP256>::verify(message_hash, public_key, signature),
}
}

#[wasm_bindgen(js_name = "ecdsaDeriveKey")]
pub fn ecdsa_derive_key(
variant: EcdsaVariant,
Expand Down
Loading