diff --git a/include/session/config/groups/info.hpp b/include/session/config/groups/info.hpp index 1d48f7c3..9a37d6c2 100644 --- a/include/session/config/groups/info.hpp +++ b/include/session/config/groups/info.hpp @@ -235,7 +235,8 @@ class Info final : public ConfigBase { /// API: groups/Info::get_delete_attach_before /// /// Returns the delete-attachments-before unix timestamp (seconds) for the group; clients should - /// delete all attachments from the closed group with timestamps earlier than this value, if set. + /// delete all attachments from the closed group with timestamps earlier than this value, if + /// set. /// /// Returns std::nullopt if no delete-attachments-before timestamp is set. /// diff --git a/include/session/config/groups/keys.hpp b/include/session/config/groups/keys.hpp index 49a736f8..5f7a3608 100644 --- a/include/session/config/groups/keys.hpp +++ b/include/session/config/groups/keys.hpp @@ -167,7 +167,8 @@ class Keys final : public ConfigSig { /// - `group_ed25519_pubkey` is the public key of the group, used to verify message signatures /// on key updates. Required. Should not include the `03` prefix. /// - `group_ed25519_secretkey` is the secret key of the group, used to sign config messages and - /// swarm authentication tokens and to encrypt and decrypt encryption keys for regular messages. + /// swarm authentication tokens and to encrypt and decrypt encryption keys for regular + /// messages. /// This is only possessed by the group admin(s), and must be provided /// in order to make and push config changes. /// - `dumped` -- either `std::nullopt` to construct a new, empty object; or binary state data diff --git a/include/session/config/groups/members.hpp b/include/session/config/groups/members.hpp index 445bbe93..02e5af33 100644 --- a/include/session/config/groups/members.hpp +++ b/include/session/config/groups/members.hpp @@ -220,8 +220,9 @@ class Members final : public ConfigBase { /// To construct a blank members object (i.e. with no pre-existing dumped data to load) pass /// `std::nullopt` as the third argument. /// - /// Encryption keys must be loaded before the Members object can be modified or parse other Members - /// messages, and are typically loaded by providing the `Members` object to the `Keys` class. + /// Encryption keys must be loaded before the Members object can be modified or parse other + /// Members messages, and are typically loaded by providing the `Members` object to the `Keys` + /// class. /// /// Inputs: /// - `ed25519_pubkey` is the public key of this group, used to validate config messages. diff --git a/src/config/groups/keys.cpp b/src/config/groups/keys.cpp index ae5af31d..e6965ea5 100644 --- a/src/config/groups/keys.cpp +++ b/src/config/groups/keys.cpp @@ -436,7 +436,8 @@ ustring Keys::key_supplement(const std::vector& sids) const { // (66 chars), in sorted order. // - keysdata is the unencrypted inner value that we are encrypting for each supplemental member // - H2(.) = 32-byte BLAKE2b keyed hash of the sodium group secret key seed (just the 32 byte, - // not the full 64 byte with the pubkey in the second half), key "SessionGroupNonceSeed" + // not the full 64 byte with the pubkey in the second half), key + // "SessionGroupNonceSeed" std::string supp_keys; { @@ -458,8 +459,7 @@ ustring Keys::key_supplement(const std::vector& sids) const { crypto_generichash_blake2b_state st; - crypto_generichash_blake2b_init( - &st, nonce_hash_key.data(), nonce_hash_key.size(), h1.size()); + crypto_generichash_blake2b_init(&st, nonce_hash_key.data(), nonce_hash_key.size(), h1.size()); for (const auto& sid : sids) crypto_generichash_blake2b_update(&st, to_unsigned(sid.data()), sid.size()); @@ -525,8 +525,8 @@ ustring Keys::key_supplement(const std::vector& sids) const { d.append("G", keys_.back().generation); - // Finally we sign the message and put the signature as the ~ key (which is 0x7f, and thus comes later than - // any other ascii key). + // Finally we sign the message and put the signature as the ~ key (which is 0x7f, and thus comes + // later than any other ascii key). auto to_sign = to_unsigned_sv(d.view()); // The view contains the trailing "e", but we don't sign it (we are going to append the // signature there instead): @@ -693,7 +693,8 @@ Keys::swarm_auth Keys::swarm_subaccount_sign( // token is now set: flags || kT ustring_view kT{to_unsigned(token.data() + 4), 32}; - // sub_sig is just the admin's signature, sitting at the end of sign_val (after p || f || 0 || 0 || k): + // sub_sig is just the admin's signature, sitting at the end of sign_val (after p || f || 0 || 0 + // || k): sub_sig = from_unsigned_sv(sign_val.substr(36)); // Our signing private scalar is kt, where t = ±s according to whether we had to negate S to @@ -1158,9 +1159,9 @@ void Keys::remove_expired() { active_msgs_.erase( active_msgs_.begin(), active_msgs_.lower_bound(keys_.front().generation)); else - // Keys is empty, which means we aren't keeping *any* keys around (or they are all invalid or - // something) and so it isn't really up to us to keep them alive, since that's a history of - // the group we apparently don't have access to. + // Keys is empty, which means we aren't keeping *any* keys around (or they are all invalid + // or something) and so it isn't really up to us to keep them alive, since that's a history + // of the group we apparently don't have access to. active_msgs_.clear(); } diff --git a/src/xed25519.cpp b/src/xed25519.cpp index 2b2c0426..c781105d 100644 --- a/src/xed25519.cpp +++ b/src/xed25519.cpp @@ -97,8 +97,8 @@ bytes<64> sign(ustring_view curve25519_privkey, ustring_view msg) { crypto_core_ed25519_scalar_negate(neg_a.data(), a.data()); constant_time_conditional_assign(a, neg_a, negative); - // We now have our a, A private/public keypair. (Note that a is just the private key scalar, *not* the - // ed25519 secret key). + // We now have our a, A private/public keypair. (Note that a is just the private key scalar, + // *not* the ed25519 secret key). bytes<32> r = xed25519_compute_r(a, msg); bytes<64> signature; // R || S