aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/Support
diff options
context:
space:
mode:
Diffstat (limited to 'backend/include/rcc/Support')
-rw-r--r--backend/include/rcc/Support/Error.h6
-rw-r--r--backend/include/rcc/Support/SHA256.h24
2 files changed, 30 insertions, 0 deletions
diff --git a/backend/include/rcc/Support/Error.h b/backend/include/rcc/Support/Error.h
index 63c0b2f..0429cc0 100644
--- a/backend/include/rcc/Support/Error.h
+++ b/backend/include/rcc/Support/Error.h
@@ -30,6 +30,12 @@ enum class ErrorCode : std::uint8_t {
FixupApplicationFailed,
RelocationFailed,
ObjectWritingFailed,
+ InvalidInvocation,
+ ManifestError,
+ CacheMiss,
+ ReproducerError,
+ ReductionFailed,
+ FuzzingFailure,
};
[[nodiscard]] std::string_view getErrorCodeName(ErrorCode Code) noexcept;
diff --git a/backend/include/rcc/Support/SHA256.h b/backend/include/rcc/Support/SHA256.h
new file mode 100644
index 0000000..ff7b50b
--- /dev/null
+++ b/backend/include/rcc/Support/SHA256.h
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef RCC_SUPPORT_SHA256_H
+#define RCC_SUPPORT_SHA256_H
+
+#include <array>
+#include <cstddef>
+#include <cstdint>
+#include <span>
+#include <string>
+#include <string_view>
+
+namespace rcc {
+
+using SHA256Digest = std::array<std::uint8_t, 32>;
+
+[[nodiscard]] SHA256Digest sha256(std::span<const std::byte> Input);
+[[nodiscard]] SHA256Digest sha256(std::string_view Input);
+[[nodiscard]] std::string sha256Hex(std::span<const std::byte> Input);
+[[nodiscard]] std::string sha256Hex(std::string_view Input);
+
+} // namespace rcc
+
+#endif // RCC_SUPPORT_SHA256_H