Skip to content

rework TryFrom converting signatures to accept a ref #573

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

Merged
merged 1 commit into from
May 10, 2025

Conversation

baloo
Copy link
Contributor

@baloo baloo commented Apr 1, 2025

This also introduce an implementation for transforming a generic signature to an ecdsa signature.

where
C: PrimeCurve,
SignatureSize<C>: ArrayLength<u8>,
{
type Error = Error;

fn try_from(signature: EccSignature) -> Result<Self> {
fn try_from(signature: &EccSignature) -> Result<Self> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine because FieldBytes does not seem to be able to contain references. The only thing I would change would perhaps to use

FieldBytes::<C>::clone_from_slice()

@baloo baloo force-pushed the baloo/signature/try-from-ref branch from 4e7ec40 to 5cc3c02 Compare April 16, 2025 02:47
This also introduce an implementation for transforming a
generic signature to an ecdsa signature.


Signed-off-by: Arthur Gautier <[email protected]>
@baloo baloo force-pushed the baloo/signature/try-from-ref branch from 5cc3c02 to bfb3123 Compare April 16, 2025 02:55
@wiktor-k wiktor-k enabled auto-merge May 10, 2025 16:43
Copy link
Collaborator

@wiktor-k wiktor-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks straightforward. Thanks! 👍

@wiktor-k wiktor-k merged commit 38a3558 into parallaxsecond:main May 10, 2025
12 checks passed
@baloo baloo deleted the baloo/signature/try-from-ref branch May 12, 2025 01:57
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.

3 participants