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

LukaJCB / ts-mls / 17308535327

28 Aug 2025 09:37PM UTC coverage: 93.797% (+0.05%) from 93.75%
17308535327

push

github

web-flow
Upgrade to @noble/curves & ciphers 2.0, post-quantum 0.5.1 (#91)

1121 of 1251 branches covered (89.61%)

Branch coverage included in aggregate %.

24 of 29 new or added lines in 8 files covered. (82.76%)

6364 of 6729 relevant lines covered (94.58%)

45240.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/crypto/implementation/noble/makeHashImpl.ts
1
import { HashAlgorithm, Hash } from "../../hash"
NEW
2
import { sha256, sha384, sha512 } from "@noble/hashes/sha2.js"
×
NEW
3
import { hmac } from "@noble/hashes/hmac.js"
×
4

5
export function makeHashImpl(h: HashAlgorithm): Hash {
×
6
  return {
×
7
    async digest(data) {
×
8
      switch (h) {
×
9
        case "SHA-256":
×
10
          return sha256(data)
×
11
        case "SHA-384":
×
12
          return sha384(data)
×
13
        case "SHA-512":
×
14
          return sha512(data)
×
15
        default:
×
16
          throw new Error(`Unsupported hash algorithm: ${h}`)
×
17
      }
×
18
    },
×
19
    async mac(key, data) {
×
20
      switch (h) {
×
21
        case "SHA-256":
×
22
          return hmac(sha256, key, data)
×
23
        case "SHA-384":
×
24
          return hmac(sha384, key, data)
×
25
        case "SHA-512":
×
26
          return hmac(sha512, key, data)
×
27
        default:
×
28
          throw new Error(`Unsupported hash algorithm: ${h}`)
×
29
      }
×
30
    },
×
31
    async verifyMac(key, mac, data) {
×
32
      const expectedMac = await this.mac(key, data)
×
33
      return mac.length === expectedMac.length && mac.every((byte, i) => byte === expectedMac[i])
×
34
    },
×
35
  }
×
36
}
×
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