Skip to content

Commit

Permalink
Merge pull request #78 from multiparty/feat/optimize_shamirs
Browse files Browse the repository at this point in the history
refactor: reduce number of shares generated to improve performance
  • Loading branch information
ch3njust1n authored May 1, 2023
2 parents 551a538 + 9fe1b1a commit bd4f0e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const HomePage: FC = () => {
const [file, setFile] = useState<CustomFile | null>(null);
const [data, setData] = useState<DataFormat>(defaultData);
const [submitResp, setSubmitResp] = useState<AxiosResponse | undefined>();
const [numShares, setNumShares] = useState<number>(10);
const [threshold, setTheshold] = useState<number>(5); // Must have at least 5 shares to reconstruct
const [numShares, setNumShares] = useState<number>(3);
const [threshold, setTheshold] = useState<number>(1); // Must have at least 1 share to reconstruct
const [numEncryptWithKey, setNumEncryptWithKey] = useState<number>(threshold + 1); // Encrypt amount "theshold + 1" shares with key
const [table, setTable] = useState<Record<string, any>>({});
const { companySize, industry, participantCode, sessionId, privateKey } = useSelector((state: AppState) => state.session);
Expand Down
2 changes: 0 additions & 2 deletions client/src/utils/shamirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ export async function tableToSecretShares(
): Promise<Record<string, any>> {
const dfs = async (currentObj: Record<string, any>, originalObj: Record<string, any>): Promise<Record<string, any>> => {
const keys = Object.keys(originalObj);
const encoder = new TextEncoder();

for (const key of keys) {
if (typeof originalObj[key] === 'number') {
Expand Down Expand Up @@ -289,7 +288,6 @@ export async function secretSharesToTable(
}
const dfs = async (currentObj: Record<string, any>, originalObj: Record<string, any>): Promise<Record<string, any>> => {
const keys = Object.keys(originalObj);
const encoder = new TextEncoder();

for (const key of keys) {
if (Array.isArray(originalObj[key])) {
Expand Down

0 comments on commit bd4f0e3

Please sign in to comment.