summaryrefslogtreecommitdiffstats
path: root/modules/mbedtls/crypto_mbedtls.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-15 15:44:43 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-15 15:44:43 +0100
commitef5d6ccfb7bf155a238ada79db12ea41ca993116 (patch)
treebc1acc6c5b0df70661293de0f8d0586ce0808982 /modules/mbedtls/crypto_mbedtls.h
parent4859f8090f1e21d42bc81313f15367dcb1c4220c (diff)
parenta8bc9f3e78788bdf0be7348fcbfac15c127f1f48 (diff)
downloadredot-engine-ef5d6ccfb7bf155a238ada79db12ea41ca993116.tar.gz
Merge pull request #86966 from Muller-Castro/value2ref-core
Add const lvalue ref to `core/*` container parameters
Diffstat (limited to 'modules/mbedtls/crypto_mbedtls.h')
-rw-r--r--modules/mbedtls/crypto_mbedtls.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h
index 0168e1f663..60a413ed7c 100644
--- a/modules/mbedtls/crypto_mbedtls.h
+++ b/modules/mbedtls/crypto_mbedtls.h
@@ -51,10 +51,10 @@ public:
static void make_default() { CryptoKey::_create = create; }
static void finalize() { CryptoKey::_create = nullptr; }
- virtual Error load(String p_path, bool p_public_only);
- virtual Error save(String p_path, bool p_public_only);
+ virtual Error load(const String &p_path, bool p_public_only);
+ virtual Error save(const String &p_path, bool p_public_only);
virtual String save_to_string(bool p_public_only);
- virtual Error load_from_string(String p_string_key, bool p_public_only);
+ virtual Error load_from_string(const String &p_string_key, bool p_public_only);
virtual bool is_public_only() const { return public_only; };
CryptoKeyMbedTLS() {
@@ -82,9 +82,9 @@ public:
static void make_default() { X509Certificate::_create = create; }
static void finalize() { X509Certificate::_create = nullptr; }
- virtual Error load(String p_path);
+ virtual Error load(const String &p_path);
virtual Error load_from_memory(const uint8_t *p_buffer, int p_len);
- virtual Error save(String p_path);
+ virtual Error save(const String &p_path);
virtual String save_to_string();
virtual Error load_from_string(const String &p_string_key);
@@ -116,8 +116,8 @@ public:
static bool is_md_type_allowed(mbedtls_md_type_t p_md_type);
- virtual Error start(HashingContext::HashType p_hash_type, PackedByteArray p_key);
- virtual Error update(PackedByteArray p_data);
+ virtual Error start(HashingContext::HashType p_hash_type, const PackedByteArray &p_key);
+ virtual Error update(const PackedByteArray &p_data);
virtual PackedByteArray finish();
HMACContextMbedTLS() {}
@@ -135,16 +135,16 @@ public:
static void initialize_crypto();
static void finalize_crypto();
static X509CertificateMbedTLS *get_default_certificates();
- static void load_default_certificates(String p_path);
+ static void load_default_certificates(const String &p_path);
static mbedtls_md_type_t md_type_from_hashtype(HashingContext::HashType p_hash_type, int &r_size);
virtual PackedByteArray generate_random_bytes(int p_bytes);
virtual Ref<CryptoKey> generate_rsa(int p_bytes);
- virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after);
- virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key);
- virtual bool verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key);
- virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext);
- virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext);
+ virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, const String &p_issuer_name, const String &p_not_before, const String &p_not_after);
+ virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, Ref<CryptoKey> p_key);
+ virtual bool verify(HashingContext::HashType p_hash_type, const Vector<uint8_t> &p_hash, const Vector<uint8_t> &p_signature, Ref<CryptoKey> p_key);
+ virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_plaintext);
+ virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, const Vector<uint8_t> &p_ciphertext);
CryptoMbedTLS();
~CryptoMbedTLS();