{"id":30116421,"url":"https://github.com/alessandroconti11/constant_time-parallel_shuffling","last_synced_at":"2025-08-10T09:37:43.607Z","repository":{"id":308520090,"uuid":"1018863725","full_name":"AlessandroConti11/Constant_Time-Parallel_Shuffling","owner":"AlessandroConti11","description":"Shuffling arrays in constant time is a common problem in modern cryptography. This project involves analyzing the technique proposed in https://cr.yp.to/2024/insertionseries-20240515.py, and implementing it in C, possibly employing parallelization.","archived":false,"fork":false,"pushed_at":"2025-08-06T10:05:05.000Z","size":7867,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-06T12:07:12.896Z","etag":null,"topics":["c","complexity-study","computer-engineering","computer-science-and-engineering","constant-weight-word","cryptography","cryptography-and-architecture-for-computer-securit","cww","daniel-j-bernstein","djb","insertion-in-array","insertion-series","polimi","porting","porting-python-to-c","python-to-c"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlessandroConti11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-13T08:01:33.000Z","updated_at":"2025-08-06T10:05:08.000Z","dependencies_parsed_at":"2025-08-06T12:07:24.073Z","dependency_job_id":"54aad279-7c6d-46e4-9f17-d937865d9930","html_url":"https://github.com/AlessandroConti11/Constant_Time-Parallel_Shuffling","commit_stats":null,"previous_names":["alessandroconti11/constant_time-parallel_shuffling"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/AlessandroConti11/Constant_Time-Parallel_Shuffling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessandroConti11%2FConstant_Time-Parallel_Shuffling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessandroConti11%2FConstant_Time-Parallel_Shuffling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessandroConti11%2FConstant_Time-Parallel_Shuffling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessandroConti11%2FConstant_Time-Parallel_Shuffling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlessandroConti11","download_url":"https://codeload.github.com/AlessandroConti11/Constant_Time-Parallel_Shuffling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessandroConti11%2FConstant_Time-Parallel_Shuffling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269705720,"owners_count":24462175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","complexity-study","computer-engineering","computer-science-and-engineering","constant-weight-word","cryptography","cryptography-and-architecture-for-computer-securit","cww","daniel-j-bernstein","djb","insertion-in-array","insertion-series","polimi","porting","porting-python-to-c","python-to-c"],"created_at":"2025-08-10T09:37:43.026Z","updated_at":"2025-08-10T09:37:43.596Z","avatar_url":"https://github.com/AlessandroConti11.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Constant_Time-Parallel_Shuffling\n\n\nAuthor: Alessandro Conti - [AlessandroConti11](https://github.com/AlessandroConti11)\n\nLicense: [MIT license](LICENSE).\n\n\nTags: `#c`, `#complexity_study`, `#computer_engineering`, `#computer_science_and_engineering`, `#constant-weight_word`, `#cww`, `#cryptography`, `#cryptography_and_architecture_for_computer_security`, `#daniel_j_bernstein`, `#djb`, `#insertion_in_array`, `#insertion_series`, `#polimi`, `#porting`, `#porting_python_to_c`, `#python_to_c`.\n\n\n## University\n\nPolitecnico di Milano.\n\nAcademic Year: 2024/2025.\n\n095947 - CRYPTOGRAPHY AND ARCHITECTURES FOR COMPUTER SECURITY - professor Pelosi Gerardo\n\n\n## Specification\n\nShuffling arrays in constant time is a common problem in modern cryptography. This project involves analyzing the technique proposed in https://cr.yp.to/2024/insertionseries-20240515.py, and implementing it in C, possibly employing parallelization.\n\nThis repository contains the porting to C of:\n- the insertionSeries algorithm;\n- the constant-weight word creation algorithm\n\nimplemented by Daniel J. Bernstein in Python.\nBoth the sequential and parallel versions of the algorithm have been implemented to demonstrate scalability and adaptability in multicore environments.\n\nIn addition to simple transcription, the project also analyses the computational complexities of the algorithms, providing a basis for optimisation and benchmarking.\n\n\n## How to run\n\nThe steps below refer to a Unix environment, for other environments the commands may change.\n\n0. install gcc\n    ```bash\n    sudo apt-get install gcc \n    ```\n1. compile each source file into an object file\n    ```bash\n    gcc -std=c11 -Wall -Werror -Wextra -O2 -fopenmp -c FILE.c -o FILE.o\n    ```\n2. link all object files into an executable\n    ```bash\n    g++ -std=c11 -Wall -Werror -Wextra -O2 -fopenmp\\\n    main.o \\\n    utility/intList.o \\\n    utility/pairList.o \\\n    utility/safeRealloc.o \\\n    insertion_series/insertionSeries.o \\\n    constant-weight_words/constantWeightWord.o\n    -o EXECUTABLE\n    ```\n3. run the executable\n    ```bash\n    ./EXECUTABLE\n    ```\n\n\u003cbr\u003e\n\nThe Makefile in the repository can also be used to compile the code.\n- this option allows you to compile with the following tags: *-std=c11 -Wall -Werror -Wextra -O2 -fopenmp*\n    ```bash\n    make\n    ```\n- if you want to specify different tags, you can set them\n   ```bash\n   make CXXFLAGS=YOUR_FLAGS\n   ```\n- if you want to remove all .o files and the final executable\n    ```bash\n    make clean\n    ```\n\n\u003cbr\u003e\n\nThe CMakeLists.txt in the repository can also be used to compile the code.\n0. install cmake\n    ```bash\n    sudo apt-get install cmake\n    ```\n1. create the build folder\n    ```bash\n    mkdir build \u0026\u0026 cd build\n    ```\n2. generate compilation files\n    ```bash\n    cmake ..\n    ```\n3. build the project\n    ```bash\n    cmake --build .\n    ```\n4. run the executable\n    ```bash\n    ./djb\n    ```\n\n\u003cbr\u003e\n\nIf you want to test the functioning of the algorithms, there is a main program suitable for testing the two algorithms.\n- To run the **insertionSeries** algorithm\n    ```bash\n    ./EXECUTABLE --insertionseries\n    ```\n- To run the **cww** algorithm\n    ```bash\n    ./EXECUTABLE --cww\n    ```\nIt is also possible to decide whether to run the two algorithms in serial or in parallel mode by adding the *--serial* or *--parallel* options.\n\n## Contribute\n\n- If you find a security vulnerability, do NOT open an issue. Email [Alessandro Conti](mailto:ale.conti.1101@gmail.com) instead.\n- If you find a bug or error or want to add some other function that is not implemented yet\n    1. **FORK** the repo\n    2. **CLONE** the project to your own machine\n    3. **COMMIT** to your own branch\n    4. **PUSH** your work back up to your fork\n    5. submit a **PULL REQUEST** so that I can review your changes\n  \u003e NOTE: Be sure to merge the latest from \"upstream\" before making a pull request!\n\n\n### Code Style\n\nEach new function must be documented using the following style:\n- *Short function description*: A brief description explaining what the function does.\n- *@warning*: A section listing all the assumptions made by the function, such as the preconditions that the parameters must fulfil.\n- *Blank line*: Add a blank line to separate the documentation sections.\n- *@details*: A detailed section describing how the function works, explaining the algorithms and logic used.\n- *Blank line*: Add a blank line to separate the documentation sections.\n- *@param*: A list of the parameters required by the function, each accompanied by a brief description of its role and type.\n- *@return*: A description of what the function returns, including the data type.\n\nIn general, any additional comments that might improve understanding of the code are welcome. 😃\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessandroconti11%2Fconstant_time-parallel_shuffling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falessandroconti11%2Fconstant_time-parallel_shuffling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessandroconti11%2Fconstant_time-parallel_shuffling/lists"}