wownero-seed/include/wownero_seed/wownero_seed.hpp

44 lines
1.0 KiB
C++
Raw Permalink Normal View History

2020-06-13 19:00:39 +00:00
/*
Copyright (c) 2020 tevador <tevador@gmail.com>
All rights reserved.
*/
#pragma once
#include <string>
#include <array>
#include <cstdint>
#include <iostream>
#include <ctime>
#include "gf_poly.hpp"
2022-05-20 15:25:47 +00:00
class wownero_seed {
2020-06-13 19:00:39 +00:00
public:
static const std::string erasure;
static constexpr size_t size = 16;
static constexpr size_t key_size = 32;
using secret_key = std::array<uint8_t, key_size>;
using secret_seed = std::array<uint8_t, size>;
2022-05-20 15:25:47 +00:00
wownero_seed(const std::string& phrase, const std::string& coin);
wownero_seed(std::time_t date_created, const std::string& coin);
2020-06-13 19:00:39 +00:00
std::time_t date() const {
return date_;
}
unsigned blockheight() const;
2020-06-13 19:00:39 +00:00
const std::string& correction() const {
return correction_;
}
const secret_key& key() const {
return key_;
}
2022-05-20 15:25:47 +00:00
friend std::ostream& operator<<(std::ostream& os, const wownero_seed& seed);
2020-06-13 19:00:39 +00:00
private:
secret_seed seed_;
secret_key key_;
std::time_t date_;
unsigned reserved_;
std::string correction_;
gf_poly message_;
};
2022-05-20 15:25:47 +00:00
std::ostream& operator<<(std::ostream& os, const wownero_seed::secret_key& key);