code: Use std::span where appropriate (#6658)

* code: Use std::span when possible

* code: Prefix memcpy and memcmp with std::
This commit is contained in:
GPUCode
2023-07-07 01:52:40 +03:00
committed by GitHub
parent 4ccd9f24fb
commit cf9bb90ae3
106 changed files with 362 additions and 329 deletions

View File

@@ -4,6 +4,7 @@
#pragma once
#include <span>
#include <vector>
#include "common/common_types.h"
@@ -14,7 +15,7 @@ public:
RsaSlot() = default;
RsaSlot(std::vector<u8> exponent, std::vector<u8> modulus)
: init(true), exponent(std::move(exponent)), modulus(std::move(modulus)) {}
std::vector<u8> GetSignature(const std::vector<u8>& message) const;
std::vector<u8> GetSignature(std::span<const u8> message) const;
explicit operator bool() const {
// TODO(B3N30): Maybe check if exponent and modulus are vailid
@@ -31,6 +32,6 @@ void InitSlots();
RsaSlot GetSlot(std::size_t slot_id);
std::vector<u8> CreateASN1Message(const std::vector<u8>& data);
std::vector<u8> CreateASN1Message(std::span<const u8> data);
} // namespace HW::RSA
} // namespace HW::RSA