Skip to content

Commit fef6ca4

Browse files
committed
remove single signature basic verify
1 parent 7f0baff commit fef6ca4

File tree

4 files changed

+6
-39
lines changed

4 files changed

+6
-39
lines changed

mithril-stm/src/proof_system/concatenation.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ impl<D: Clone + Digest + FixedOutput + Send + Sync> ConcatenationProof<D> {
4444
})
4545
.collect::<Vec<SingleSignatureWithRegisteredParty>>();
4646

47-
let avk = AggregateVerificationKey::from(&clerk.closed_reg);
48-
let msgp = avk.get_merkle_tree_batch_commitment().concatenate_with_message(msg);
4947
let mut unique_sigs = clerk
50-
.select_valid_signatures_for_k_indices(&msgp, &sig_reg_list)
48+
.select_valid_signatures_for_k_indices(msg, &sig_reg_list)
5149
.with_context(
5250
|| "Failed to aggregate unique signatures during selection for the k indices.",
5351
)?;

mithril-stm/src/protocol/aggregate_signature/clerk.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,17 @@ impl<D: Digest + Clone + FixedOutput + Send + Sync> Clerk<D> {
163163
let mut removal_idx_by_vk: HashMap<&SingleSignatureWithRegisteredParty, Vec<Index>> =
164164
HashMap::new();
165165

166+
let avk = self.compute_aggregate_verification_key();
167+
166168
for sig_reg in sigs.iter() {
167169
if sig_reg
168170
.sig
169-
.basic_verify(
171+
.verify(
170172
&self.params,
171173
&sig_reg.reg_party.0,
172174
&sig_reg.reg_party.1,
175+
&avk,
173176
msg,
174-
&self.closed_reg.total_stake,
175177
)
176178
.is_err()
177179
{

mithril-stm/src/protocol/aggregate_signature/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,8 @@ mod tests {
218218
})
219219
.collect::<Vec<SingleSignatureWithRegisteredParty>>();
220220

221-
let msgp = avk.get_merkle_tree_batch_commitment().concatenate_with_message(&msg);
222221
let dedup_result = clerk.select_valid_signatures_for_k_indices(
223-
&msgp,
222+
&msg,
224223
&sig_reg_list,
225224
);
226225
assert!(dedup_result.is_ok(), "dedup failure {dedup_result:?}");

mithril-stm/src/protocol/single_signature/signature.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -145,38 +145,6 @@ impl SingleSignature {
145145
pub fn cmp_stm_sig(&self, other: &Self) -> Ordering {
146146
Self::compare_signer_index(self, other)
147147
}
148-
149-
/// Verify a basic signature by checking that the lottery was won,
150-
/// the indexes are in the desired range and the underlying multi signature validates.
151-
pub(crate) fn basic_verify(
152-
&self,
153-
params: &Parameters,
154-
pk: &VerificationKey,
155-
stake: &Stake,
156-
msg: &[u8],
157-
total_stake: &Stake,
158-
) -> StmResult<()> {
159-
self.sigma
160-
.verify(msg, pk)
161-
.with_context(|| "Basic verification of single signature failed.")?;
162-
self.check_indices(params, stake, msg, total_stake)
163-
.with_context(|| "Basic verification of single signature failed.")?;
164-
165-
Ok(())
166-
}
167-
168-
/// Will be deprecated. Use `basic_verify` instead.
169-
#[deprecated(since = "0.5.0", note = "Use `basic_verify` instead")]
170-
pub fn core_verify(
171-
&self,
172-
params: &Parameters,
173-
pk: &VerificationKey,
174-
stake: &Stake,
175-
msg: &[u8],
176-
total_stake: &Stake,
177-
) -> StmResult<()> {
178-
Self::basic_verify(self, params, pk, stake, msg, total_stake)
179-
}
180148
}
181149

182150
impl Hash for SingleSignature {

0 commit comments

Comments
 (0)