about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/crypto.hh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-17T15·31+0100
committerVincent Ambo <tazjin@google.com>2020-05-17T15·31+0100
commit0f2cf531f705d370321843e5ba9135b2ebdb5d19 (patch)
tree256feb13963a849ed96e89228fa05454c2a22363 /third_party/nix/src/libstore/crypto.hh
parent65a1aae98ce5a237c9643e639e550c8b0c0be7f1 (diff)
style(3p/nix): Reformat project in Google C++ style r/740
Reformatted with:

    fd . -e hh -e cc | xargs clang-format -i
Diffstat (limited to 'third_party/nix/src/libstore/crypto.hh')
-rw-r--r--third_party/nix/src/libstore/crypto.hh50
1 files changed, 22 insertions, 28 deletions
diff --git a/third_party/nix/src/libstore/crypto.hh b/third_party/nix/src/libstore/crypto.hh
index 9110af3aa9e5..ffafe6560d15 100644
--- a/third_party/nix/src/libstore/crypto.hh
+++ b/third_party/nix/src/libstore/crypto.hh
@@ -1,54 +1,48 @@
 #pragma once
 
-#include "types.hh"
-
 #include <map>
+#include "types.hh"
 
 namespace nix {
 
-struct Key
-{
-    std::string name;
-    std::string key;
+struct Key {
+  std::string name;
+  std::string key;
 
-    /* Construct Key from a string in the format
-       ‘<name>:<key-in-base64>’. */
-    Key(const std::string & s);
+  /* Construct Key from a string in the format
+     ‘<name>:<key-in-base64>’. */
+  Key(const std::string& s);
 
-protected:
-    Key(const std::string & name, const std::string & key)
-        : name(name), key(key) { }
+ protected:
+  Key(const std::string& name, const std::string& key) : name(name), key(key) {}
 };
 
 struct PublicKey;
 
-struct SecretKey : Key
-{
-    SecretKey(const std::string & s);
+struct SecretKey : Key {
+  SecretKey(const std::string& s);
 
-    /* Return a detached signature of the given string. */
-    std::string signDetached(const std::string & s) const;
+  /* Return a detached signature of the given string. */
+  std::string signDetached(const std::string& s) const;
 
-    PublicKey toPublicKey() const;
+  PublicKey toPublicKey() const;
 };
 
-struct PublicKey : Key
-{
-    PublicKey(const std::string & data);
+struct PublicKey : Key {
+  PublicKey(const std::string& data);
 
-private:
-    PublicKey(const std::string & name, const std::string & key)
-        : Key(name, key) { }
-    friend struct SecretKey;
+ private:
+  PublicKey(const std::string& name, const std::string& key) : Key(name, key) {}
+  friend struct SecretKey;
 };
 
 typedef std::map<std::string, PublicKey> PublicKeys;
 
 /* Return true iff ‘sig’ is a correct signature over ‘data’ using one
    of the given public keys. */
-bool verifyDetached(const std::string & data, const std::string & sig,
-    const PublicKeys & publicKeys);
+bool verifyDetached(const std::string& data, const std::string& sig,
+                    const PublicKeys& publicKeys);
 
 PublicKeys getDefaultPublicKeys();
 
-}
+}  // namespace nix