-
Notifications
You must be signed in to change notification settings - Fork 28
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 Dilithium to genkey, sign-verify and gen-sig-ver test #150
Conversation
Can one of the admins verify this patch? |
OK to test |
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.
Thanks @Yu-Ma28051503, great start on this! Please add a test case to the tests/ directory. Possibly in genkey_sign_verify sub-folder or a new folder if wanted for Dlithium tests.
src/genkey/clu_genkey.c
Outdated
int ret = WOLFCLU_SUCCESS; | ||
|
||
int fNameSz; | ||
int fExtSz = 6; |
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.
Add a comment on why 6 is the value chosen here.
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.
This value is sizeof of file extension such as ".priv\0" and ".pub\0\0".
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.
fixed it
src/genkey/clu_genkey.c
Outdated
int keySz, int level, int withAlg, int keyType) | ||
{ | ||
#ifdef HAVE_DILITHIUM | ||
dilithium_key key; |
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.
Lets start this out with supporting small stack. WOLFSSL_SMALL_STACK.
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.
Having the compile time option of putting large variables on the heap instead.
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.
fixed it
src/genkey/clu_genkey.c
Outdated
/* set up the file name output buffer */ | ||
if (ret == WOLFCLU_SUCCESS) { | ||
fNameSz = (int)XSTRLEN(fName); | ||
fOutNameBuf = (char*)XMALLOC(fNameSz + fExtSz, HEAP_HINT, |
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.
Sanity checks on the size before malloc. If fNameSz + fExtSz wraps around int type, fNameSz for some reason is negative, possibly upper bounds to avoid an abuse but is trickier to make a great upper bounds value here.
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.
fixed it
Thank you to test. |
3d2c3f3
to
d554d99
Compare
No description provided.