From d2b553db24bb62f52605651fcd08db03ad1c42fe Mon Sep 17 00:00:00 2001 From: Conrado Gouvea Date: Fri, 5 Jul 2024 13:54:08 -0300 Subject: [PATCH] frost_core: add 'static bound to Ciphersuite trait --- frost-core/CHANGELOG.md | 5 +++++ frost-core/src/traits.rs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frost-core/CHANGELOG.md b/frost-core/CHANGELOG.md index abd9af08..2b89ebb7 100644 --- a/frost-core/CHANGELOG.md +++ b/frost-core/CHANGELOG.md @@ -4,6 +4,11 @@ Entries are listed in reverse chronological order. ## Unreleased +* Added a `'static` bound to the `Ciphersuite` trait. This is a breaking change, + but it's likely to not require any code changes since most ciphersuite + implementations are probably just empty structs. The bound makes it possible + to use `frost_core::Error` in `Box`. + ## 2.0.0-rc.0 * Changed the `deserialize()` function of Elements and structs containing diff --git a/frost-core/src/traits.rs b/frost-core/src/traits.rs index b96f27b0..e9956318 100644 --- a/frost-core/src/traits.rs +++ b/frost-core/src/traits.rs @@ -138,7 +138,8 @@ pub type Element = <::Group as Group>::Element; /// function. /// /// [FROST ciphersuite]: https://www.ietf.org/archive/id/draft-irtf-cfrg-frost-14.html#name-ciphersuites -pub trait Ciphersuite: Copy + Clone + PartialEq + Debug { +// See https://github.com/ZcashFoundation/frost/issues/693 for reasoning about the 'static bound. +pub trait Ciphersuite: Copy + Clone + PartialEq + Debug + 'static { /// The ciphersuite ID string. It should be equal to the contextString in /// the spec. For new ciphersuites, this should be a string that identifies /// the ciphersuite; it's recommended to use a similar format to the