Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Patch: Fixing Loopholes for Timing Attacks #3

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
51fa9e8
chore: :gear: adding benchmarks to detect and prove possible side-cha…
marcoonroad Aug 25, 2019
62292eb
security: :lock: mitigations for timing-attacks on nocoiner's decrypt…
marcoonroad Sep 7, 2019
81cff71
fix: :beetle: missed core_bench dependence on opam file, fixes broken…
marcoonroad Sep 7, 2019
5ed9edc
style: :art: standard ocamlformat compliant source code, fixes lint-f…
marcoonroad Sep 7, 2019
19dd264
fix/chore: :beetle: / :gear: benchmark is now optional and only is pe…
marcoonroad Sep 8, 2019
071e08b
refactor: :recycle: some minor performance improvements
marcoonroad Sep 8, 2019
b8cf302
style: :art: ocamlformat coding style compliant files
marcoonroad Sep 9, 2019
acc7547
refactor: :recycle: adding mac-equal string-comparison over constant-…
marcoonroad Dec 16, 2020
30e5b39
refactor: :recycle: optimized payload storage - AES-CBC padding does …
marcoonroad Dec 17, 2020
459de7e
test: :heavy_check_mark: covering variable secret/input data sizes on…
marcoonroad Dec 20, 2020
5cefc65
chore: :gear: initial steps on gh actions workflows (windows ci is no…
marcoonroad Dec 20, 2020
a8a047d
chore: :gear: typo on workflows, test must run only for spec, not on …
marcoonroad Dec 20, 2020
2924ad4
chore: :gear: attempt to fix gh actions build due eqaf version requir…
marcoonroad Dec 20, 2020
39cba9a
chore: :gear: yet another attempt to fix gh actions workflow builds
marcoonroad Dec 20, 2020
be18fef
refactor: :recycle: dropping nocrypto and digestif dependencies, usin…
marcoonroad Dec 21, 2020
95a51a6
chore: :gear: bumping to proper/updated dependecies for benchmarking …
marcoonroad Dec 22, 2020
53f3794
chore: :gear: updating bisect ppx flags on dune build metadata file
Nov 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: MacOS-CI

on:
push:
branches:
- stable
- master
- development
- deploy
- release
- feature/*
- feat/*
- ft/*
- patch/*
- bugfix/*
- fix/*
- doc/*
- docs/*
- chore/*
- refactor/*
- style/*
pull_request:
branches:
- stable
- master
- development
- deploy
- release
- feature/*
- feat/*
- ft/*
- patch/*
- bugfix/*
- fix/*
- doc/*
- docs/*
- chore/*
- refactor/*
- style/*

workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
package:
- nocoiner
os:
- macos-latest
ocaml-version:
- 4.08.0
- 4.08.1
- 4.09.1
- 4.10.1
- 4.11.0

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}

- run: opam pin add ${{ matrix.package }}.dev . --no-action
- run: opam depext ${{ matrix.package }} --yes --with-test
- run: opam install . --deps-only --with-doc --with-test
- run: opam exec -- dune build
- run: opam exec -- dune build @test/spec/runtest
74 changes: 74 additions & 0 deletions .github/workflows/ubuntu-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Ubuntu-CI

on:
push:
branches:
- stable
- master
- development
- deploy
- release
- feature/*
- feat/*
- ft/*
- patch/*
- bugfix/*
- fix/*
- doc/*
- docs/*
- chore/*
- refactor/*
- style/*
pull_request:
branches:
- stable
- master
- development
- deploy
- release
- feature/*
- feat/*
- ft/*
- patch/*
- bugfix/*
- fix/*
- doc/*
- docs/*
- chore/*
- refactor/*
- style/*

workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
package:
- nocoiner
os:
- ubuntu-latest
ocaml-version:
- 4.08.0
- 4.08.1
- 4.09.1
- 4.10.1
- 4.11.0

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}

- run: opam pin add ${{ matrix.package }}.dev . --no-action
- run: opam depext ${{ matrix.package }} --yes --with-test
- run: opam install . --deps-only --with-doc --with-test
- run: opam exec -- dune build
- run: opam exec -- dune build @test/spec/runtest
74 changes: 74 additions & 0 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Windows-CI

on:
push:
branches:
- stable
- master
- development
- deploy
- release
- feature/*
- feat/*
- ft/*
- patch/*
- bugfix/*
- fix/*
- doc/*
- docs/*
- chore/*
- refactor/*
- style/*
pull_request:
branches:
- stable
- master
- development
- deploy
- release
- feature/*
- feat/*
- ft/*
- patch/*
- bugfix/*
- fix/*
- doc/*
- docs/*
- chore/*
- refactor/*
- style/*

workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
package:
- nocoiner
os:
- windows-latest
ocaml-version:
- 4.08.0
- 4.08.1
- 4.09.1
- 4.10.1
- 4.11.0

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}

- run: opam pin add ${{ matrix.package }}.dev . --no-action
- run: opam depext ${{ matrix.package }} --yes --with-test
- run: opam install . --deps-only --with-doc --with-test
- run: opam exec -- dune build
- run: opam exec -- dune build @test/spec/runtest
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
- OCAML_VERSION=4.04 POST_INSTALL_HOOK="make report"
- OCAML_VERSION=4.05 POST_INSTALL_HOOK="make report"
- OCAML_VERSION=4.06 POST_INSTALL_HOOK="make lint-format; make report"
- OCAML_VERSION=4.07 POST_INSTALL_HOOK="make lint-format; make report"
- OCAML_VERSION=4.07 POST_INSTALL_HOOK="make lint-format; make bench; make report"
os:
- linux
# - osx
62 changes: 45 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,36 @@
OCAML_VERSION := $(shell opam var switch)

.PHONY: default

default: build

test: build
@ opam lint
@ dune build @test/spec/runtest -f --no-buffer -j 1
@ dune build @test/spec/runtest -f --no-buffer

build:
@ dune build -j 1
@ dune build

install: build
@ dune install

.PHONY: install-check
install-check:
@ opam pin add nocoiner.dev . --no-action --working-dir --yes
@ opam depext nocoiner --yes --with-test --yes
@ opam install . --deps-only --with-doc --with-test --working-dir --yes
@ dune build
@ opam pin remove nocoiner --working-dir --yes
@ opam remove nocoiner --yes

uninstall:
@ dune uninstall

clear:
@ rm -rfv bisect*.out
@ dune clean

clean: clear

coverage: clear
@ mkdir -p docs/
@ rm -rf docs/apicov
Expand Down Expand Up @@ -71,11 +81,14 @@ docs: build
@ mv ./_build/default/_doc/_html/* ./docs/apiref/

pin:
@ opam pin add nocoiner . -n --yes
@ opam pin add nocoiner . -n --yes --working-dir

unpin:
@ opam pin remove nocoiner --yes

deps:
@ opam install . --deps-only --yes
@ opam install alcotest core --yes # force such test dependences
@ opam install . --deps-only --yes --working-dir
@ opam install alcotest --yes # force such test dependences

dev-deps:
@ opam install \
Expand All @@ -87,18 +100,20 @@ dev-deps:
merlin \
bisect_ppx \
utop \
core_bench \
--yes
@ opam update --yes
@ opam upgrade \
odoc \
ocveralls \
alcotest \
ocp-indent \
ocamlformat \
merlin \
bisect_ppx \
utop \
--yes
# @ opam update --yes
# @ opam upgrade \
# odoc \
# ocveralls \
# alcotest \
# ocp-indent \
# ocamlformat \
# merlin \
# bisect_ppx \
# utop \
# core_bench \
# --yes

lint-format:
@ opam install ocamlformat --yes
Expand All @@ -117,12 +132,25 @@ local-site-setup:
local-site-start:
@ cd docs && bundle exec jekyll serve && cd ..

bench: clean build
@ opam install core_bench --yes
@ NOCOINER_KDF_COST=2 \
NOCOINER_KDF_WORKERS=1 \
dune build @test/bench/runtest -f --no-buffer --auto-promote \
--diff-command="git diff --unified=10 --break-rewrites --no-index --exit-code --histogram --word-diff=none --color --no-prefix" || echo \
"\n\n=== Differences detected! ===\n\n"

# to run inside docker alpine context
binary: clear
@ dune build --profile deploy
@ cp `dune exec --profile deploy -- which nocoiner` ./nocoiner.exe
@ chmod a+rx ./nocoiner.exe

binary-test: clear
@ dune build
@ cp `dune exec -- which nocoiner` ./nocoiner.exe
@ chmod a+rx ./nocoiner.exe

docker-system-prune:
@ docker system prune --force --volumes

Expand Down
Loading