# Collective Attestation for Manageable IoT Environments
## 4 Design
### Attestation Phase
#### 4.3.2 Attestation  
Upon receiving the request message, every device starts the attestation process on its own. (Algorithm A1 in Appendix A shows the pseudo code of a device for the attestation process.) After the request propagation, each prover device generates its own measurement and waits for all the results from its children in the attestation tree. In this process, every \(|S|\)-level subtree of the attestation tree is abstracted as a region. The measurement values of the provers in a region are aggregated as a region summary. Figure 3 shows the attestation tree and regions. **Region. ** The attestation tree is divided into regions. In order to spot the erroneous region effectively, each region has a distinguishable result. Namely, the aggregation of a region summary is limited to  
Figure 3: Attestation tree and regions. the members of the same region. Every non-leaf device aggregates the attestation result from all the valid children unless the device is a region anchor. It then reports the result back to the parent of the attestation tree. A region anchor is automatically selected. The maximum region depth, \(|S|\), is delivered by the request message. The leaf devices in the attestation tree set its region depth as \(|S|\) (i.e., \(\mathbb{H}=|S|\)). The region depth decreases by one at every hop in reporting. If the computed \(\mathbb{H}\) reaches zero from any of the responses, the device is selected as the region anchor. The region anchor sends the aggregated result as a region summary to the root of attestation tree, and then it starts a new region by reporting its own measurement result like a leaf device. **Measurement. ** A device, \(D_{i}\), generates the measurement, which is the proof of the device integrity, by computing a checksum on all the program code and the system states. Since the component tags are embedded in the program code, the checksum result of \(D_{i}\) should be the same as \(\mathbb{B}_{i}\). Thus, the newly computed \(\mathbb{B}_{i}\) is used as the measurement result for \(D_{i}\). **Positioning. ** If the network operator or verifier can rapidly localize a region, the following maintenance can be performed more painlessly. For the purpose, a device with positioning facilities (e.g., Global Positioning System module or predefined positioning anchor) may include the position information \(\mathbb{P}\) to the measurement result. If the network operator or verifier does not have preknowledge on the position of devices, then the piggybacked position information can facilitate the identification of regions. **Result. ** The attestation result of \(D_{i}\) is a tuple of:  
\[(\mathbb{B}_{i},\Sigma_{i},\mathbb{H}_{i},\alpha_{i},\beta_{i},\mathbb{P}_{i},\texttt{mac}(K_{ij},N||\mathbb{B}_{i}||\Sigma_{i}||\mathbb{H}_{i}||\alpha_{i }||\beta_{i}||\mathbb{P}_{i})),\]  
where the \(\alpha_{i}\), and \(\beta_{i}\) are the number of good provers (devices) and bad provers in the descendants of \(D_{i}\), which is initially zero for the leaf provers, and mac represents a Message Authentication Code (MAC) operation. \(\Sigma_{i}\) is a working summary that contains the aggregated results so far, which is also initially empty for the leaf provers. \(\mathbb{H}\) is the depth in the region tree. The device sends the attestation results to its parent of the attestation tree. **Aggregation and local decision. ** A prover device aggregates the results of children devices into a single result. If it is not a region anchor, it merges the result to its own attestation result. When the prover device receives a response, the local decision process is performed. It first validates the value of \(\texttt{mac}(\cdot)\) with \(K_{ij}\) and \(N\), and then checks whether the received tag \(\mathbb{B}\) is the same as the registered value. If all the conditions are satisfied, the device is treated as a good prover. Otherwise, it is handled as a bad prover. For the attestation request, we have two options to build a region summary on the local decision: positive and negative indications.