-
Notifications
You must be signed in to change notification settings - Fork 274
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
feat(sdk-lib-mpc): support DKLS DKG primitives #4281
Conversation
64b48c1
to
0f3808e
Compare
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
4cb279a
to
cdcfc87
Compare
* @param publicArmor public key to encrypt with | ||
* @param privateArmor private key to sign with | ||
*/ | ||
export async function encryptAndDetachSignText( |
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.
i recently added these openpgp utility functions but decided to move them to where they're actually needed plus change them to encrypt + decrypt and sign + verify binary data to be compatible with hsm.
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.
removal of a publicly exported function is a breaking change. Commit needs to reflect that with BREAKING CHANGE: in the commit footer
500985e
to
697ba80
Compare
export type SerializedP2PMessage = P2PMessage<string, string>; | ||
export type DeserializedP2PMessage = P2PMessage<Uint8Array, Uint8Array>; | ||
export type AuthEncP2PMessage = P2PMessage<AuthEncMessage, string>; | ||
export type AuthBroadcastMessage = BroadcastMessage<AuthEncMessage>; |
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.
AuthBroadcastMessage
being parameterized to AuthEncMessage
is a little confusing, maybe apart from AuthEncMessage
, we need another type AuthMessage
, with message
and signature
.
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.
done
}, | ||
}); | ||
return { | ||
encryptedMessage: data.toString('base64'), |
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 my comment about adding AuthMessage
.
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.
done
* @param signedMessage message to verify | ||
* @param publicArmor public key to verify signature with | ||
*/ | ||
export async function verifySignedData(signedMessage: AuthEncMessage, publicArmor: string): Promise<boolean> { |
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 my comment about adding AuthMessage
.
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.
done
697ba80
to
779b1e6
Compare
user.handleIncomingMessages({ | ||
p2pMessages: [], | ||
broadcastMessages: bitgoRound4Messages.broadcastMessages.concat(backupRound4Messages.broadcastMessages), | ||
}); | ||
bitgo.handleIncomingMessages({ | ||
p2pMessages: [], | ||
broadcastMessages: backupRound4Messages.broadcastMessages.concat(userRound4Messages.broadcastMessages), | ||
}); | ||
backup.handleIncomingMessages({ | ||
p2pMessages: [], | ||
broadcastMessages: bitgoRound4Messages.broadcastMessages.concat(userRound4Messages.broadcastMessages), | ||
}); |
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.
maybe add a check that all three parties get to the same public key in their keyshares.
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.
done
779b1e6
to
1042642
Compare
Ticket: HSM-267 BREAKING CHANGE: moves and renames authenticated encryption utility functions to sdk-lib-mpc
1042642
to
ccd6e66
Compare
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.
LGTM
Ticket: HSM-267
* Broadcast messages are only authenticated (signed with the sender's private gpg key).
* P2P messages are authenticated using the sender's private gpg key and encrypted to the recipient's public gpg key).