Open Bug 1854562 Opened 2 years ago Updated 1 year ago

PBKDF2 with SHA-512 has poor performance compared to Chromium

Categories

(Core :: DOM: Web Crypto, enhancement, P4)

Firefox 119
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: juraj.masiar, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

  1. using a simple benchmark:
    https://jsfiddle.net/icl7126/593u7eph/14/

Actual results:

Firefox ESR 102:
"PBKDF2 with 10,000,000 iterations and SHA-256 finished in 1601 ms"
"PBKDF2 with 10,000,000 iterations and SHA-512 finished in 9465 ms"

Firefox Nightly 119:
"PBKDF2 with 10,000,000 iterations and SHA-256 finished in 1396 ms"
"PBKDF2 with 10,000,000 iterations and SHA-512 finished in 8054 ms"

Chrome 117:
"PBKDF2 with 10,000,000 iterations and SHA-256 finished in 891 ms"
"PBKDF2 with 10,000,000 iterations and SHA-512 finished in 2987 ms"

Let me try to put it in a table:

Browser Hash Algorithm Iterations per Second Chrome vs. Firefox (%)
Firefox Nightly 119 SHA-256 7,155,274 iterations/s Chrome is ~57% faster
Firefox Nightly 119 SHA-512 1,241,465 iterations/s Chrome is ~267% faster
Chrome 117 SHA-256 11,223,345 iterations/s
Chrome 117 SHA-512 3,345,485 iterations/s
Severity: -- → S4
Priority: -- → P4
You need to log in before you can comment on or make changes to this bug.