INNER CODE UNIT · C
tmp
dsprenkels/sss · test_sss.c:13
tmp = sss_combine_shares(restored, (const sss_Share*) shares, 1);
assert(tmp == 0);
assert(memcmp(restored, data, sss_MLEN) == 0);
/* A lot of shares */
sss_create_shares(shares, data, 255, 255);
tmp = sss_combine_shares(restored, (const sss_Share*) shares, 255);
assert(tmp == 0);
assert(memcmp(restored, data, sss_MLEN) == 0);
/* Not enough shares to restore secret */
sss_create_shares(shares, data, 100, 100);
tmp = sss_combine_shares(restored, (const sss_Share*) shares, 99);
assert(tmp == -1);
/* Too many secrets should also restore the secret */
sss_create_shares(shares, data, 200, 100);
tmp = sss_combine_shares(restored, (const sss_Share*) shares, 200);