Skip to content

Commit

Permalink
Release v1.0.0 (Crypto-TII#55)
Browse files Browse the repository at this point in the history
* removed _memory_access_cost from sd_helper and put it into base_estimator. Now all algorithms automatically have this feature. Added test for SDEstimator

* fixxed error

* forgot to add the SDFq Estimator to the root __init__ file

* table was with the wrong precision

* trying to fix the weird import error

* config: create cache on deploy workflow

* wrongly removed 'memoty_access_cost' in this branch

* removed scipy models to be able to understand this error

* add BBPS algorithm

* removed scipy model completly

* fix: tidy up Fq estimator

* added missing scipy model __init__

* reworked opt process, fixxt test and added

* fix: some final touches and fixes, included docker-testfast

* fixxed bugs by Javu

* updated pranges and sterns doc

* feature: integrate SDFqEstimator in LE and PEEstimator

* feat: add favicon for documentation

* feature: integrated SDFqEstimator and removed most float computations

* remorked PR

* reworked open points

* removed test file

* feat/reset api task cicd (Crypto-TII#29)

* feat: integrate gh actions with the estimators-api project

* refactor: rename workflows

* some fixes of the docs

* update PE beullens to used SDFq estimator

* reworked PR

* removed cost_isd

* updated refs

* removed comments

* added more tests

* added more tests and fixxed a few errors

* removed a comment

* Fix: mq estimator slow for large q >2**12

* added sdfq and PE extensive tests

* more tests

* added LE test

* add Pytests examples (Crypto-TII#33)

* feat: add mq test sample

* feat: add exception test example

* feat: add raised TypeError example

* refactor: delete requirements.txt

* refactor: improve make scripts

* refactor: trigger run-pytest.yml on pr to main

* fix: update workflow

---------

Co-authored-by: ariane <[email protected]>

* removed comments

* refactor: remove base_field from sd

* docs: remove 'q' from docstring

* refactor: remove baseField

* refactor: remove baseField

* refactor: remove baseField

* added input_dictionary bhanges

* refactor: add 'q' in to_bitcomplexity_time

* updated the tests for the new framework

* refactor: add base_field to mq_problem repr

* Doc/small typo base_algorithm.py (Crypto-TII#32)

* Doc/small typo base_algorithm.py

* fix: sd probabilistic test and disabled verbosity of docker-test

* fix test

---------

Co-authored-by: Memphisd <[email protected]>

* Doc:edditing doc in mq_problem, base_problem, and pk_problem

* fix: added memory access cost to overriden find_optimal_parameters function

* Problem paramters added

* Estimator parameters

* refactor: define tilde_o functions

* feature: add parameters_invalid function to general base class and use it for the valid choices function

* fix: verbose information

* fix: add find_optimal_tilde_o function

* feature: use invalid parameters function

* refactor: remove unnecessary check for parameter validity

* refactor: remove unnecessary time and memory function

* fix: verbose info of kmp and parameter validity check in sbc

* feat/optional-parameters-PKP-input-dic

* Adding landing page

* Adding landing page x 2

* refactor: crossbred.py usiing log2 in large integers

* f5, exhaustive_search and kpg

* mht

* f5 tilde_o_complexities + implications in hybrid_f5

* fix: sbc algorithm and pkestimator tests

* reworked long tests to run in sage

* reworked long tests to run in sage

* removed uneeded dile

* fix: failing test

* added BJMM+

* refactor: remove unnecessary time_and_memory function

* fix: add constraint to subcode time complexity

* fix: leestimator tests and speed of tests

* refactor: improve speed of PKEstimator tests

* fix: request verbos params only if runtime not inf

* refactor: tests of peestimator

* refactor: remove unnecessary variables

* doc: tidying up documentation

* refactor: shrink down sdfq estimator to its bare essentials

* more tests

* added refs

* updated as said

* added tests to docker and therefore to CI

* trigger pipeline

* added PK tests

* updated docktests

* fixxed doctest

* fixxed doctest

* fix/reverting PKP changes from this branch

* fix/reverting MQ doc changes from this branch

* Fix: _compute_time_complexity in hybrid_f5

* Fix: fixes from comments

* Doc/update

* fixxed boundaries in BJMM+

* Important change in base_algorithm

* f5 + hybrid_f5 done

* f5, hybrid_f5, kpg, mht and ex_search should be fine

* reworked

* fix: f5 tilde o memory

* fix: bjorklund tests

* Doc: fix test  booleansolve-fxl done

* fix: SBC failing test and failing sage script

* fix/doc: tests

* fix: SDFq tests against online variant

* refactor: remove verbose debug information

* doc: added missing stern ref

* refactor: speed up bbps optimization and fix comparison script

* doc: fix references of some sd algorithms

* fix: removed wrong test

* Add rest of the schemes + fix some memory minimum

* Fix: doc

* Doc: fix doc

* Fix: booleansolve_fxl complexity

* fix: fixed previsouly overlooked conflict

* removed some comments

* added BJMM optimization as a submodule

* added tests for Syndrome Decoding

* added small test set

* Refactor/decouple prettytable (Crypto-TII#44)

* refactor: moved table logic to estimation_renderer

* refactor: remove prettytable from base_estimator

* refactor: raise when estimation is empty

---------

Co-authored-by: Memphisd <[email protected]>

* moved nsolutions into problem parameters

* handeling comments

* added is_syndrome_zero

* doc: fix blanklines and colons

* fixed default value

* fix: failing test

* Doc: general fixes

* remove sd parameters

* fix: removed unnecessary code

* Fix/remove sage method from docs (Crypto-TII#47)

* fix: fix RR import

* refactor: remove imports *

* Merging manually pkp dic with Ari and Fran

* Merging manually pkp dic with Ari and Fran (Crypto-TII#49)

Co-authored-by: FloydZ <[email protected]>

* Updating base_algorithm changes

* updating

* fix: tests and some algorithm conditions and ranges

* restroing input_dic

* fix: failing test

* Reseting base_algorithm

* finish base_alg update

* doc: included references

* doc: fix memory access cost doc

* added Prange, Stern, LeeBrickell and BLP08

* updated Stern, Peters in SDFq

* fixxing failing doctest

* fixxed doctest again
:

* doc: typo

* refac:Gitback to log2 optimizations in crossbred

* Adding MQ tests

* Edit comments

* Fix: avoiding
Andre
  9:22 AM
ok,  the thing with big numbers is, its fine as long as you ensure its always integers. doing something like
# X is an integer

.
;

* Addind test_mq files

* refactor: use function to set new ranges

* typo

* fix: remove BaseProblem specifier as it causes problems in subclasses of BaseAlgorithm

* doc: improvements

* fix: typo in function name

* .

* Feact/pe input dic (Crypto-TII#54)

* Fix: typo in test/module/README.md

* Feat: Start PE input dic

* Feact: PE input dic initial

* Adding LE just missing landing pages

* Input dic for PE and LE. Also, some fix in previuos dic

* updated test readme

* one more

* typo

* Remove problem

---------

Co-authored-by: Memphisd <[email protected]>

* docs: update readme & remove changelog

* ci: update workflow triggerers

* docs: comment usage section

* docs: update readme

* fix: add . as prefix to the import statements

* Fix/bug in test sd (Crypto-TII#56)

* updated test_sd

* fixxed failing tests in test_sd

* fixxed tests in test_sd

* added missing optimize script

---------

Co-authored-by: Floyd Zweydinger <[email protected]>

* fixxed MO D3 (Crypto-TII#57)

* fixxed MO D3

* forgot to uncomment a test

---------

Co-authored-by: Floyd Zweydinger <[email protected]>

* fix: long pk tests and pk test comments

* fix/test_le_bbps

* fix: prefix sage test commands with sh

---------

Co-authored-by: javier.verbel <[email protected]>
Co-authored-by: Floyd Zweydinger <[email protected]>
Co-authored-by: AnonymousAccABC <[email protected]>
Co-authored-by: javierverbel <[email protected]>
Co-authored-by: Memphisd <[email protected]>
Co-authored-by: FloydZ <[email protected]>
Co-authored-by: ariane <[email protected]>
  • Loading branch information
8 people authored Mar 30, 2023
1 parent 40fe77f commit b433dc0
Show file tree
Hide file tree
Showing 173 changed files with 25,736 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Description
- (purpose of the PR, how did you implement it)

### Review process
- (explain how to review it)

### Pre-approval checklist
- [ ] The code builds clean without any errors or warnings
- [ ] I've added/updated tests
- [ ] I've added/updated documentation if needed
43 changes: 43 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build-and-test
on:
pull_request:
branches:
- develop

jobs:
build-and-run-tests:
runs-on: ubuntu-22.04
concurrency: ci-${{github.ref}}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v4
id: built-image
with:
context: .
push: false
load: true
tags: estimators-lib:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Run tests
run: make docker-test
69 changes: 69 additions & 0 deletions .github/workflows/build-deploy-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: build-deploy-api
on:
workflow_run:
workflows: [build-deploy-library]
types: [completed]

jobs:
api-build-deploy:
runs-on: ubuntu-22.04
concurrency: ci-${{github.ref}}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build library
uses: docker/build-push-action@v4
id: built-image
with:
context: .
push: false
load: true
tags: estimators-lib:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Pull API from BitBucket
run: |
cd ..
git clone https://x-token-auth:${{ secrets.BITBUCKET_API_TOKEN }}@bitbucket.org/${{ secrets.BITBUCKET_ORG }}/${{ secrets.BITBUCKET_REPOSITORY }}.git
cd ${{ secrets.BITBUCKET_REPOSITORY }}
docker build -t estimators-api --file Dockerfile.integration --build-arg API_KEY_ARG=${{ secrets.API_KEY_ARG }} .
- name: Configure AWS Credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: me-central-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Push API to AWS
run: |
docker tag estimators-api:latest ${{ steps.login-ecr.outputs.registry }}/estimators-api:latest
docker push ${{ steps.login-ecr.outputs.registry }}/estimators-api:latest
- name: Reset API task
run: |
aws ecs list-tasks --region me-central-1 --cluster estimators-cluster |
python -c "import sys, json; print(json.load(sys.stdin)['taskArns'][0])" |
xargs -I{} aws ecs stop-task --task {} --region me-central-1 --cluster estimators-cluster
67 changes: 67 additions & 0 deletions .github/workflows/build-deploy-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build-deploy-library
on:
push:
branches:
- main

jobs:
lib-build-deploy:
runs-on: ubuntu-22.04
concurrency: ci-${{github.ref}}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v4
id: built-image
with:
context: .
push: false
load: true
tags: estimators-lib:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Configure AWS Credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public

- name: Tag and push to ECR
run: |
docker tag estimators-lib:latest public.ecr.aws/h0m6q0n8/estimators-lib:latest
docker push public.ecr.aws/h0m6q0n8/estimators-lib:latest
- name: Update documentation
run: sudo make docker-doc

- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/build/html
branch: gh-pages
43 changes: 43 additions & 0 deletions .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: run-pytest
on:
pull_request:
branches:
- main

jobs:
builds-and-run-pytest:
runs-on: ubuntu-22.04
concurrency: ci-${{github.ref}}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build
uses: docker/build-push-action@v4
id: built-image
with:
context: .
push: false
load: true
tags: estimators-lib:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Run pytest
run: make docker-pytest
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Node artifact files
node_modules/
dist/
/build/
_build/
cryptographic_estimators.egg-info/
.scannerwork
__pycache__
docs/build
docs/source
docs/make.bat
docs/Makefile
venv

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

.local-history/
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractiv
RUN apt update && apt install -y sagemath
RUN sage -python3 -m pip install prettytable scipy sphinx==5.3.0 furo pytest
WORKDIR "/home/cryptographic_estimators/"
COPY . .
ENV SAGE_PKGS=/usr/share/sagemath/installed
RUN sage setup.py install
RUN sage -python3 -m pip install .
74 changes: 74 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Docker variables
image_name=estimators-lib:latest
documentation_path=$(shell pwd)
container_name="container-for-docs"
SAGE=sage

tools:
@sage -python -m pip install setuptools==63.0 wheel==0.38.4 sphinx==5.3.0 furo prettytable scipy pytest

lib:
@python3 setup.py install && sage -python -m pip install .

install:
@make tools && make lib

docker-build:
@docker build -t ${image_name} .

docker-build-m1:
@docker buildx build -t ${image_name} --platform linux/x86_64 .

docker-run:
@docker run -it --rm ${image_name}

testfast:
@sage setup.py testfast

testall: install
@sage setup.py testall

clean-docs:
@rm -rf docs/build docs/source docs/make.bat docs/Makefile

create-sphinx-config:
@sphinx-quickstart -q --sep -p TII-Estimators -a TII -l en --ext-autodoc docs

create-rst-files:
@python3 scripts/create_documentation.py

create-html-docs:
@sphinx-build -b html docs/source/ docs/build/html

doc:
@make clean-docs && make create-sphinx-config && make create-rst-files && make create-html-docs

add-estimator:
@python3 scripts/create_new_estimator.py && make add-copyright

append-new-estimator:
@python3 scripts/append_estimator_to_input_dictionary.py

stop-container-and-remove:
@docker stop $(container_name) && docker rm $(container_name)

generate-documentation:
@docker exec container-for-docs make doc

mount-volume-and-run:
@docker run --name container-for-docs --mount type=bind,source=${documentation_path}/docs,target=/home/cryptographic_estimators/docs -d -it ${image_name} sh

docker-doc:
@make mount-volume-and-run && make generate-documentation && make stop-container-and-remove container_name="container-for-docs"

docker-test:
@docker run --name container-for-test -d -it ${image_name} sh && docker exec container-for-test sage -t --long -T 3600 --force-lib cryptographic_estimators && docker stop container-for-test && docker rm container-for-test

docker-testfast:
@docker run --name container-for-test -d -it ${image_name} sh && docker exec container-for-test sage -t cryptographic_estimators && make stop-container-and-remove container_name="container-for-test"

add-copyright:
@python3 scripts/create_copyright.py

docker-pytest:
@docker run --name pytest-estimators -d -it ${image_name} sh && docker exec pytest-estimators sh -c "sage --python3 -m pytest -vv && ${SAGE} tests/test_sdfq.sage && ${SAGE} tests/test_le_beullens.sage && ${SAGE} tests/test_le_bbps.sage && ${SAGE} tests/test_pe.sage && ${SAGE} tests/test_pk.sage" && make stop-container-and-remove container_name="pytest-estimators"
Loading

0 comments on commit b433dc0

Please sign in to comment.