• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-modules / 8557266740
100%
master: 85%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 04 Apr 2024 03:28PM UTC
Jobs 1
Files 11
Run time 394min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Apr 2024 03:27PM UTC coverage: 81.633%. Remained the same
8557266740

push

github

web-flow
Generalize Signing Message Encoding (#362)

Closes #292 

This PR generalizes the `WebAuthn` library to work better with future
public key algorithms that we may want to implement. Notably, the
hashing algorithm used for signing depends on the public key algorithm
of the credential, and is not always SHA-256. In contrast, the client
data JSON is **always** hashed with SHA-256. As such, we refactored the
function to return the actual signing message before hashing, so it can
be more easily composed in the eventuality that we start to support
other algorithms.

We also refactor encoding to be done in assembly for some small gas
wins, because Solidity is double copying the authenticator data.

<details><summary>Before:</summary>

```
  Gas Benchmarking [@bench]
    WebAuthnSigner
      ⛽ deployment: 471398
      ✔ Benchmark signer deployment cost (761ms)
      ⛽ verification (Dummy): 11148
      ✔ Benchmark signer verification cost with Dummy verifier
```

</details>

<details><summary>After:</summary>

```
  Gas Benchmarking [@bench]
    WebAuthnSigner
      ⛽ deployment: 468188
      ✔ Benchmark signer deployment cost (744ms)
      ⛽ verification (Dummy): 11126
      ✔ Benchmark signer verification cost with Dummy verifier
```

</details>

A more significant change is the re-ordering of operations in the
`verifySignature` function. This is a workaround to
https://github.com/ethereum/solidity/issues/14934 as it "tricks" the Yul
IR optimizer to perform much better (especially WRT code size) when Yul
optimizations are enabled:

<details><summary>Before (with Yul IR optimizations):</summary>

```
  Gas Benchmarking [@bench]
    WebAuthnSigner
      ⛽ deployment: 515182
      ✔ Benchmark signer deployment cost (742ms)
      ⛽ verification (Dummy): 9958
      ✔ Benchmark signer verification cost with Dummy verifier
```

</details>

<details><summary>After (with Yul IR optimizations):</summary>

```... (continued)

25 of 44 branches covered (56.82%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 1 file covered. (100.0%)

95 of 103 relevant lines covered (92.23%)

6.64 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8557266740.1 04 Apr 2024 03:28PM UTC 0
81.63
GitHub Action Run
Source Files on build 8557266740
Detailed source file information is not available for this build.
  • Back to Repo
  • 51dad6be on github
  • Prev Build on main (#8557146288)
  • Next Build on main (#8567385251)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc