• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

oasisprotocol / oasis-core / #5141

24 Jul 2024 09:54AM UTC coverage: 45.22% (-0.3%) from 45.494%
#5141

Pull #5784

peternose
keymanager/src/churp: Serve key shares to lagging clients
Pull Request #5784: keymanager/src/churp: Serve key shares to lagging clients

2 of 367 new or added lines in 4 files covered. (0.54%)

19 existing lines in 1 file now uncovered.

3983 of 8808 relevant lines covered (45.22%)

1.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/keymanager/src/churp/methods.rs
1
//! CHURP methods exported to remote clients via enclave RPC.
2
use oasis_core_runtime::enclave_rpc::{
3
    dispatcher::{
4
        Handler as RpcHandler, Method as RpcMethod, MethodDescriptor as RpcMethodDescriptor,
5
    },
6
    types::Kind as RpcKind,
7
};
8

9
use crate::churp::{Churp, Handler};
10

11
/// Name of the `apply` method.
12
pub const METHOD_APPLY: &str = "churp/apply";
13
/// Name of the `share_reduction` method.
14
pub const METHOD_SHARE_REDUCTION: &str = "churp/share_reduction";
15
/// Name of the `share_distribution` method.
16
pub const METHOD_SHARE_DISTRIBUTION: &str = "churp/share_distribution";
17
/// Name of the `proactivization` method.
18
pub const METHOD_PROACTIVIZATION: &str = "churp/proactivization";
19
/// Name of the `confirm` method.
20
pub const METHOD_CONFIRM: &str = "churp/confirm";
21
/// Name of the `finalize` method.
22
pub const METHOD_FINALIZE: &str = "churp/finalize";
23
/// Name of the `verification_matrix` method.
24
pub const METHOD_VERIFICATION_MATRIX: &str = "churp/verification_matrix";
25
/// Name of the `share_reduction_point` method.
26
pub const METHOD_SHARE_REDUCTION_POINT: &str = "churp/share_reduction_point";
27
/// Name of the `share_distribution_point` method.
28
pub const METHOD_SHARE_DISTRIBUTION_POINT: &str = "churp/share_distribution_point";
29
/// Name of the `bivariate_share` method.
30
pub const METHOD_BIVARIATE_SHARE: &str = "churp/bivariate_share";
31
/// Name of the `sgx_policy_key_share` method.
32
pub const METHOD_SGX_POLICY_KEY_SHARE: &str = "churp/sgx_policy_key_share";
33

34
impl RpcHandler for Churp {
35
    fn methods(&'static self) -> Vec<RpcMethod> {
×
36
        vec![
×
37
            /* Insecure queries */
38
            RpcMethod::new(
×
39
                RpcMethodDescriptor {
×
40
                    name: METHOD_VERIFICATION_MATRIX.to_string(),
×
41
                    kind: RpcKind::InsecureQuery,
×
42
                },
43
                move |_ctx: &_, req: &_| self.verification_matrix(req),
×
44
            ),
45
            /* Noise sessions */
46
            RpcMethod::new(
×
47
                RpcMethodDescriptor {
×
48
                    name: METHOD_SHARE_REDUCTION_POINT.to_string(),
×
49
                    kind: RpcKind::NoiseSession,
×
50
                },
51
                move |ctx: &_, req: &_| self.share_reduction_switch_point(ctx, req),
×
52
            ),
53
            RpcMethod::new(
×
54
                RpcMethodDescriptor {
×
55
                    name: METHOD_SHARE_DISTRIBUTION_POINT.to_string(),
×
56
                    kind: RpcKind::NoiseSession,
×
57
                },
58
                move |ctx: &_, req: &_| self.share_distribution_switch_point(ctx, req),
×
59
            ),
60
            RpcMethod::new(
×
61
                RpcMethodDescriptor {
×
62
                    name: METHOD_BIVARIATE_SHARE.to_string(),
×
63
                    kind: RpcKind::NoiseSession,
×
64
                },
65
                move |ctx: &_, req: &_| self.bivariate_share(ctx, req),
×
66
            ),
67
            RpcMethod::new(
×
68
                RpcMethodDescriptor {
×
69
                    name: METHOD_SGX_POLICY_KEY_SHARE.to_string(),
×
70
                    kind: RpcKind::NoiseSession,
×
71
                },
72
                move |ctx: &_, req: &_| self.sgx_policy_key_share(ctx, req),
×
73
            ),
74
            /* Local queries */
75
            RpcMethod::new(
×
76
                RpcMethodDescriptor {
×
NEW
77
                    name: METHOD_APPLY.to_string(),
×
78
                    kind: RpcKind::LocalQuery,
×
79
                },
NEW
80
                move |_ctx: &_, req: &_| self.apply(req),
×
81
            ),
82
            RpcMethod::new(
×
83
                RpcMethodDescriptor {
×
84
                    name: METHOD_SHARE_REDUCTION.to_string(),
×
85
                    kind: RpcKind::LocalQuery,
×
86
                },
87
                move |_ctx: &_, req: &_| self.share_reduction(req),
×
88
            ),
89
            RpcMethod::new(
×
90
                RpcMethodDescriptor {
×
91
                    name: METHOD_SHARE_DISTRIBUTION.to_string(),
×
92
                    kind: RpcKind::LocalQuery,
×
93
                },
94
                move |_ctx: &_, req: &_| self.share_distribution(req),
×
95
            ),
96
            RpcMethod::new(
×
97
                RpcMethodDescriptor {
×
98
                    name: METHOD_PROACTIVIZATION.to_string(),
×
99
                    kind: RpcKind::LocalQuery,
×
100
                },
101
                move |_ctx: &_, req: &_| self.proactivization(req),
×
102
            ),
103
            RpcMethod::new(
×
104
                RpcMethodDescriptor {
×
105
                    name: METHOD_CONFIRM.to_string(),
×
106
                    kind: RpcKind::LocalQuery,
×
107
                },
108
                move |_ctx: &_, req: &_| self.confirmation(req),
×
109
            ),
110
            RpcMethod::new(
×
111
                RpcMethodDescriptor {
×
112
                    name: METHOD_FINALIZE.to_string(),
×
113
                    kind: RpcKind::LocalQuery,
×
114
                },
115
                move |_ctx: &_, req: &_| self.finalize(req),
×
116
            ),
117
        ]
118
    }
119
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc