Skip to content

Commit

Permalink
working coms
Browse files Browse the repository at this point in the history
wip

building

fix more tests

WIP on sw_compressed_keys

more fixes

remove useless test

wip

small changes

refactor names

remove public view key display

up version
  • Loading branch information
SWvheerden committed Jan 27, 2025
1 parent f0cf697 commit e319861
Show file tree
Hide file tree
Showing 278 changed files with 4,368 additions and 2,409 deletions.
73 changes: 37 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions applications/minotari_app_grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ authors = ["The Tari Development Community"]
description = "This crate is to provide a single source for all cross application grpc files and conversions to and from tari::core"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "1.10.0-pre.1"
version = "1.10.1-pre.0"
edition = "2021"

[dependencies]
tari_common_types = { path = "../../base_layer/common_types" }
tari_comms = { path = "../../comms/core" }
tari_core = { path = "../../base_layer/core" }
tari_crypto = { version = "0.21.0" }
tari_crypto = { git = "https://github.com/SWvheerden/tari-crypto", rev = "42237731dd5886554b3bfe6ed22e091dce4af557" }
tari_script = { path = "../../infrastructure/tari_script" }
tari_max_size = { path = "../../infrastructure/max_size" }
tari_utilities = { version = "0.8" }
Expand All @@ -32,7 +32,7 @@ tonic = { version = "0.12.3", features = ["tls"] }
zeroize = "1"

[build-dependencies]
tari_features = { path = "../../common/tari_features", version = "1.10.0-pre.1" }
tari_features = { path = "../../common/tari_features", version = "1.10.1-pre.0" }
tonic-build = "0.12.3"

[package.metadata.cargo-machete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use std::convert::TryFrom;

use tari_common_types::types::{ComAndPubSignature, Commitment, PrivateKey, PublicKey};
use tari_common_types::types::{ComAndPubSignature, CompressedCommitment, CompressedPublicKey, PrivateKey};
use tari_utilities::ByteArray;

use crate::tari_rpc as grpc;
Expand All @@ -31,9 +31,9 @@ impl TryFrom<grpc::ComAndPubSignature> for ComAndPubSignature {
type Error = String;

fn try_from(sig: grpc::ComAndPubSignature) -> Result<Self, Self::Error> {
let ephemeral_commitment = Commitment::from_canonical_bytes(&sig.ephemeral_commitment)
let ephemeral_commitment = CompressedCommitment::from_canonical_bytes(&sig.ephemeral_commitment)
.map_err(|_| "Could not get ephemeral commitment".to_string())?;
let ephemeral_pubkey = PublicKey::from_canonical_bytes(&sig.ephemeral_pubkey)
let ephemeral_pubkey = CompressedPublicKey::from_canonical_bytes(&sig.ephemeral_pubkey)
.map_err(|_| "Could not get ephemeral public key".to_string())?;
let u_a = PrivateKey::from_canonical_bytes(&sig.u_a)
.map_err(|_| "Could not get partial signature u_a".to_string())?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@

use std::convert::TryFrom;

use tari_common_types::types::{PrivateKey, PublicKey};
use tari_crypto::{commitment::HomomorphicCommitment, signatures::CommitmentSignature};
use tari_common_types::types::PrivateKey;
use tari_crypto::{commitment::HomomorphicCommitment, ristretto::RistrettoPublicKey, signatures::CommitmentSignature};
use tari_utilities::ByteArray;

use crate::tari_rpc as grpc;

impl TryFrom<grpc::CommitmentSignature> for CommitmentSignature<PublicKey, PrivateKey> {
impl TryFrom<grpc::CommitmentSignature> for CommitmentSignature<RistrettoPublicKey, PrivateKey> {
type Error = String;

fn try_from(sig: grpc::CommitmentSignature) -> Result<Self, Self::Error> {
let public_nonce = HomomorphicCommitment::<PublicKey>::from_canonical_bytes(&sig.public_nonce)
let public_nonce = HomomorphicCommitment::<RistrettoPublicKey>::from_canonical_bytes(&sig.public_nonce)
.map_err(|_| "Could not get public nonce".to_string())?;
let u = PrivateKey::from_canonical_bytes(&sig.u).map_err(|_| "Could not get u_x".to_string())?;
let v = PrivateKey::from_canonical_bytes(&sig.v).map_err(|_| "Could not get v_x".to_string())?;
Expand All @@ -41,8 +41,8 @@ impl TryFrom<grpc::CommitmentSignature> for CommitmentSignature<PublicKey, Priva
}
}

impl From<CommitmentSignature<PublicKey, PrivateKey>> for grpc::CommitmentSignature {
fn from(sig: CommitmentSignature<PublicKey, PrivateKey>) -> Self {
impl From<CommitmentSignature<RistrettoPublicKey, PrivateKey>> for grpc::CommitmentSignature {
fn from(sig: CommitmentSignature<RistrettoPublicKey, PrivateKey>) -> Self {
Self {
public_nonce: sig.public_nonce().to_vec(),
u: sig.u().to_vec(),
Expand Down
Loading

0 comments on commit e319861

Please sign in to comment.