StartingContributors.md - Open-CP/OCP GitHub Wiki
Quick Start for Contributors
This guide provides instructions for contributing to OCP.
Contribution to Operators
- Adding New Operators
- Define a new operator class in
operators/operators.py
. - Implement the operator's functionality and modeling methods in alignment with existing operators.
- Extending Existing Operators
- Add new Python and C implementations to optimize performance in
generate_implementation()
. - Add new modeling techniques (e.g., "MILP", "SAT") by specifying
model_type
ingenerate_model()
- Add new modeling versions (e.g., "diff", "truncated_diff", "linear") for various cryptanalysis techniques by specifying
model_version
ingenerate_model()
.
Contribution to Primitives
- Adding New Primitives
- Create a
new_primitive.py
file inprimitives/
. - Define a new operator class in
new_primitive.py
and implement its structure in alignment with existing primitives.
- Extending Existing Primitives
- Add new representation modes by specifying
represent_mode
in the corresponding primitive class to enhance flexibility.
Contribution to Cryptanalysis
- Adding New Cryptanalysis Techniques(e.g., Linear Cryptanalysis)
- Implement modeling methods for the new cryptanalysis technique in
operators.py
. - Define the new attack method in
attacks/attacks.py
, for example,def linear_attacks()
, following the structure of existingdiff_attacks()
. This includes:- Constructing MILP or SAT models for the attack.
- Solving models using available solvers.
- Obtaining and analyzing results.
Contribution to Automated Analysis Techniques
- Adding Automated Analysis Techniques
- Extend
model_type
inoperators.py
to support additional techniques (e.g., CP). - Integrate the new techniques into
attacks/attacks.py
, such as extendingmodel_type
indiff_attack()
.
- Allowing flexible solver selection
- Extend support support for additional solvers and enable user-defined solver configurations in
solving/solving.py
. - Currently, Gurobi is used for MILP models, and CryptoMinisat for SAT models.