1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) Silence Laboratories Pte. Ltd. All Rights Reserved.
// This software is licensed under the Silence Laboratories License Agreement.
use crate::;
use ;
/// Returns a passed error if `msg` is a valid abort message from `party_id`.
///
/// This helper only checks signature/message-shape validity for the
/// provided party key. It does not verify that `msg` belongs to the
/// abort round.
///
/// Callers are expected to pre-filter candidate messages, for example
/// by tracking pending abort IDs:
///
/// ```ignore
/// let abort_round = MessageRound::broadcast(setup, ABORT_MESSAGE_TAG);
/// if abort_round.is_pending(id) {
/// validate_abort_message(setup, msg, party_id, make_error)?;
/// }
/// ```
///
/// Return value handling:
/// - `Err(err(party_id))`: valid signature for `party_id`; treat this as
/// an authenticated abort and stop with that error.
/// - `Ok(())`: signature/message verification failed; when the caller has
/// already matched abort message ID, this means "abort-looking but not
/// authenticated" (e.g. invalid signature), so ignore it and continue.
/// Create an Abort Message.