| 148 | } |
| 149 | |
| 150 | void FastPairCrypto::generateValidNonce(uint8_t *nonce) { |
| 151 | uint32_t time_part = millis(); |
| 152 | memcpy(nonce, &time_part, 4); |
| 153 | esp_fill_random(&nonce[4], 4); |
| 154 | |
| 155 | for (int i = 8; i < 16; i++) { |
| 156 | nonce[i] = esp_random() & 0xFF; |
| 157 | if (i == 8) nonce[i] |= 0x80; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | bool FastPairCrypto::looksLikeValidPublicKey(const uint8_t *key, size_t len) { |
| 162 | if (len != 65) return false; |
no test coverage detected