Skip to content

Commit

Permalink
Change crate name to sphinx-packet (#91)
Browse files Browse the repository at this point in the history
* Change crate name to sphinx-packet

* Update imports

* rustfmt

* Allow renamed and removed lints
  • Loading branch information
octol authored Feb 22, 2023
1 parent 22f0d87 commit ca107d9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "sphinx"
name = "sphinx-packet"
version = "0.1.0"
authors = ["Ania Piotrowska <[email protected]>", "Dave Hrycyszyn <[email protected]>", "Jędrzej Stuczyński <[email protected]>"]
edition = "2018"
Expand Down
14 changes: 8 additions & 6 deletions benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

extern crate sphinx;
extern crate sphinx_packet;

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use sphinx::constants::{DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH};
use sphinx::crypto::keygen;
use sphinx::header::delays;
use sphinx::route::{Destination, DestinationAddressBytes, Node, NodeAddressBytes};
use sphinx::SphinxPacket;
use sphinx_packet::constants::{
DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH,
};
use sphinx_packet::crypto::keygen;
use sphinx_packet::header::delays;
use sphinx_packet::route::{Destination, DestinationAddressBytes, Node, NodeAddressBytes};
use sphinx_packet::SphinxPacket;
use std::time::Duration;

fn make_packet_copy(packet: &SphinxPacket) -> SphinxPacket {
Expand Down
3 changes: 3 additions & 0 deletions src/crypto/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ pub fn clamp_scalar_bytes(mut scalar_bytes: [u8; PRIVATE_KEY_SIZE]) -> Scalar {
// derive zeroize::Zeroize on drop here
pub struct PrivateKey(Scalar);

// Because the lint below was renamed in nightly but not in stable, making this problematic in CI
// which tests both, for a brief period we allow renamed lints.
#[allow(renamed_and_removed_lints)] // TODO: remove this in next version
#[allow(clippy::derive_hash_xor_eq)] // TODO: we must be careful about that one if anything changes in the future
#[derive(Copy, Clone, Debug, Hash)]
pub struct PublicKey(MontgomeryPoint);
Expand Down
24 changes: 12 additions & 12 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

extern crate sphinx;
extern crate sphinx_packet;

use sphinx::crypto;
use sphinx::header::delays;
use sphinx::route::{Destination, Node};
use sphinx::SphinxPacket;
use sphinx_packet::crypto;
use sphinx_packet::header::delays;
use sphinx_packet::route::{Destination, Node};
use sphinx_packet::SphinxPacket;

// const PAYLOAD_SIZE: usize = 1024;

#[cfg(test)]
mod create_and_process_sphinx_packet {
use super::*;
use sphinx::route::{DestinationAddressBytes, NodeAddressBytes};
use sphinx::{
use sphinx_packet::route::{DestinationAddressBytes, NodeAddressBytes};
use sphinx_packet::{
constants::{
DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, PAYLOAD_SIZE,
SECURITY_PARAMETER,
Expand Down Expand Up @@ -102,8 +102,8 @@ mod create_and_process_sphinx_packet {
#[cfg(test)]
mod converting_sphinx_packet_to_and_from_bytes {
use super::*;
use sphinx::route::{DestinationAddressBytes, NodeAddressBytes};
use sphinx::{
use sphinx_packet::route::{DestinationAddressBytes, NodeAddressBytes};
use sphinx_packet::{
constants::{
DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, PAYLOAD_SIZE,
SECURITY_PARAMETER,
Expand Down Expand Up @@ -220,9 +220,9 @@ mod converting_sphinx_packet_to_and_from_bytes {
mod create_and_process_surb {
use super::*;
use crypto::EphemeralSecret;
use sphinx::route::NodeAddressBytes;
use sphinx::surb::{SURBMaterial, SURB};
use sphinx::{
use sphinx_packet::route::NodeAddressBytes;
use sphinx_packet::surb::{SURBMaterial, SURB};
use sphinx_packet::{
constants::{NODE_ADDRESS_LENGTH, PAYLOAD_SIZE, SECURITY_PARAMETER},
packet::builder::DEFAULT_PAYLOAD_SIZE,
test_utils::fixtures::destination_fixture,
Expand Down

0 comments on commit ca107d9

Please sign in to comment.