This repository has been archived on 2025-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
Files
shamir-secret-sharing/versions/001/old.cpp
2025-02-10 13:25:07 +00:00

47 lines
898 B
C++

# include<iostream>
# include<string>
# include<random>
# include<cmath>
using namespace std;
int genRandInt(int range_start, int range_end) {
random_device dev;
mt19937 rng(dev());
uniform_int_distribution<mt19937::result_type> dist6(range_start, range_end);
return dist6(rng);
}
int genPolyPoints(int poly_func) {
}
int genPoly(int degree) {
int poly[degree+1];
for (int i = 0; i < degree+1; i++) {
int random_num = genRandInt(1, 99999999999999999);
poly[i] = random_num;
}
return poly;
}
void genSecret(string secret, int shares, int required=shares) {
int poly_degree = required - 1;
int poly_func = genPoly(poly_degree);
int points = genPolyPoints(poly_func)
}
void getShares(int num_shares) {
string shares[num_shares];
cout << "Enter share secret:\n"
cin >> share;
cout << "\n"
}
void encodeSecret(string secret) {
}
int main() {
return 0;
}