verifyMessage = async (signature, publicKey, data) => {
  const verifiedCache = await verifiedCachePromise
  const cached = await verifiedCache.get(signature)

  let res = false

  if (!cached) {
    const verified = await verifySignature(signature, publicKey, data)
    res = verified
    if (verified) {
      await verifiedCache.put(signature, { publicKey, data })
    }
  } else {
    const compare = (cached, data) => {
      const match = data instanceof Uint8Array ? uint8ArrayCompare(cached, data) === 0 : cached.toString() === data.toString()
      return match
    }
    res = cached.publicKey === publicKey && compare(cached.data, data)
  }
  return res
}
Verifies input data against a cached version of the signed message.
@param {string} signature The generated signature.
@param {string} publicKey The derived public key of the key pair.
@param {string} data The data to be verified.
@return {boolean} True if the the data and cache match, false otherwise.
@static
@private