Subversion Repositories Kolibri OS

Rev

Rev 6469 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6469 Rev 6922
Line 80... Line 80...
80
        xor     eax, eax
80
        xor     eax, eax
81
        rep stosd
81
        rep stosd
82
end if
82
end if
Line 83... Line 83...
83
 
83
 
84
        DEBUGF  1, "DH x: "
-
 
85
        stdcall mpint_length, con.dh_x;;;;;;;;;;;;;
84
        DEBUGF  1, "DH x: "
Line 86... Line 85...
86
        stdcall mpint_print, con.dh_x
85
        stdcall mpint_print, con.dh_x
87
 
86
 
88
; Compute e = g^x mod p
-
 
Line 89... Line 87...
89
        stdcall mpint_modexp, con.dh_e, con.dh_g, con.dh_x, con.dh_p
87
; Compute e = g^x mod p
90
        stdcall mpint_length, con.dh_e
88
        stdcall mpint_modexp, con.dh_e, con.dh_g, con.dh_x, con.dh_p
Line 91... Line 89...
91
 
89
 
Line 136... Line 134...
136
        invoke  sha256_update, con.temp_ctx, ssh_gex_req+sizeof.ssh_packet_header-ssh_packet_header.message_code, 12
134
        invoke  sha256_update, con.temp_ctx, ssh_gex_req+sizeof.ssh_packet_header-ssh_packet_header.message_code, 12
Line 137... Line 135...
137
 
135
 
138
;----------------------------
136
;----------------------------
139
; HASH: mpint p, safe prime
137
; HASH: mpint p, safe prime
140
        mov     esi, con.dh_p
138
        mov     esi, con.dh_p
141
        mov     edi, mpint_tmp
139
        mov     edi, con.mpint_tmp
142
        call    mpint_to_big_endian
140
        call    mpint_to_big_endian
143
        lea     edx, [eax+4]
141
        lea     edx, [eax+4]
Line 144... Line 142...
144
        invoke  sha256_update, con.temp_ctx, mpint_tmp, edx
142
        invoke  sha256_update, con.temp_ctx, con.mpint_tmp, edx
145
 
143
 
146
;----------------------------------------
144
;----------------------------------------
147
; HASH: mpint g, generator for subgroup
145
; HASH: mpint g, generator for subgroup
148
        mov     esi, con.dh_g
146
        mov     esi, con.dh_g
149
        mov     edi, mpint_tmp
147
        mov     edi, con.mpint_tmp
150
        call    mpint_to_big_endian
148
        call    mpint_to_big_endian
Line 151... Line 149...
151
        lea     edx, [eax+4]
149
        lea     edx, [eax+4]
152
        invoke  sha256_update, con.temp_ctx, mpint_tmp, edx
150
        invoke  sha256_update, con.temp_ctx, con.mpint_tmp, edx
153
 
151
 
154
;---------------------------------------------------
152
;---------------------------------------------------
Line 181... Line 179...
181
        stdcall mpint_print, con.dh_signature
179
        stdcall mpint_print, con.dh_signature
Line 182... Line 180...
182
 
180
 
183
;--------------------------------------
181
;--------------------------------------
184
; Calculate shared secret K = f^x mod p
182
; Calculate shared secret K = f^x mod p
185
        stdcall mpint_modexp, con.rx_buffer, con.dh_f, con.dh_x, con.dh_p
-
 
Line 186... Line 183...
186
        stdcall mpint_length, con.rx_buffer
183
        stdcall mpint_modexp, con.rx_buffer, con.dh_f, con.dh_x, con.dh_p
187
 
184
 
Line 188... Line 185...
188
        DEBUGF  1, "DH K: "
185
        DEBUGF  1, "DH K: "