Note values should be little-endian byte order.

This commit is contained in:
Sean Bowe
2016-05-12 13:19:13 -06:00
parent 032164d5d5
commit 81469bbb83
8 changed files with 129 additions and 10 deletions

View File

@@ -1,11 +1,12 @@
#include "Note.hpp"
#include "prf.h"
#include "crypto/sha256.h"
#include "zerocash/utils/util.h"
#include "version.h"
#include "streams.h"
#include "zcash/util.h"
namespace libzcash {
Note::Note() {
@@ -22,8 +23,7 @@ uint256 Note::cm() const {
hasher.Write(&discriminant, 1);
hasher.Write(a_pk.begin(), 32);
std::vector<unsigned char> value_vec(sizeof(value), 0);
libzerocash::convertIntToBytesVector(value, value_vec);
auto value_vec = convertIntToVectorLE(value);
hasher.Write(&value_vec[0], value_vec.size());
hasher.Write(rho.begin(), 32);