forked from signalapp/libsignal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[signalapp#473] change the consts namespace
- Loading branch information
1 parent
ab29fed
commit 9d6cce5
Showing
5 changed files
with
54 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
// | ||
// Copyright 2020 Signal Messenger, LLC. | ||
// Copyright 2020-2022 Signal Messenger, LLC. | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
// | ||
|
||
pub const MAX_FORWARD_JUMPS: usize = 25_000; | ||
pub const MAX_MESSAGE_KEYS: usize = 2000; | ||
pub const MAX_RECEIVER_CHAINS: usize = 5; | ||
pub const ARCHIVED_STATES_MAX_LENGTH: usize = 40; | ||
pub const MAX_SENDER_KEY_STATES: usize = 5; | ||
#![warn(missing_docs)] | ||
|
||
//! Magic numbers. | ||
/// Various positive integers bounding the maximum size of other data structures. | ||
pub mod limits { | ||
/// The maximum number of encrypted messages that the client chain which decrypts Signal | ||
/// messages in a [Double Ratchet] instance can retrieve at once (tracked in | ||
/// [crate::proto::storage::session_structure::chain::ChainKey::index] as well as a separate | ||
/// `counter`). | ||
/// | ||
/// [Double Ratchet]: https://signal.org/docs/specifications/doubleratchet/ | ||
pub const MAX_FORWARD_JUMPS: usize = 25_000; | ||
/// The maximum number of per-message keys that can be retained to decrypt messages within | ||
/// a specific chain from `message_keys` in [crate::proto::storage::session_structure::Chain]. | ||
pub const MAX_MESSAGE_KEYS: usize = 2000; | ||
/// The maximum number of temporary backup chains to allow for `receiver_chains` in | ||
/// [crate::proto::storage::SessionStructure]. These backup chains corresponds to the [Sesame] | ||
/// protocol for syncing a Double Ratchet chain between two users. | ||
/// | ||
/// [Sesame]: https://signal.org/docs/specifications/sesame/#server | ||
pub const MAX_RECEIVER_CHAINS: usize = 5; | ||
/// The maximum number of sessions allowed for | ||
/// [crate::proto::storage::RecordStructure::previous_sessions]. | ||
pub const ARCHIVED_STATES_MAX_LENGTH: usize = 40; | ||
/// The maximum number of sender key states allowed for | ||
/// [crate::proto::storage::SenderKeyRecordStructure::sender_key_states]. | ||
pub const MAX_SENDER_KEY_STATES: usize = 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters