Skip to content

Conversation

@yahyazadeh
Copy link

Added support for implicit NULL parameter case in pkcs1 signature verification

@bdauvergne
Copy link
Owner

Seems great, could you add a test vector for this use case ? Do not try to add to the existing one extracted from PKCS#1 specification, just add it directly in the test files.

@yahyazadeh
Copy link
Author

I might not be able to do this at the moment but may try this later.

@bmurray7 bmurray7 mentioned this pull request Jan 22, 2022
except ValueError:
raise exceptions.RSAModulusTooShort
return primitives.constant_time_cmp(em, em_prime)
return primitives.constant_time_cmp(em, em_prime) or primitives.constant_time_cmp(em, em_prime_imp)

Choose a reason for hiding this comment

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

Is this still constant time?

In an or statement, Python only evaluates the second condition if the first condition evaluates to True. See the Python specification for Boolean operations..

Copy link
Owner

Choose a reason for hiding this comment

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

You are right. But don't expect this lib to give you real constant time even with this change. It's a toy implementation, if you need a really hardened implementation of RSA, there are a lot around written in C or ASM.

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