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

Add method to retrieve hash from AsymSign #73

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

ionut-arm
Copy link
Member

This commit adds a method to AsymmetricSignature to retrieve the hash
algorithm it is restricted to.

Signed-off-by: Ionut Mihalcea ionut.mihalcea@arm.com

@ionut-arm ionut-arm added the enhancement New feature or request label Feb 11, 2021
@ionut-arm ionut-arm requested a review from hug-dev February 11, 2021 14:45
@ionut-arm ionut-arm self-assigned this Feb 11, 2021
@@ -437,6 +437,19 @@ impl AsymmetricSignature {
}
}
}

/// Retrieves the specific hash that the `AsymmetricSignature` algorithm is restricted to.
pub fn hash(self) -> SignHash {
Copy link
Member

Choose a reason for hiding this comment

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

I would personally prefer returning Option<SignHash> and return None for EcdsaAny and RsaPkcs1v15SignRaw so that all different cases are covered for this method. Maybe differentiating between those cases will be useful in the future?

This commit adds a method to `AsymmetricSignature` to retrieve the hash
algorithm it is restricted to.

Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

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

Thanks!

@ionut-arm ionut-arm merged commit c3a73aa into parallaxsecond:master Feb 11, 2021
@ionut-arm ionut-arm deleted the asym-sign-hash branch February 11, 2021 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants