From bea1e38c674485d5df6a4266f9bb54e46d39d9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 21 May 2018 15:40:29 +0200 Subject: Move ECCSignature to Common::ec and give it a less confusing name --- Source/Core/Common/Crypto/ec.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/Common/Crypto/ec.cpp') diff --git a/Source/Core/Common/Crypto/ec.cpp b/Source/Core/Common/Crypto/ec.cpp index b9a0ca6491..9a57300f89 100644 --- a/Source/Core/Common/Crypto/ec.cpp +++ b/Source/Core/Common/Crypto/ec.cpp @@ -241,7 +241,7 @@ static void silly_random(u8* rndArea, u8 count) } } -std::array Sign(const u8* key, const u8* hash) +Signature Sign(const u8* key, const u8* hash) { u8 e[30]{}; memcpy(e + 10, hash, 20); @@ -272,7 +272,7 @@ std::array Sign(const u8* key, const u8* hash) bn_inv(minv, m, ec_N, sizeof(minv)); bn_mul(s.data.data(), minv, kk, ec_N, 30); - std::array signature; + Signature signature; std::copy(r.data.cbegin(), r.data.cend(), signature.begin()); std::copy(s.data.cbegin(), s.data.cend(), signature.begin() + 30); return signature; @@ -300,10 +300,10 @@ bool VerifySignature(const u8* public_key, const u8* signature, const u8* hash) return (bn_compare(rx.data(), R, 30) == 0); } -std::array PrivToPub(const u8* key) +PublicKey PrivToPub(const u8* key) { const Point data = key * ec_G; - std::array result; + PublicKey result; std::copy_n(data.Data(), result.size(), result.begin()); return result; } -- cgit v1.2.3