diff --git a/core/src/core/build.rs b/core/src/core/build.rs index fe2cae8ee..bcb40f82f 100644 --- a/core/src/core/build.rs +++ b/core/src/core/build.rs @@ -31,7 +31,6 @@ use secp::key::SecretKey; use rand::os::OsRng; use core::{Transaction, Input, Output, DEFAULT_OUTPUT}; -use core::Committed; /// Context information available to transaction combinators. pub struct Context { @@ -174,7 +173,6 @@ pub fn transaction(elems: Vec<Box<Append>>) -> Result<(Transaction, SecretKey), |acc, elem| elem(&mut ctx, acc)); let blind_sum = sum.sum(&ctx.secp)?; - let pubkey = secp::key::PublicKey::from_secret_key(&ctx.secp, &blind_sum)?; let msg = secp::Message::from_slice(&u64_to_32bytes(tx.fee))?; let sig = ctx.secp.sign(&msg, &blind_sum)?; tx.excess_sig = sig.serialize_der(&ctx.secp); diff --git a/secp256k1zkp/src/ffi.rs b/secp256k1zkp/src/ffi.rs index f6b08ed09..782aa523d 100644 --- a/secp256k1zkp/src/ffi.rs +++ b/secp256k1zkp/src/ffi.rs @@ -17,7 +17,6 @@ //! Direct bindings to the underlying C library functions. These should //! not be needed for most users. use std::mem; -use std::hash; use libc::{c_int, c_uchar, c_uint, c_void, size_t, int64_t, uint64_t}; diff --git a/secp256k1zkp/src/pedersen.rs b/secp256k1zkp/src/pedersen.rs index bd0075d24..caf760f28 100644 --- a/secp256k1zkp/src/pedersen.rs +++ b/secp256k1zkp/src/pedersen.rs @@ -16,7 +16,6 @@ //! # Pedersen commitments and related range proofs use std::mem; -use std::convert; use ContextFlag; use Error; @@ -25,7 +24,7 @@ use Secp256k1; use constants; use ffi; use key; -use key::{SecretKey, PublicKey}; +use key::SecretKey; use rand::{Rng, OsRng}; /// A Pedersen commitment @@ -43,10 +42,6 @@ impl Commitment { pub fn to_pubkey(&self, secp: &Secp256k1) -> Result<key::PublicKey, Error> { key::PublicKey::from_slice(secp, &self.0) } - /// Underlying data - pub fn bytes(&self) -> &[u8] { - &self.0 - } } /// A range proof. Typically much larger in memory that the above (~5k). @@ -83,9 +78,11 @@ impl AsRef<[u8]> for RangeProof { } impl RangeProof { + /// The range proof as a byte slice. pub fn bytes(&self) -> &[u8] { &self.proof[..self.plen as usize] } + /// Length of the range proof in bytes. pub fn len(&self) -> usize { self.plen } @@ -327,6 +324,8 @@ impl Secp256k1 { } } + /// General information extracted from a range proof. Does not provide any + /// information about the value or the message (see rewind). pub fn range_proof_info(&self, proof: RangeProof) -> ProofInfo { let mut exp: i32 = 0; let mut mantissa: i32 = 0;