This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add codecove to readme and try fix CI
…ed on tarpaulin.toml but for CI use xml as output format.
Final polish
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a migration PR of all the code from one-does-not-simply-sign.
Important
I strongly suggest you read the analog "Bistro Chez Remy" before you review this PR, if you haven't already done so, find it here on Confluence
It contains two modules, put in
derivation
andsigning
folders insrc
and in different testmod
s intests
.inside
src
there is atypes
folder/mod which contains some new types and also thesargon_types.rs
- which is a best effort collection of "stubbed" types from Sargon - that is, it contains the bare minimum impl of the types needed to implement thesigning
andderivation
modules. The goal is - when this repo is migrated into Sargon - to be able to removesargon_types.rs
and the code should just compile with all tests passing.The DOC is not 100% accurate, I welcome review of it though, but yes, there will be missing doc and outdates docs... so suggestions are welcome.
Design
Note
But the
SignaturesCollector
andKeysCollector
are very very similar, why no generics?I tried for a while but failed three times (1, 2, 3), ultimately the asymmetry of input and usage of factor sources made a generic solution to complex and hard. Key Derivation lacks one dimension and that is
hashmap of intent hashes to sign with which derivation path
. Also Key Derivation is much simpler since FactorSources cannot be skipped.For the purpose of giving an overview of both
KeysCollector
andSignaturesCollectors
, we can think of them as a single collector, or "accumulator" of FactorInstances - I previously called it "FactorInstancesAccumulator":FIA
.Collector
/FIA
Parallel vs Serial requests
On iOS - and also on Android I think (right @micbakos-rdx ?) - we can load MANY mnemonics from Secure Storage in one go, thus only requiring a single biometrics prompt for the user when using many DeviceFactorSources. That is a "Parallel" usage of factor source from the FIA/Collector in Sargons perspective. Which is something we implement in iOS/ Android hosts by impl "Interactor" traits this.
As per current design it will be 4 interactor traits to impl in host:
One very important thing to note is the implication of serial vs parallel for signing, where for serial, if user skips a factor source, the state of "skipable" of the next factor source depends on the last. That is to say, we must lazily/Just-In-Time create the SerialSignRequest between dispatching them, since it contains information about which transactions would fail if we would skip using this factor source. But for ParelellSigning we must aggregate/merge the lists of transaction which would fail, because user might not be skipping one DeviceFactor, but rather two if she cancels biometrics/skips.