Skip to content

Commit

Permalink
Add a warning to SessionId::from_seed()
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Oct 22, 2024
1 parent 28e9c44 commit 1f87d79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manul/src/session/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ impl SessionId {
}

/// Creates a session identifier deterministically from the given bytestring.
///
/// **Warning:** make sure the bytestring you provide will not be reused within your application.
/// Session ID collisions will affect error attribution and evidence verification.
pub fn from_seed<SP: SessionParameters>(bytes: &[u8]) -> Self {
Self(
SP::Digest::new_with_prefix(b"SessionId")
Expand Down

0 comments on commit 1f87d79

Please sign in to comment.