core-crypto icon indicating copy to clipboard operation
core-crypto copied to clipboard

feat: implement new keypackage api [WPB-19574]

Open coriolinus opened this issue 2 months ago • 3 comments

What's new in this PR

  • [ ] ~~add the Keypackage type~~ just straight using the OpenMLS one
  • [ ] ~~add the KeypackageRef type~~ just straight using the OpenMLS one
  • [x] add a Keypackage.ref() method that returns a KeypackageRef
  • [x] add the following methods:
    • [x] client.generateKeypackages
    • [x] client.getKeypackages
    • [x] client.removeKeypackage
    • [x] client.removeKeypackagesFor
  • [x] add comprehensive tests for the new API to all bindings
    • [x] ts
    • [x] kotlin
    • [x] swift
  • [x] update client.removeCredential to remove all key packages related to the credential
  • [x] remove old API related to key packages, and in particular:
    • [x] clientKeypackages
    • [x] deleteStaleKeypackages
    • [x] clientValidKeypackagesCount

PR Submission Checklist for internal contributors
  • The PR Title
    • [x] conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • [x] contains a reference JIRA issue number like SQPIT-764
    • [x] answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

coriolinus avatar Nov 07 '25 16:11 coriolinus

How to handle the migration:

  • migrate signature scheme to ciphersuite
    • where unambiguous, it's easy
    • where ambiguous, duplicate the entries
  • ensure we have both "find by signature scheme" and "find by ciphersuite" on credential ref
  • and find by ciphersuite exists at the FFI layer

coriolinus avatar Nov 11 '25 14:11 coriolinus

🐰 Bencher Report

Branchprgn/feat/19574-new-keypackage-api
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
Commit add f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
17,541.00 µs
Commit add f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
790.41 µs
Commit add f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
4,294.50 µs
Commit add f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
7,654.30 µs
Commit add f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
11,603.00 µs
Commit add f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
14,439.00 µs
Commit add f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
996,710.00 µs
Commit add f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
764.30 µs
Commit add f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
79,536.00 µs
Commit add f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
218,150.00 µs
Commit add f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
431,060.00 µs
Commit add f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
682,620.00 µs
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
116,520.00 µs
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
23,494.00 µs
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
42,286.00 µs
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
58,044.00 µs
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
77,946.00 µs
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
93,300.00 µs
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
⚠️ NO THRESHOLD
17,199.00 µs
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
⚠️ NO THRESHOLD
115,750.00 µs
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
⚠️ NO THRESHOLD
34,466.00 µs
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
⚠️ NO THRESHOLD
55,999.00 µs
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
⚠️ NO THRESHOLD
75,451.00 µs
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
⚠️ NO THRESHOLD
95,282.00 µs
Commit remove f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
10,987.00 µs
Commit remove f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
576.92 µs
Commit remove f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
2,324.10 µs
Commit remove f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
4,252.20 µs
Commit remove f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
6,486.00 µs
Commit remove f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
8,890.40 µs
Commit remove f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
14,407.00 µs
Commit remove f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
135,220.00 µs
Commit remove f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
111,290.00 µs
Commit remove f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
86,779.00 µs
Commit remove f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
62,649.00 µs
Commit remove f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
38,278.00 µs
Commit update f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
135,420.00 µs
Commit update f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
759.51 µs
Commit update f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
27,982.00 µs
Commit update f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
55,092.00 µs
Commit update f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
83,038.00 µs
Commit update f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
108,880.00 µs
🐰 View full continuous benchmarking report in Bencher

github-actions[bot] avatar Nov 20 '25 10:11 github-actions[bot]

🐰 Bencher Report

Branchprgn/feat/19574-new-keypackage-api
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
decrypt1000MessagesWeb📈 view plot
⚠️ NO THRESHOLD
251.10 ms
🐰 View full continuous benchmarking report in Bencher

github-actions[bot] avatar Nov 20 '25 10:11 github-actions[bot]