-
Notifications
You must be signed in to change notification settings - Fork 12
/
tl.go
121 lines (104 loc) · 1.91 KB
/
tl.go
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package mtproto
import (
"math/big"
)
type TL interface {
encode() []byte
}
type TL_msg_container struct {
items []TL_MT_message
}
type TL_MT_message struct {
msg_id int64
seq_no int32
size int32
data interface{}
}
type TL_req_pq struct {
nonce []byte
}
type TL_p_q_inner_data struct {
pq *big.Int
p *big.Int
q *big.Int
nonce []byte
server_nonce []byte
new_nonce []byte
}
type TL_req_DH_params struct {
nonce []byte
server_nonce []byte
p *big.Int
q *big.Int
fp uint64
encdata []byte
}
type TL_client_DH_inner_data struct {
nonce []byte
server_nonce []byte
retry int64
g_b *big.Int
}
type TL_set_client_DH_params struct {
nonce []byte
server_nonce []byte
encdata []byte
}
type TL_resPQ struct {
nonce []byte
server_nonce []byte
pq *big.Int
fingerprints []int64
}
type TL_server_DH_params_ok struct {
nonce []byte
server_nonce []byte
encrypted_answer []byte
}
type TL_server_DH_inner_data struct {
nonce []byte
server_nonce []byte
g int32
dh_prime *big.Int
g_a *big.Int
server_time int32
}
type TL_new_session_created struct {
first_msg_id int64
unique_id int64
server_salt []byte
}
type TL_bad_server_salt struct {
bad_msg_id int64
bad_msg_seqno int32
error_code int32
new_server_salt []byte
}
type TL_crc_bad_msg_notification struct {
bad_msg_id int64
bad_msg_seqno int32
error_code int32
}
type TL_msgs_ack struct {
msgIds []int64
}
type TL_rpc_result struct {
req_msg_id int64
obj interface{}
}
type TL_rpc_error struct {
error_code int32
error_message string
}
type TL_dh_gen_ok struct {
nonce []byte
server_nonce []byte
new_nonce_hash1 []byte
}
type TL_ping struct {
ping_id int64
}
type TL_pong struct {
msg_id int64
ping_id int64
}