Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Nov 22, 2023
1 parent 0eb93ba commit 9304858
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
pull_request:
jobs:
tests:

timeout-minutes: 5
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# PHP Implementation of Ascon

[![Tests](https://github.com/brainfoolong/php-ascon/actions/workflows/tests.yml/badge.svg)](https://github.com/brainfoolong/php-ascon/actions/workflows/tests.yml)

This is a PHP 8+ implementation of Ascon v1.2, an authenticated cipher and hash function.
It allows to encrypt and decrypt any kind of message. At kind be somewhat seen as the successor to AES encryption.
Heavily inspired by the python implementation of Ascon by https://github.com/meichlseder/pyascon
Expand Down Expand Up @@ -70,20 +72,20 @@ See `tests/performance.php` for some tests with various message data size.
# no scientific tests, just executed on my local machine, results depend on your machine
# a "cycle" is one encryption and one decryption
### 25 cycles with 64 byte message data and 256 byte associated data ###
Total Time: 1.08 seconds
### 10 cycles with 64 byte message data and 256 byte associated data ###
Total Time: 0.43 seconds
Memory Usage: 2MB
### 25 cycles with 256 byte message data and 1024 byte associated data ###
Total Time: 3.34 seconds
### 10 cycles with 256 byte message data and 1024 byte associated data ###
Total Time: 1.32 seconds
Memory Usage: 2MB
### 25 cycles with 2048 byte message data and 4096 byte associated data ###
Total Time: 14.82 seconds
### 10 cycles with 2048 byte message data and 4096 byte associated data ###
Total Time: 5.92 seconds
Memory Usage: 2MB
### 25 cycles with 8192 byte message data and 0 byte associated data ###
Total Time: 19.91 seconds
### 10 cycles with 8192 byte message data and 0 byte associated data ###
Total Time: 7.93 seconds
Memory Usage: 4MB
```

Expand Down
8 changes: 4 additions & 4 deletions tests/performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

$cycles = [
[
"nr" => 25,
"nr" => 10,
"messageSize" => 32,
"assocSize" => 128,
],
[
"nr" => 25,
"nr" => 10,
"messageSize" => 128,
"assocSize" => 512,
],
[
"nr" => 25,
"nr" => 10,
"messageSize" => 128 * 8,
"assocSize" => 512 * 4,
],
[
"nr" => 25,
"nr" => 10,
"messageSize" => 512 * 8,
"assocSize" => 0,
],
Expand Down

0 comments on commit 9304858

Please sign in to comment.