-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tss/rsa: Rewrite serialization functions for KeyShare and SignShare #454
base: tssRSAverif
Are you sure you want to change the base?
Conversation
|
||
// UnmarshalBinary recovers a value from a byte array. | ||
// Returns an error if the recovered value is invalid. | ||
// Any panic raised when calling to ReadValue is recovered and an error is returned instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this helper function generically implements UnmarshalBinary if there is an implementation of ReadValue (which internally uses the cryptobyte
package).
ok := v.ReadValue(&r) | ||
if !ok { | ||
return fmt.Errorf("cannot read %T from input string", v) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there are trailing bytes in data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it consumes only the data needed by the implementor, so this allows to do reading continuations in composed data structures. User can call Empty()
to check for trailing data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments in previous review.
Use cryptoybyte to leverage TLS syntax. Serialization of KeyShare and SignShares.
Staked on top of #453