Exactlywb / grasshopper_riscv

Implementation of a project on information security course
MIT License
0 stars 0 forks source link

draft implementation of tables pregeneration #25

Closed pavel-collab closed 11 months ago

pavel-collab commented 11 months ago

This is a my implementation of tables pregeneration. I've just move all generation functions to the new file generation/GenerateTables.c. This file is compiled, run and write all information to the 3 .dat files. After that content from this files is copied and pasted to the config.h.

Also, For now I've commented some functions in the original files, cause now we don't need it anymore.

As I've understood we need to generate this tables once at all. We will never generate it again (except if we won't change the base polynom).

pavel-collab commented 11 months ago

I've generated a tables.h and put it into include/utils/. For now I need your help. @Exactlywb could you, please check out GenerateTables.c and other files once again (code style fixes etc). @kolobabka I need your help with includes and build system. As you were writing CMake files, could you, please, make tables.h available in grasshopper.c, config.h and grasshopper.h and maybe other files if it need and write necessary dependencies.

And please, don't worry about commits. When all fixes will be done, I will do patch to save all changes in one commit.

Exactlywb commented 11 months ago

LGTM. Needs to be tested (also perfomance tests)

Exactlywb commented 11 months ago

Also update README.md with table generation info pls

Exactlywb commented 11 months ago

You still have function apply_l in vectorized.c. It's not need here anymore. This function is used only for tables content generation and you have moved it to GenerateTables.c So, you need to remove its implementation from this file. Also check if it's still exists this function prototype in some .h files and remove it also.

Done (performance boost for this function is still available in README.md; it is too sad to remove it)

pavel-collab commented 11 months ago

You still have function apply_l in vectorized.c. It's not need here anymore. This function is used only for tables content generation and you have moved it to GenerateTables.c So, you need to remove its implementation from this file. Also check if it's still exists this function prototype in some .h files and remove it also.

Done (performance boost for this function is still available in README.md; it is too sad to remove it)

It will be removed in the branch with experiment python script. When branch experiment will be merged in master user will be able to generate such table automaticly. It's not a problem for this branch now.