ChainSafe / discv5

A Typescript implementation of the Discv5 protocol
Apache License 2.0
28 stars 15 forks source link

Upgrade AES to use nodejs builtins #200

Open acolytec3 opened 2 years ago

acolytec3 commented 2 years ago

discv5 currently uses the bcrypto implementation of the AES ciphers and this can relatively painlessly be switched to use the nodejs builtin equivalents. This work was already done in #197 and should be easily pulled out into a standalone PR and appeared to provide a modest performance improvement at the same time.

Node builtins ✔ benchmark aes cipher encryption/decryptions 23322.53 ops/s 42.87700 us/op - 2322 runs 0.101 s

With bcrypto ✔ benchmark aes cipher encryption/decryptions 21194.07 ops/s 47.18300 us/op - 2137 runs 0.102 s

dapplion commented 2 years ago

Sounds good to me!