Skip to content
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

Add wrappers for signature precompiles to Sapphire library #80

Merged
merged 3 commits into from
Jan 18, 2023

Conversation

jberci
Copy link
Contributor

@jberci jberci commented Oct 28, 2022

Wrappers for the precompiles added in oasisprotocol/oasis-sdk#1176.

* @param seed The seed to use for generating the key pair.
* @return (publicKey, privateKey) The generated key pair.
*/
function generateKeyPair(uint method, bytes memory seed) internal view returns (bytes memory publicKey, bytes memory privateKey) {
Copy link
Contributor

@nhynes nhynes Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function generateKeyPair(uint method, bytes memory seed) internal view returns (bytes memory publicKey, bytes memory privateKey) {
enum SigningAlg {
Unknown,
Ed25519,
Secp256k1,
Sr25519
}
struct SigningKey {
SigningAlg alg,
bytes public,
bytes private
}
function generateSigningKey(SigningAlg alg, bytes memory seed) internal view returns (SigningKey memory key) {

contracts/contracts/Sapphire.sol Outdated Show resolved Hide resolved
contracts/contracts/Sapphire.sol Outdated Show resolved Hide resolved
@nhynes
Copy link
Contributor

nhynes commented Dec 10, 2022

Thanks @jberci! I'll shepherd this PR from here since I made a number of changes to the precompile ABIs.

@nhynes nhynes changed the base branch from main to nhynes/pc-wraps December 10, 2022 08:14
@nhynes nhynes marked this pull request as ready for review December 10, 2022 08:14
@nhynes nhynes force-pushed the jberci/feature/signing-precompiles branch 2 times, most recently from a2483a3 to dbf6527 Compare December 10, 2022 09:34
Base automatically changed from nhynes/pc-wraps to main December 21, 2022 17:44
Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase.

contracts/contracts/Sapphire.sol Outdated Show resolved Hide resolved
contracts/contracts/Sapphire.sol Outdated Show resolved Hide resolved
contracts/contracts/Sapphire.sol Outdated Show resolved Hide resolved
@nhynes nhynes force-pushed the jberci/feature/signing-precompiles branch 2 times, most recently from de8b335 to 102ceb3 Compare January 18, 2023 00:25
@nhynes nhynes force-pushed the jberci/feature/signing-precompiles branch from 102ceb3 to efe4522 Compare January 18, 2023 00:25
@nhynes nhynes merged commit 8f40c63 into main Jan 18, 2023
@nhynes nhynes deleted the jberci/feature/signing-precompiles branch January 18, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants