# 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 algorithm
### Signature
| name            | note                  |
|-----------------|-----------------------|
| ECDSA-P256      | = secp256r1           |
| ECDSA-P384      | = secp384r1           |
| ECDSA-P521      | = secp521r1           |
| HMAC-SHA256-MFS | = 256Bit Fixed Secret |
| HMAC-SHA384-MFS | = 384Bit Fixed Secret |
| HMAC-SHA512-MFS | = 512Bit Fixed Secret |
- MFS : Maximum(Same Bit) Fixed Secret

### Crypto
| name       | note                          |
|------------|-------------------------------|
| IV-AES128-GCM | (IV=NONCE:96BIT) + AES128 GCM |
| IV-AES256-GCM | (IV=NONCE:96BIT) + AES256 GCM |


# 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.03s
     Running tests/bench_test.rs (target/release/deps/bench_test-a0281d818fbdce38)
performance test (plain, secure)
plain: JTTPM7N9BUIUv8UJz5bsN0Rn8SGG1itoSzyVmX9c3iQ452L4rLn60Reg3Jlo233S3mkrxFMegaTl17OyJgfMnQrIrIEiXq5iVKM6
secure: 14oatVHDGSpsYc5tLhImOHIjBCOoWV6dcWoDyu5iQKfF7swVZ0QeCBAfvG6nXMtacSTvetL40JeJ217uqxtNKcFalsSk1rNo5BMF

Multi-Thread
HMAC-SHA256-MFS IV-AES128-GCM Issue * 10000 : 6ms
HMAC-SHA256-MFS IV-AES128-GCM Parse * 10000 : 4ms
HMAC-SHA256-MFS IV-AES256-GCM Issue * 10000 : 7ms
HMAC-SHA256-MFS IV-AES256-GCM Parse * 10000 : 4ms
HMAC-SHA384-MFS IV-AES128-GCM Issue * 10000 : 6ms
HMAC-SHA384-MFS IV-AES128-GCM Parse * 10000 : 4ms
HMAC-SHA384-MFS IV-AES256-GCM Issue * 10000 : 6ms
HMAC-SHA384-MFS IV-AES256-GCM Parse * 10000 : 4ms
HMAC-SHA512-MFS IV-AES128-GCM Issue * 10000 : 6ms
HMAC-SHA512-MFS IV-AES128-GCM Parse * 10000 : 4ms
HMAC-SHA512-MFS IV-AES256-GCM Issue * 10000 : 7ms
HMAC-SHA512-MFS IV-AES256-GCM Parse * 10000 : 4ms
ECDSA-P256 IV-AES128-GCM Issue * 10000 : 25ms
ECDSA-P256 IV-AES128-GCM Parse * 10000 : 51ms
ECDSA-P256 IV-AES256-GCM Issue * 10000 : 27ms
ECDSA-P256 IV-AES256-GCM Parse * 10000 : 64ms
ECDSA-P384 IV-AES128-GCM Issue * 10000 : 99ms
ECDSA-P384 IV-AES128-GCM Parse * 10000 : 243ms
ECDSA-P384 IV-AES256-GCM Issue * 10000 : 106ms
ECDSA-P384 IV-AES256-GCM Parse * 10000 : 219ms
ECDSA-P521 IV-AES128-GCM Issue * 10000 : 149ms
ECDSA-P521 IV-AES128-GCM Parse * 10000 : 300ms
ECDSA-P521 IV-AES256-GCM Issue * 10000 : 148ms
ECDSA-P521 IV-AES256-GCM Parse * 10000 : 299ms

Single-Thread
HMAC-SHA256-MFS IV-AES128-GCM Issue * 10000 : 12ms
HMAC-SHA256-MFS IV-AES128-GCM Parse * 10000 : 5ms
HMAC-SHA256-MFS IV-AES256-GCM Issue * 10000 : 12ms
HMAC-SHA256-MFS IV-AES256-GCM Parse * 10000 : 5ms
HMAC-SHA384-MFS IV-AES128-GCM Issue * 10000 : 13ms
HMAC-SHA384-MFS IV-AES128-GCM Parse * 10000 : 7ms
HMAC-SHA384-MFS IV-AES256-GCM Issue * 10000 : 13ms
HMAC-SHA384-MFS IV-AES256-GCM Parse * 10000 : 7ms
HMAC-SHA512-MFS IV-AES128-GCM Issue * 10000 : 13ms
HMAC-SHA512-MFS IV-AES128-GCM Parse * 10000 : 7ms
HMAC-SHA512-MFS IV-AES256-GCM Issue * 10000 : 13ms
HMAC-SHA512-MFS IV-AES256-GCM Parse * 10000 : 7ms
ECDSA-P256 IV-AES128-GCM Issue * 10000 : 128ms
ECDSA-P256 IV-AES128-GCM Parse * 10000 : 294ms
ECDSA-P256 IV-AES256-GCM Issue * 10000 : 148ms
ECDSA-P256 IV-AES256-GCM Parse * 10000 : 276ms
ECDSA-P384 IV-AES128-GCM Issue * 10000 : 473ms
ECDSA-P384 IV-AES128-GCM Parse * 10000 : 1063ms
ECDSA-P384 IV-AES256-GCM Issue * 10000 : 472ms
ECDSA-P384 IV-AES256-GCM Parse * 10000 : 1057ms
ECDSA-P521 IV-AES128-GCM Issue * 10000 : 830ms
ECDSA-P521 IV-AES128-GCM Parse * 10000 : 1654ms
ECDSA-P521 IV-AES256-GCM Issue * 10000 : 830ms
ECDSA-P521 IV-AES256-GCM Parse * 10000 : 1643ms
```
