async function decryptValue (sharedKey, { iv, value }) {
  const decrypted = await window.crypto.subtle.decrypt(
    {
      name: 'AES-GCM',
      iv: fromHex(iv)
    },
    sharedKey,
    fromHex(value)
  )
  const decoded = new TextDecoder().decode(decrypted)
  return JSON.parse(decoded)
}
Decrypt data using AES-GCM
@param {CryptoKey} sharedKey - the key to use for decryption
@param {Object} encryptedValue - the encrypted value as returned by encryptValue
@returns {Promise<Object>} the original unencrypted data