secure-io / siv-go

Go implementation of AES-SIV-CMAC and AES-GCM-SIV
MIT License
6 stars 3 forks source link

add AES-SIV-CMAC amd64 assembler implementation #8

Closed aead closed 6 years ago

aead commented 6 years ago

This commit adds an AMD64 assemeber implementation for AES-SIV-CMAC. This includes generic AMD64 AES macros and an AES-CTR assembler implementation.

Further it adds CI assembler formating checks and asm tests. The asm AES-CTR implementation improves performance about 30%-70% depending on the message size.

name                old time/op    new time/op     delta
AES128CMACSeal64-4    1.29µs ± 1%     0.36µs ± 2%  -71.73%  (p=0.000 n=4+3)
AES128CMACSeal1K-4    3.49µs ± 0%     2.03µs ± 1%  -41.82%  (p=0.000 n=4+3)
AES128CMACSeal8K-4    23.8µs ± 0%     14.4µs ± 0%  -39.63%  (p=0.000 n=4+3)
AES128CMACOpen64-4    1.29µs ± 0%     0.36µs ± 0%  -72.05%  (p=0.000 n=4+3)
AES128CMACOpen1K-4    3.52µs ± 0%     2.04µs ± 1%  -42.09%  (p=0.000 n=4+3)
AES128CMACOpen8K-4    23.8µs ± 0%     14.4µs ± 0%  -39.59%  (p=0.000 n=4+3)
AES192CMACSeal64-4    1.38µs ± 0%     0.37µs ± 0%  -73.21%  (p=0.000 n=4+3)
AES192CMACSeal1K-4    3.81µs ± 0%     2.22µs ± 1%  -41.70%  (p=0.000 n=4+3)
AES192CMACSeal8K-4    26.5µs ± 0%     16.9µs ±11%  -36.33%  (p=0.000 n=4+3)
AES192CMACOpen64-4    1.39µs ± 1%     0.47µs ± 2%  -66.47%  (p=0.000 n=4+3)
AES192CMACOpen1K-4    3.87µs ± 1%     2.88µs ± 0%  -25.60%  (p=0.000 n=4+3)
AES192CMACOpen8K-4    27.2µs ± 2%     19.7µs ± 1%  -27.69%  (p=0.000 n=4+3)
AES256CMACSeal64-4    1.61µs ± 9%     0.48µs ± 0%  -70.10%  (p=0.000 n=4+3)
AES256CMACSeal1K-4    4.71µs ± 9%     3.04µs ± 0%  -35.51%  (p=0.000 n=4+3)
AES256CMACSeal8K-4    35.5µs ± 0%     21.2µs ± 0%  -40.11%  (p=0.000 n=4+3)
AES256CMACOpen64-4    1.77µs ± 0%     0.49µs ± 1%  -72.12%  (p=0.000 n=4+3)
AES256CMACOpen1K-4    5.15µs ± 1%     3.04µs ± 0%  -40.93%  (p=0.000 n=4+3)
AES256CMACOpen8K-4    35.4µs ± 0%     21.3µs ± 0%  -39.87%  (p=0.000 n=4+3)