aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ringct/rctOps.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp
index 7182861cf..239168388 100644
--- a/src/ringct/rctOps.cpp
+++ b/src/ringct/rctOps.cpp
@@ -368,15 +368,8 @@ namespace rct {
//This takes the outputs and commitments
//and hashes them into a 32 byte sized key
key cn_fast_hash(const ctkeyV &PC) {
- key rv = identity();
- std::size_t l = (std::size_t)PC.size();
- size_t i = 0, j = 0;
- vector<char> m(l * 64);
- for (i = 0 ; i < l ; i++) {
- memcpy(&m[i * 64], &PC[i].dest, 32);
- memcpy(&m[i * 64 + 32], &PC[i].mask, 32);
- }
- cn_fast_hash(rv, &m[0], 64*l);
+ key rv;
+ cn_fast_hash(rv, &PC[0], 64*PC.size());
return rv;
}
@@ -391,14 +384,8 @@ namespace rct {
//put them in the key vector and it concatenates them
//and then hashes them
key cn_fast_hash(const keyV &keys) {
- size_t l = keys.size();
- vector<unsigned char> m(l * 32);
- size_t i;
- for (i = 0 ; i < l ; i++) {
- memcpy(&m[i * 32], keys[i].bytes, 32);
- }
key rv;
- cn_fast_hash(rv, &m[0], 32 * l);
+ cn_fast_hash(rv, &keys[0], keys.size() * sizeof(keys[0]));
//dp(rv);
return rv;
}