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 endpoint;
17pub mod framing;
18pub mod messages;
19pub mod noise;
20pub mod pairing;
21
22/// Returns the version of this crate as recorded in its manifest.
23pub fn version() -> &'static str {
24    env!("CARGO_PKG_VERSION")
25}
26
27#[cfg(test)]
28mod tests {
29    use super::*;
30
31    #[test]
32    fn version_is_the_workspace_version() {
33        assert_eq!(version(), "0.5.0");
34    }
35}