interplane.Get Omega
Read in your language

omnet

aien-dev/omnet

Brought by drakestapleton

branch main Branches Tags History

omnet / om / tka / test / revocation.om

90 lines · 1242 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note Cross-unit regression: trusted authority removal revokes a direct node signature.
3fn smread d edit uchar 65536 n ulong to ulong
4p = ulong 0
5while lt p n bound 65536
6z = read int 0 d p sub n p
7if le z 0
8ret 1
9end
10p = add p ulong z
11end
12ret 0
13end
14fn smlen to ulong
15b = new uchar 65536 0
16if ne smread b 4 0
17ret 65537
18end
19n = ulong 0
20for i ulong 4
21n = or n shl ulong get b i mul i 8
22end
23ret n
24end
25fn main to int
26a = new uchar 65536 0
27s = new uchar 65536 0
28t = new ulong 131074 0
29m = new ulong 132 0
30node = new uchar 32 0
31keys = new uchar 16384 0
32spans = new ulong 256 0
33if ne tkaselect 0 0
34ret 1
35end
36tkareset
37n = smlen
38if gt n 65536
39ret 2
40end
41if ne smread a n 0
42ret 3
43end
44if ne tkaboot a n 0
45ret 4
46end
47n = smlen
48if gt n 65536
49ret 5
50end
51if ne smread s n 0
52ret 6
53end
54if ne nksdec s n t m 0
55ret 7
56end
57if ne smread a 32 0
58ret 8
59end
60for i ulong 32
61put node i get a i
62end
63count = tkakeys keys
64if gt count 512
65ret 9
66end
67if ne nksauth s t m node keys count 1
68ret 10
69end
70n = smlen
71if gt n 65536
72ret 11
73end
74if ne smread a n 0
75ret 12
76end
77put spans 0 0
78put spans 1 n
79if ne tkainform a spans 1 0
80ret 13
81end
82count = tkakeys keys
83if gt count 512
84ret 14
85end
86if ne nksauth s t m node keys count 0
87ret 15
88end
89ret 0
90end