|
|
Algorithm 2 Dissemination of the code update, including the Data Verification (DV) and Hash Verification (HV) Methods). |
|
| 1: |
Base Station: |
| 2: |
|
| 3: |
T ⇐ (p, a, b, G, n, h) elliptic curve domain parameters
|
| 4: |
dS ⇐ random integer number (1 < dS < n − 1) |
| 5: |
N0 ⇐ 160–bit random number |
| 6: |
QS ⇐ dSG
|
| 7: |
Vn ⇐ Version number
|
| 8: |
Sign Vn, I, N0, QS using GKPri
|
| 9: |
Send SignGKPri({Vn, I, N0, QS}) to node |
| 10: |
Node: |
| 11: |
(I, Vn, N0, QS) ⇐ VerifyGKpub (SignGKPri({Vn, I, N0, QS})) |
| 12: |
if
Vn ≤ previous Vn
then
|
| 13: |
Notify BS of an ongoing replay attack. |
| 14: |
Halt dissemination protocol for a pre-configured time. |
| 15: |
Exit |
| 16: |
end if |
| 17: |
previous Vn ⇐ Vn
|
| 18: |
dN ⇐ random integer number (1 < dN < n − 1) |
| 19: |
QN ⇐ dNG
|
| 20: |
SK ⇐ H80(dNQS) |
| 21: |
Free memory reserved by dN, QS
|
| 22: |
N1 ⇐ 160 – bit random number
|
| 23: |
Execute Algorithm 3 (Input: N1) {Optional} |
| 24: |
Send
to BS |
| 25: |
Base Station: |
| 26: |
|
| 27: |
SK ⇐ H80(dSQN) |
| 28: |
MSG ⇐ Pkt[0] ⨁ N0 {Pkt[0] = QN} |
| 29: |
generated
|
| 30: |
if
generated MAC <> Pkt[2] then
|
| 31: |
Exit. |
| 32: |
end if |
| 33: |
|
| 34: |
Execute Algorithm 3(Input: N1) {Optional}
|
| 35: |
Encrypt update image with SK
|
| 36: |
Fragment encrypted data as shown in Figure 4
|
| 37: |
for all
Pkt0,i in Page0 do
|
| 38: |
Send
to the node |
| 39: |
end for |
| 40: |
Node: |
| 41: |
Free memory reserved by QN
|
| 42: |
while Receives
do
|
| 43: |
new MAC ⇐ calculate MAC of encrypted Pkt0,i
|
| 44: |
if
new
then
|
| 45: |
Drop packet |
| 46: |
end if
|
| 47: |
|
| 48: |
Store Pkt0,i
|
| 49: |
end while |
|