Debian Codegraph @

src/dpp/dave/key_ratchet.h

raw symbols SCIP
1 /************************************************************************************
2 *
3 * D++, A Lightweight C++ library for Discord
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 * Copyright 2021 Craig Edwards and D++ contributors
7 * (https://github.com/brainboxdotcc/DPP/graphs/contributors)
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 *
21 * This folder is a modified fork of libdave, https://github.com/discord/libdave
22 * Copyright (c) 2024 Discord, Licensed under MIT
23 *
24 ************************************************************************************/
25 #pragma once
26
27 #include <memory>
28 #include "common.h"cxx . . $ `<file>/src/dpp/dave/common.h`/
29
30 namespace dppcxx . . $ dpp/::davecxx . . $ dpp/dave/ {
31
32 /**
33 * @brief Key generation number
34 */
35 using key_generationcxx . . $ dpp/dave/key_generation# = uint32_tcxx . . $ uint32_t#;
36
37 /**
38 * @brief Represents the interface used for a key ratchet.
39 * A key ratchet is a way of propogating key pairs up the tree used by MLS
40 * so we dont have to store O(n^n) key combinations.
41 */
42 class key_ratchet_interfacecxx . . $ dpp/dave/key_ratchet_interface# { // NOLINT
43 public:
44 /**
45 * @brief Default destructor
46 */
47 virtual ~cxx . . $ dpp/dave/key_ratchet_interface#`~key_ratchet_interface`(ced63f7c635d850d).key_ratchet_interfacecxx . . $ dpp/dave/key_ratchet_interface#() noexcept = default;
48
49 /**
50 * @brief Get key for ratchet
51 * @param generation current generation number
52 * @return encryption key
53 */
54 virtual encryption_keycxx . . $ dpp/dave/encryption_key# get_keycxx . . $ dpp/dave/key_ratchet_interface#get_key(cabe47f5dc5a44ad).(key_generationcxx . . $ dpp/dave/key_generation# generation) noexcept = 0;
55
56 /**
57 * @brief Delete key for ratchet
58 * @param generation current generation number
59 */
60 virtual void delete_keycxx . . $ dpp/dave/key_ratchet_interface#delete_key(6bab9b75950d6f3).(key_generationcxx . . $ dpp/dave/key_generation# generation) noexcept = 0;
61 };
62
63 }