SpinResearch / rustysecrets-cli

🔑 Command-line wrapper around RustySecrets, a Rust implementation of threshold Shamir's secret sharing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow customizing the shares names

romac opened this issue · comments

Do you have any ideas for how to specify this ? E.g. Expliciting all of them to a file, giving a pattern to follow, define a convention, ...

I was thinking of letting the user supply a template such as:

--share-tmpl='share_{{index}}'

or something alike.

What do you think?

Templates are always tricky imho : all of the sudden we need to parse ordination styles and encodings etc etc. Maybe just a list of share names makes it simpler for us yet allows the user to have that flexibility (e.g. a csv with "share_romac, share_dylan, share_xyz" which would be used as the share names). By default the current convention is good enough i think

I think it can be as simple as

for (index, share) in shares.enumerate() {
  let share_name = share_tmpl.replace("{{index}}", index);
  // ...
}

but maybe I'm missing something (also I'm not sure what you mean by "we need to parse ordination styles and encodings").

@dtsbourg Feel free to take a look at #13 and let me know what you think.