We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8535d4 commit 788f951Copy full SHA for 788f951
findmy/accessory.py
@@ -396,7 +396,7 @@ class _AccessoryKeyGenerator(KeyGenerator[KeyPair]):
396
# cache enough keys for an entire week.
397
# every interval'th key is cached.
398
_CACHE_SIZE = 4 * 24 * 7 # 4 keys / hour
399
- _CACHE_INTERVAL = 10
+ _CACHE_INTERVAL = 1 # cache every key
400
401
def __init__(
402
self,
@@ -460,7 +460,7 @@ def _get_sk(self, ind: int) -> bytes:
460
cur_sk = self._sk_cache[cached_ind]
461
462
# compute and update cache
463
- for cur_ind in range(start_ind, ind):
+ for cur_ind in range(start_ind + 1, ind + 1):
464
cur_sk = crypto.x963_kdf(cur_sk, b"update", 32)
465
466
# insert intermediate result into cache and evict oldest entry if necessary
0 commit comments