Commit Graph
17 Commits
Author SHA1 Message Date
Wez Furlong 4cf2e65c94 dkim: add comparitive benchmark against mail-auth
```
signing/sign Simple     time:   [1.2990 ms 1.3002 ms 1.3015 ms]
                        thrpt:  [2.3581 MiB/s 2.3603 MiB/s 2.3626 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

signing/sign Relaxed    time:   [1.2942 ms 1.2955 ms 1.2968 ms]
                        thrpt:  [2.3665 MiB/s 2.3689 MiB/s 2.3712 MiB/s]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  2 (2.00%) high severe

mail-auth signing/sign Simple
                        time:   [487.97 µs 488.22 µs 488.48 µs]
                        thrpt:  [6.2826 MiB/s 6.2860 MiB/s 6.2892 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

mail-auth signing/sign Relaxed
                        time:   [494.68 µs 495.68 µs 496.68 µs]
                        thrpt:  [6.1789 MiB/s 6.1913 MiB/s 6.2039 MiB/s]
```
2023-06-15 15:41:18 -07:00
Wez Furlong 30b8522873 dkim: precompile list of headers to sign during signing
We can exploit eg: knowing that the list of headers is a unique
list (no repeated headers) and save some overhead when using the
same signer multiple times.
2023-06-15 15:18:17 -07:00
Wez Furlong 4805f60837 dkim: avoid allocating a vec when signing headers 2023-06-15 14:45:40 -07:00
Wez Furlong 02d1378495 dkim: avoid re-parsing header list during signing 2023-06-15 14:28:11 -07:00
Wez Furlong e5d03052be dkim: tidy up handling of l= body length tag
We should parse at the edge and pass down the parsed number
2023-06-15 13:23:44 -07:00
Wez Furlong cf11540f84 dkim: remove another extraneous allocation, tidy up canon interface 2023-06-15 13:13:28 -07:00
Wez Furlong 28f0786e42 dkim: update crate deps 2023-06-15 11:37:59 -07:00
Wez Furlong 19c9201e44 dkim: remove some redundant clone calls 2023-06-15 11:30:44 -07:00
Wez Furlong 2e40c00121 dkim: introduce ParsedEmail type
This help transitions to a cheaper email parser, that doesn't need to
parse the entire MIME structure

Note that as part of this, I found that several tests were running
against email messages using unix line endings instead of canonical
CRLF.

This was silently being masked and an empty or otherwise incorrect byte
slice was being hashed; I've updated the affected tests and their test
expectations accordingly, as well as made this error bubble up at the
time of parsing the email, rather than silently squashing it in the
depths of the hasher.
2023-06-15 11:27:03 -07:00
Wez Furlong 3af3f52f66 dkim: pick some lint various bits 2023-06-15 10:27:33 -07:00
Wez Furlong 19aca29007 dkim: don't require moving data into verify_signature 2023-06-15 10:07:33 -07:00
Wez Furlong 424192eb5f dkim: tidy up DKIMHeader construction 2023-06-15 10:07:26 -07:00
Wez Furlong aecd187c21 dkim: remove some string copies 2023-06-15 09:53:53 -07:00
Wez Furlong ed8ccbc810 dkim: remove slog dependency 2023-06-15 09:27:28 -07:00
Wez Furlong af3236a72e dkim: remove Cargo.lock 2023-06-15 09:17:43 -07:00
Wez Furlong eb44e0780e Use vendored in dkim fork 2023-06-15 09:11:34 -07:00
Wez Furlong 49c1533435 Merge in my DKIM crate fork 2023-06-15 09:10:39 -07:00