Skip to content

Commit ca107d9

Browse files
authored
Change crate name to sphinx-packet (#91)
* Change crate name to sphinx-packet * Update imports * rustfmt * Allow renamed and removed lints
1 parent 22f0d87 commit ca107d9

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "sphinx"
2+
name = "sphinx-packet"
33
version = "0.1.0"
44
authors = ["Ania Piotrowska <ania@nymtech.net>", "Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
55
edition = "2018"

benches/benchmarks.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
extern crate sphinx;
15+
extern crate sphinx_packet;
1616

1717
use criterion::{black_box, criterion_group, criterion_main, Criterion};
18-
use sphinx::constants::{DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH};
19-
use sphinx::crypto::keygen;
20-
use sphinx::header::delays;
21-
use sphinx::route::{Destination, DestinationAddressBytes, Node, NodeAddressBytes};
22-
use sphinx::SphinxPacket;
18+
use sphinx_packet::constants::{
19+
DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH,
20+
};
21+
use sphinx_packet::crypto::keygen;
22+
use sphinx_packet::header::delays;
23+
use sphinx_packet::route::{Destination, DestinationAddressBytes, Node, NodeAddressBytes};
24+
use sphinx_packet::SphinxPacket;
2325
use std::time::Duration;
2426

2527
fn make_packet_copy(packet: &SphinxPacket) -> SphinxPacket {

src/crypto/keys.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ pub fn clamp_scalar_bytes(mut scalar_bytes: [u8; PRIVATE_KEY_SIZE]) -> Scalar {
4444
// derive zeroize::Zeroize on drop here
4545
pub struct PrivateKey(Scalar);
4646

47+
// Because the lint below was renamed in nightly but not in stable, making this problematic in CI
48+
// which tests both, for a brief period we allow renamed lints.
49+
#[allow(renamed_and_removed_lints)] // TODO: remove this in next version
4750
#[allow(clippy::derive_hash_xor_eq)] // TODO: we must be careful about that one if anything changes in the future
4851
#[derive(Copy, Clone, Debug, Hash)]
4952
pub struct PublicKey(MontgomeryPoint);

tests/integration_test.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
extern crate sphinx;
15+
extern crate sphinx_packet;
1616

17-
use sphinx::crypto;
18-
use sphinx::header::delays;
19-
use sphinx::route::{Destination, Node};
20-
use sphinx::SphinxPacket;
17+
use sphinx_packet::crypto;
18+
use sphinx_packet::header::delays;
19+
use sphinx_packet::route::{Destination, Node};
20+
use sphinx_packet::SphinxPacket;
2121

2222
// const PAYLOAD_SIZE: usize = 1024;
2323

2424
#[cfg(test)]
2525
mod create_and_process_sphinx_packet {
2626
use super::*;
27-
use sphinx::route::{DestinationAddressBytes, NodeAddressBytes};
28-
use sphinx::{
27+
use sphinx_packet::route::{DestinationAddressBytes, NodeAddressBytes};
28+
use sphinx_packet::{
2929
constants::{
3030
DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, PAYLOAD_SIZE,
3131
SECURITY_PARAMETER,
@@ -102,8 +102,8 @@ mod create_and_process_sphinx_packet {
102102
#[cfg(test)]
103103
mod converting_sphinx_packet_to_and_from_bytes {
104104
use super::*;
105-
use sphinx::route::{DestinationAddressBytes, NodeAddressBytes};
106-
use sphinx::{
105+
use sphinx_packet::route::{DestinationAddressBytes, NodeAddressBytes};
106+
use sphinx_packet::{
107107
constants::{
108108
DESTINATION_ADDRESS_LENGTH, IDENTIFIER_LENGTH, NODE_ADDRESS_LENGTH, PAYLOAD_SIZE,
109109
SECURITY_PARAMETER,
@@ -220,9 +220,9 @@ mod converting_sphinx_packet_to_and_from_bytes {
220220
mod create_and_process_surb {
221221
use super::*;
222222
use crypto::EphemeralSecret;
223-
use sphinx::route::NodeAddressBytes;
224-
use sphinx::surb::{SURBMaterial, SURB};
225-
use sphinx::{
223+
use sphinx_packet::route::NodeAddressBytes;
224+
use sphinx_packet::surb::{SURBMaterial, SURB};
225+
use sphinx_packet::{
226226
constants::{NODE_ADDRESS_LENGTH, PAYLOAD_SIZE, SECURITY_PARAMETER},
227227
packet::builder::DEFAULT_PAYLOAD_SIZE,
228228
test_utils::fixtures::destination_fixture,

0 commit comments

Comments
 (0)