# DAT - Distributed Access Token

## Document

### [DAT Run Online](https://dat.saro.me)

### [What is DAT](https://dat.saro.me/--/intro)

### [Rust Example](https://dat.saro.me/--/libs/cargo-dat)

## support signature algorithm
| name   | algorithm  |
|--------|------------|
| P256   | secp256r1  |
| P384   | secp384r1  |
| P521   | secp521r1  |

## support crypto algorithm
| name       | algorithm                   |
|------------|-----------------------------|
| AES128GCMN | aes-128-gcm n(nonce + body) |
| AES256GCMN | aes-256-cbc n(nonce + body) |


# Performance
- random plain and secure test
- mac mini m4 2024 basic (10 core)
- release compile
- [bench_test.rs](tests/bench_test.rs)
```
Testing started at ...
    Finished `release` profile [optimized] target(s) in 0.04s
     Running tests/bench_test.rs (target/release/deps/bench_test-63572f667a1d9603)
performance test (plain, secure)
plain: ygMxZa6aO9ni72bdwkTRujrCktBQz6uu6PdLCea4d8YhTG9HPCZbEahP6CWQmW3dEN1PXLISPXLU2Vb4JyOQ4A9d4WahcFKtyFL9
secure: wR5A3qUoQFJnNNfE6784MQoBoZnxMvziaQ96NKNh6fwpRdu4EMvt9LpyOnt4pvOJKMaYjwGtpfzmpe8WqA14Me1EJit4JfC7Ip8r

Multi-Thread
P256 AES128GCMN Issue * 10000 : 25ms
P256 AES128GCMN Parse * 10000 : 53ms
P256 AES256GCMN Issue * 10000 : 22ms
P256 AES256GCMN Parse * 10000 : 49ms
P384 AES128GCMN Issue * 10000 : 81ms
P384 AES128GCMN Parse * 10000 : 193ms
P384 AES256GCMN Issue * 10000 : 83ms
P384 AES256GCMN Parse * 10000 : 183ms
P521 AES128GCMN Issue * 10000 : 147ms
P521 AES128GCMN Parse * 10000 : 307ms
P521 AES256GCMN Issue * 10000 : 149ms
P521 AES256GCMN Parse * 10000 : 299ms

Single-Thread
P256 AES128GCMN Issue * 10000 : 129ms
P256 AES128GCMN Parse * 10000 : 289ms
P256 AES256GCMN Issue * 10000 : 127ms
P256 AES256GCMN Parse * 10000 : 284ms
P384 AES128GCMN Issue * 10000 : 473ms
P384 AES128GCMN Parse * 10000 : 1072ms
P384 AES256GCMN Issue * 10000 : 481ms
P384 AES256GCMN Parse * 10000 : 1070ms
P521 AES128GCMN Issue * 10000 : 829ms
P521 AES128GCMN Parse * 10000 : 1660ms
P521 AES256GCMN Issue * 10000 : 829ms
P521 AES256GCMN Parse * 10000 : 1661ms
```
