mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-23 03:59:22 +00:00
Allow offsetting FROST keys multiple times
This commit is contained in:
parent
3f02ab3037
commit
dcd909a839
1 changed files with 4 additions and 1 deletions
|
@ -239,7 +239,10 @@ pub struct MultisigKeys<C: Curve> {
|
||||||
impl<C: Curve> MultisigKeys<C> {
|
impl<C: Curve> MultisigKeys<C> {
|
||||||
pub fn offset(&self, offset: C::F) -> MultisigKeys<C> {
|
pub fn offset(&self, offset: C::F) -> MultisigKeys<C> {
|
||||||
let mut res = self.clone();
|
let mut res = self.clone();
|
||||||
res.offset = Some(offset);
|
// Carry any existing offset
|
||||||
|
// Enables schemes like Monero's subaddresses which have a per-subaddress offset and then a
|
||||||
|
// one-time-key offset
|
||||||
|
res.offset = Some(offset + res.offset.unwrap_or(C::F::zero()));
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue