-
Notifications
You must be signed in to change notification settings - Fork 485
fix DSA dependency to SHA2 #546
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
Conversation
|
@karel-m Would something speak against implementing this as follows? hash = -1;
#if defined(LTC_SHA3)
hash = register_hash(&sha3_512_desc);
#elif defined(LTC_SHA512)
hash = register_hash(&sha512_desc);
#elif defined(LTC_SHA384)
hash = register_hash(&sha384_desc);
#elif defined(LTC_SHA256)
hash = register_hash(&sha256_desc);
#endif
if (hash == -1) {
return CRYPT_INVALID_ARG; /* no appropriate hash function found */
}
if (N > hash_descriptor[hash].hashsize * 8) {
return CRYPT_INVALID_ARG; /* group_size too big */
} |
|
I am looking at: plus: Which makes me think that |
karel-m
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Before merge just check my last commit.
5a79e00 to
10d1c18
Compare
|
I'm a bit uncertain whether this is even according to the standard what we do here ... The implementation is according to FIPS 186-4 A.1.1.2, which states in the first step "Check that the (L, N) pair is in the list of acceptable (L, N pairs) (see Section 4.2)." Section 4.2 says valid pairs are only
or is this all intentionally left open? ... writing all this while also keeping in mind that FIPS 186-5 (which is still in draft) forbids signing with the DSA algorithm and only allows verification of DSA signatures! |
|
Yes, 4096bit DSA is "out of FIPS". On the other hand OpenSSL is able to generate 4096 dsaparam and according my observation they use: OpenSSL supports even 8192 dsaparam generation (with Our doc recommends: (EDITED) Ad |
|
I am not sure whether |
|
And maybe we should introduce |
alright, so it's intentional and we should also keep it open.
OK
OK |
|
Check my last commit |
|
Is IIUC it would prevent usage of keys generated by OpenSSL with L = 8192, N = 256. |
|
You mean something like this? /* Max diff between group and modulus size in bytes (max case: L=8192bits, N=256bits) */
#define LTC_MDSA_DELTA 992
/* Max DSA group size in bytes */
#define LTC_MDSA_MAX_GROUP 64
/* Max DSA modulus size in bytes (the actual DSA size, max 8192 bits) */
#define LTC_MDSA_MAX_MODULUS 1024 |
yep, that looks better |
DSA had a hard dependency to the basic sha2 operations. In case one wanted to compile e.g. only with sha256 this lead to a compilation error.
This allows registering an own implementation with a different descriptor name.
f1ec999 to
2e04ac9
Compare
… LTC_MDSA_DELTA, new LTC_MDSA_MAX_MODULUS
2e04ac9 to
9a07c42
Compare
|
👍 |
Signed-off-by: Steffen Jaeckel <[email protected]>
DSA had a hard dependency to the basic sha2 operations.
In case one wanted to compile e.g. only with sha256 this lead to a
compilation error.
While working on this I thought whether it wouldn't make sense to use sha3 there or at least give the possibility.