not used either so that if the subnet prefix of the address changes but the host's public key does not, then the same modifier could be reused and there is no need to search for a new Hash2. On line 41 the CGA is returned, along with the CGA Parameters data structure. CGA verification method A Cryptographically Generated Address is used to verify that received signed messages were sent by the host to which that address has been assigned. This is done by verifying that the key pair used for signing has been bound to the CGA. Because the authenticity of the public key can be verified this way, there is no need for a public key infrastructure. If the host itself is required to be authenticated as well, however, then the CGA itself needs to be authenticated beforehand since the bound public key cannot be trusted if the address is not trusted in such a case (assuming it has not been verified by other methods than CGA). The CGA verification method, in which a public key is verified to be bound to a CGA, requires the corresponding CGA Parameters data structure as input and can be implemented as follows. 1 procedure verifyCGA(CGA, [modifier, subnetPrefix, collCount, publicKey, extFields]): 2 if collCount > 2 or CGA[0:8] ≠ subnetPrefix: 3 return false 4 end if 5 6 concat := concatenate(modifier, subnetPrefix, collCount, 7 publicKey, extFields) 8 9 digest := SHA1(concat) 10 Hash1 := digest[0:8] // 8*8 = 64 leftmost bits 11 Hash1[0] := Hash1[0] binary and 0x1c // ignore Sec and u/g bits 12 13 intID := CGA[8:16] // interface identifier (64 rightmost bits) 14 intID[0] := intID[0] binary and 0x1c // ignore Sec and u/g bits 15 16 if Hash1 ≠ intID: 17 return false 18 end if 19 20 Sec := CGA[8] >> 5 // extract Sec from interface identifier 21 22 concat := concatenate(modifier, 0x000000000000000000, // 9 zero octets 23 publicKey, extFields) 24 25 digest := SHA1(concat) 26 Hash2 := digest[0:14] // 14*8 = 112 leftmost bits 27 28 if Sec ≠ 0 and Hash2[0:2*Sec] ≠ 0: // 2*Sec*8 = 16*Sec leftmost bits 29 return false 30 end if 31 32 return true // verification succeeded 33 end procedure The method starts with checking if collCount from the CGA Parameters data structure has a valid value and if subnetPrefix from the same data structure matches the CGA's subnet prefix