Skip to main content

syncspin_core/
lib.rs

1//! Protocol core for Sendspin.
2//!
3//! This crate owns everything that is shared between client and server and that must exist
4//! exactly once: the Noise handshake, message framing, the message types and the clock filter.
5//! It knows no transport and no device integration, and it never depends on the
6//! `syncspin-client` or `syncspin-server` crates.
7//!
8//! Both halves use it: the Noise layer carries [`noise::Responder`] for the client and
9//! [`noise::Initiator`] for the server, over both cipher suites the specification names. Beyond
10//! that this crate holds the message types, the framing layer with fragmentation, the clock filter,
11//! and the pairing primitives — the token, the CPace code flow and the AEAD that seals its values
12//! behind `pairing-code`. It is the protocol and the crypto; the connection state machines live in
13//! the `syncspin-client` and `syncspin-server` crates.
14
15pub mod clock;
16pub mod framing;
17pub mod messages;
18pub mod noise;
19pub mod pairing;
20
21/// Returns the version of this crate as recorded in its manifest.
22pub fn version() -> &'static str {
23    env!("CARGO_PKG_VERSION")
24}
25
26#[cfg(test)]
27mod tests {
28    use super::*;
29
30    #[test]
31    fn version_is_the_workspace_version() {
32        assert_eq!(version(), "0.4.0");
33    }
34}