Skip to content

OcCryptoLib: Add Streebog support#377

Open
lakreite wants to merge 26 commits into
acidanthera:masterfrom
lakreite:master
Open

OcCryptoLib: Add Streebog support#377
lakreite wants to merge 26 commits into
acidanthera:masterfrom
lakreite:master

Conversation

@lakreite

@lakreite lakreite commented Aug 4, 2022

Copy link
Copy Markdown

Streebog support added into OcCryptoLib.

@vit9696 vit9696 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/.

Comment thread Include/Acidanthera/Library/OcCryptoLib.h Outdated
Comment thread Library/OcCryptoLib/gost3411-2012-const.h Outdated
Comment thread Library/OcCryptoLib/OcCryptoLib.inf Outdated
Comment thread Library/OcCryptoLib/gost3411-2012-const.h Outdated
Comment thread Library/OcCryptoLib/gost3411-2012-core.c Outdated
Comment thread Utilities/TestStreebog/Makefile Outdated
Comment thread Utilities/TestStreebog/StreebogPreprocess.c
Comment thread Utilities/TestStreebog/Makefile
Comment thread Utilities/TestStreebog/StreebogPreprocess.c Outdated

@vit9696 vit9696 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI is broken again, please fix. Also added more messages inline.

Comment thread Include/Acidanthera/Library/OcCryptoLib.h Outdated
Comment thread Include/Acidanthera/Library/OcCryptoLib.h Outdated
Comment thread Include/Acidanthera/Library/OcCryptoLib.h Outdated
Comment thread Library/OcCryptoLib/Streebog.c Outdated
Comment thread Library/OcCryptoLib/Streebog.c Outdated
Comment thread Library/OcCryptoLib/Streebog.h Outdated
Comment thread Utilities/TestStreebog/StreebogPreprocess.c Outdated
Comment thread Utilities/TestStreebog/StreebogPreprocess.c Outdated
Comment thread Utilities/TestStreebog/StreebogPreprocess.c Outdated
Comment thread Utilities/TestStreebog/StreebogPreprocess.c Outdated
#include <Library/OcCryptoLib.h>
#include <BigNumLib.h>

#define HASHSIZE 64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) {

@PMheart PMheart Oct 13, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IN and OUT specifiers are missing, for all.

CONST UINT32 digest_size
)
{
UINT32 i;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be UINTN.

GOST34112012Cleanup (Context);
Context->digest_size = digest_size;

for (i = 0; i < 8; i++) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Even though clear, is it better if a macro is assigned to the magic number8?

@PMheart

PMheart commented Mar 12, 2023

Copy link
Copy Markdown
Member

@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.

@Cam396

Cam396 commented Jul 18, 2024

Copy link
Copy Markdown

is this pull request ever going to get merged?

@vit9696

vit9696 commented Jul 18, 2024

Copy link
Copy Markdown
Contributor

Well, currently the review comments are not addressed yet. If you are willing to pick it up and complete, you are gladly welcome ^_^

@Cam396

Cam396 commented Jul 18, 2024

Copy link
Copy Markdown

i could try but i would have to learn C

@okocsis

okocsis commented Jul 23, 2024

Copy link
Copy Markdown

i could try but i would have to learn C

Can I land a hand here?

@vit9696

vit9696 commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

Well, we do not mind, please start with fixing up the CI.

@okocsis

okocsis commented Jul 23, 2024

Copy link
Copy Markdown

Well, we do not mind, please start with fixing up the CI.

okie doke

@Spoou Spoou left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

k哦

@Spoou Spoou left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OBJS += RsaDigitalSign.o BigNumMontgomery.o BigNumPrimitives.o BigNumWordMul64.o Sha2.o SecureMem.o Sha512AccelDummy.o Streebog.o

Comment thread User/Makefile
#
# OcCryptoLib targets.
#
OBJS += RsaDigitalSign.o BigNumMontgomery.o BigNumPrimitives.o BigNumWordMul64.o Sha2.o SecureMem.o Sha512AccelDummy.o

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OBJS += RsaDigitalSign.o BigNumMontgomery.o BigNumPrimitives.o BigNumWordMul64.o Sha2.o SecureMem.o Sha512AccelDummy.o Streebog.o

@jackacc

jackacc commented Nov 25, 2025

Copy link
Copy Markdown

Nvidia Legacy

GeForce 8400 GS, ION 2, GeForce 205, 210, G 210M, 305M, 310(M), 405
Quadro FX (380 LP, 380M), NVS (300, 2100M, 3100M)
GeForce 8100, 8200, 8300 mGPU / nForce 700a series, 8200M G
GeForce 9300, 9400 mGPU / nForce 700i series, 8200M G, 9100M, 9400M (G)
GeForce 320M
GeForce GTX (465, 470, 480, 480M)
Quadro 4000, 5000[M] , 6000

How to set up OC to drive Nvidia Legacy graphics cards

@Android-Artisan

Copy link
Copy Markdown

this pr took 3-4 years. dam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

9 participants