Skip to content

Commit

Permalink
extract baid64 into a dedicated crate and repo
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 24, 2024
1 parent 1dad729 commit 8fa216d
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 258 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ required-features = ["cli"]

[dependencies]
amplify = "4.6.0"
baid64 = "0.1.0"
secp256k1 = { version = "0.29.0", features = ["rand", "global-context", "rand-std"] }
ec25519 = "0.1.0"
rand = "0.8.5"
Expand Down
249 changes: 0 additions & 249 deletions src/baid64.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/bip340.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ use std::fmt::{Display, Formatter};
use std::hash::{Hash, Hasher};
use std::str::FromStr;

use baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str};
use secp256k1::schnorr::Signature;
use secp256k1::{Keypair, Message, SecretKey, XOnlyPublicKey, SECP256K1};

use crate::baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str};
use crate::{Algo, Chain, InvalidPubkey, InvalidSig, SsiPub, SsiSig};

#[derive(Clone, Eq, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use std::hash::{Hash, Hasher};
use std::ops::Deref;
use std::str::FromStr;

use baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str};
use ec25519::{KeyPair, Noise, PublicKey, SecretKey, Seed, Signature};

use crate::baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str};
use crate::{Algo, Chain, InvalidPubkey, InvalidSig, SsiPub, SsiSig};

#[derive(Clone, Eq, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ use std::collections::BTreeSet;
use std::fmt::{self, Display, Formatter};
use std::str::{FromStr, Utf8Error};

use baid64::Baid64ParseError;
use chrono::{DateTime, Utc};
use fluent_uri::Uri;
use percent_encoding::{percent_decode_str, utf8_percent_encode, AsciiSet, CONTROLS};
use sha2::{Digest, Sha256};

use crate::baid64::Baid64ParseError;
use crate::{InvalidSig, SsiPub, SsiSecret, SsiSig};

#[derive(Clone, Eq, PartialEq, Debug, Display, Error, From)]
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#[macro_use]
extern crate amplify;

pub mod baid64;

mod identity;
mod secret;
mod public;
Expand Down
3 changes: 1 addition & 2 deletions src/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use std::hash::Hash;
use std::str::FromStr;

use amplify::{hex, Bytes, Bytes32, Display};

use crate::baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str};
use baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str};

#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Display, Default)]
#[non_exhaustive]
Expand Down
3 changes: 2 additions & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ use std::io::{self, BufRead, Write};
use std::os::unix::fs::PermissionsExt;
use std::path::PathBuf;

use crate::baid64::Baid64ParseError;
use baid64::Baid64ParseError;

use crate::{Fingerprint, SecretParseError, Ssi, SsiPair, SsiParseError, SsiQuery, SsiSecret};

#[derive(Debug, Display, Error, From)]
Expand Down
2 changes: 1 addition & 1 deletion src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ use aes::cipher::generic_array::GenericArray;
use aes::cipher::{BlockDecrypt, BlockEncrypt, KeyInit};
use aes::{Aes256, Block};
use amplify::Bytes32;
use baid64::Baid64ParseError;
use chrono::{DateTime, Utc};
use sha2::{Digest, Sha256};

use crate::baid64::Baid64ParseError;
use crate::{Algo, Bip340Secret, Chain, Ed25519Secret, Fingerprint, Ssi, SsiCert, SsiPub, SsiSig};

#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
Expand Down

0 comments on commit 8fa216d

Please sign in to comment.