Skip to content

Commit

Permalink
Define secp256k1 public cryptography RPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
nchashch committed Oct 31, 2024
1 parent 8248a56 commit ce5ec8e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions proto/cusf/crypto/v1/crypto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ service CryptoService {
returns (HmacSha512Response);
rpc Ripemd160(Ripemd160Request)
returns (Ripemd160Response);
rpc Secp256k1PrivKeyToPubKey(Secp256k1PrivKeyToPubKeyRequest)
returns (Secp256k1PrivKeyToPubKeyResponse);
rpc Secp256k1Sign(Secp256k1SignRequest)
returns (Secp256k1SignResponse);
rpc Secp256k1Verify(Secp256k1VerifyRequest)
returns (Secp256k1VerifyResponse);
}

message HmacSha512Request {
Expand All @@ -26,3 +32,27 @@ message Ripemd160Request {
message Ripemd160Response {
cusf.common.v1.ConsensusHex digest = 1;
}

message Secp256k1PrivKeyToPubKeyRequest {
cusf.common.v1.ConsensusHex priv_key = 1;
}
message Secp256k1PrivKeyToPubKeyResponse {
cusf.common.v1.ConsensusHex pub_key = 1;
}

message Secp256k1SignRequest {
cusf.common.v1.ConsensusHex message = 1;
cusf.common.v1.ConsensusHex priv_key = 2;
}
message Secp256k1SignResponse {
cusf.common.v1.ConsensusHex signature = 1;
}

message Secp256k1VerifyRequest {
cusf.common.v1.ConsensusHex message = 1;
cusf.common.v1.ConsensusHex signature = 2;
cusf.common.v1.ConsensusHex pub_key = 3;
}
message Secp256k1VerifyResponse {
bool valid = 1;
}

0 comments on commit ce5ec8e

Please sign in to comment.