OcCryptoLib: Add Streebog support#377
Conversation
vit9696
left a comment
There was a problem hiding this comment.
Commented about most obvious issues with the code. There also are several codestyle issues with the code. Check https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/.
vit9696
left a comment
There was a problem hiding this comment.
CI is broken again, please fix. Also added more messages inline.
| #include <Library/OcCryptoLib.h> | ||
| #include <BigNumLib.h> | ||
|
|
||
| #define HASHSIZE 64 |
There was a problem hiding this comment.
This must come from OcCryptoLib.h, not be defined here.
| #elif defined (__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | ||
| buf.QWORD[0] = BSWAP64 (CTX->bufsize << 3); | ||
| #else | ||
| #if (defined (__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || defined(MDE_CPU_IA32) || defined(MDE_CPU_X64) |
There was a problem hiding this comment.
Please introduce separate macros STREEBOG_LITTLE_ENDIAN and STREEBOG_BIG_ENDIAN in Streebog.h to reduce the length.
| STREEBOG_CONTEXT *Context | ||
| ) | ||
| { | ||
| for (INT32 i = 0; i < 64; ++i) { |
There was a problem hiding this comment.
EDK-II convention follows the rule where variables are declared at the beginning of functions; the same idea follows throughout the code.
Also, for indices, UINTN is used.
|
|
||
| VOID | ||
| Streebog256Init ( | ||
| STREEBOG_CONTEXT *Context |
There was a problem hiding this comment.
IN and OUT specifiers are missing, for all.
| CONST UINT32 digest_size | ||
| ) | ||
| { | ||
| UINT32 i; |
| GOST34112012Cleanup (Context); | ||
| Context->digest_size = digest_size; | ||
|
|
||
| for (i = 0; i < 8; i++) { |
There was a problem hiding this comment.
Even though clear, is it better if a macro is assigned to the magic number8?
|
@lakreite Hello! Is this PR still alive? If not, I can start working on this. Thanks! UPDATE - Assuming the original author will not work on this; I will start it. |
|
is this pull request ever going to get merged? |
|
Well, currently the review comments are not addressed yet. If you are willing to pick it up and complete, you are gladly welcome ^_^ |
|
i could try but i would have to learn C |
Can I land a hand here? |
|
Well, we do not mind, please start with fixing up the CI. |
okie doke |
Spoou
left a comment
There was a problem hiding this comment.
OBJS += RsaDigitalSign.o BigNumMontgomery.o BigNumPrimitives.o BigNumWordMul64.o Sha2.o SecureMem.o Sha512AccelDummy.o Streebog.o
| # | ||
| # OcCryptoLib targets. | ||
| # | ||
| OBJS += RsaDigitalSign.o BigNumMontgomery.o BigNumPrimitives.o BigNumWordMul64.o Sha2.o SecureMem.o Sha512AccelDummy.o |
There was a problem hiding this comment.
OBJS += RsaDigitalSign.o BigNumMontgomery.o BigNumPrimitives.o BigNumWordMul64.o Sha2.o SecureMem.o Sha512AccelDummy.o Streebog.o
|
Nvidia Legacy GeForce 8400 GS, ION 2, GeForce 205, 210, G 210M, 305M, 310(M), 405 How to set up OC to drive Nvidia Legacy graphics cards |
|
this pr took 3-4 years. dam |
Streebog support added into OcCryptoLib.