txgate_crypto/lib.rs
1//! # txgate-crypto
2//!
3//! Cryptographic operations for the `TxGate` signing service.
4//!
5//! ## Internal Crate Warning
6//!
7//! **This crate is an internal implementation detail of [`txgate`](https://crates.io/crates/txgate).**
8//!
9//! It is published to crates.io only because Cargo requires all dependencies to be
10//! published. The API is **unstable** and may change without notice between any versions,
11//! including patch releases.
12//!
13//! **Do not depend on this crate directly.** Instead:
14//! - For the signing server binary: `cargo install txgate`
15//! - For programmatic access: Open an issue at <https://github.com/txgate-project/txgate>
16//! to discuss a stable public API.
17//!
18//! This crate provides all cryptographic functionality:
19//!
20//! ## Modules (planned)
21//!
22//! - `keys` - Key generation, storage, and management
23//! - `signing` - Transaction signing implementations
24//! - `verify` - Signature verification
25//! - `kms` - Key Management Service integrations (AWS KMS, `HashiCorp` Vault, etc.)
26//! - `algorithms` - Supported cryptographic algorithms (ECDSA, `EdDSA`, etc.)
27//!
28//! ## Supported Algorithms (planned)
29//!
30//! - ECDSA (secp256k1) - Bitcoin, Ethereum, EVM chains
31//! - `EdDSA` (Ed25519) - Solana, NEAR, etc.
32//! - SR25519 - Substrate-based chains
33//!
34//! ## Security
35//!
36//! This crate follows best practices for cryptographic implementations:
37//! - No unsafe code allowed
38//! - Constant-time operations where applicable
39//! - Secure memory handling for key material
40
41#![forbid(unsafe_code)]
42#![warn(missing_docs)]
43#![warn(clippy::all)]
44#![warn(clippy::pedantic)]
45
46pub mod encryption;
47pub mod keypair;
48pub mod keys;
49pub mod signer;
50pub mod store;
51
52// Placeholder for future modules
53// pub mod verify;
54// pub mod kms;
55// pub mod algorithms;
56
57// Re-export commonly used types
58pub use encryption::{
59 decrypt_key, encrypt_key, EncryptedKey, ENCRYPTED_KEY_LEN, ENCRYPTION_VERSION, NONCE_LEN,
60 PLAINTEXT_LEN, SALT_LEN, TAG_LEN,
61};
62pub use keys::{SecretKey, SecretKeyError, SECRET_KEY_LEN};
63
64// Re-export key pair types
65pub use keypair::{
66 Ed25519KeyPair, Ed25519PublicKey, Ed25519Signature, KeyPair, Secp256k1KeyPair,
67 Secp256k1PublicKey, Secp256k1Signature,
68};
69
70// Re-export signer types
71pub use signer::{Chain, CurveType, Ed25519Signer, Secp256k1Signer, Signer};
72
73// Re-export key store types
74pub use store::{FileKeyStore, KeyStore};