ZcashFoundation / frost

Rust implementation of FROST (Flexible Round-Optimised Schnorr Threshold signatures) by the Zcash Foundation
https://frost.zfnd.org
Other
136 stars 50 forks source link

Change IdentifierList::Custom to take a Vec and not a slice #653

Closed conradoplg closed 3 months ago

conradoplg commented 4 months ago

Since a slice is a reference it can be annoying to keep IdentifierLists in memory since callers will need to keep the original list around for as long the IdentifierList is needed.

I'm not 100% sure this is a best approach (if the list is big, it may require the caller to make a clone of it) but it seems to make more sense.

We should also review the API for similar usages.

Note that this is different to a e.g. function that takes a slice/reference but does not keep it around. In that case it's better to use slices/references since the caller can decide what to pass to it.

conradoplg commented 3 months ago

I'm inclined to not do this, the caller can always hang around to a Vec<Identifier> and pass IdentifierList::Custom(&v) to it