{"version":3,"sources":["webpack:///./node_modules/matrix-react-sdk/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx","webpack:///./node_modules/matrix-react-sdk/src/utils/MegolmExportEncryption.ts"],"names":["Phase","ExportE2eKeysDialog","React","Component","constructor","props","super","_defineProperty","ev","preventDefault","passphrase","this","state","passphrase1","passphrase2","setState","errStr","_t","startExport","onFinished","phrase","target","value","phase","Edit","componentWillUnmount","unmounted","Promise","resolve","then","matrixClient","exportRoomKeys","k","MegolmExportEncryption","JSON","stringify","f","blob","Blob","type","FileSaver","saveAs","catch","e","logger","error","msg","friendlyText","Exporting","render","disableForm","createElement","BaseDialog","className","title","onSubmit","onPassphraseFormSubmit","Field","label","onChange","onPassphraseChange","autoFocus","size","disabled","onClick","onCancelClick","subtleCrypto","window","crypto","subtle","webkitSubtle","friendlyError","message","cryptoFailMsg","async","decryptMegolmKeyFile","data","password","body","fileStr","TextDecoder","decode","Uint8Array","lineStart","lineEnd","indexOf","Error","line","slice","trim","HEADER_LINE","dataStart","undefined","TRAILER_LINE","dataEnd","base64","latin1String","atob","uint8Array","length","i","charCodeAt","decodeBase64","unpackMegolmKeyFile","brand","SdkConfig","get","ciphertextLength","salt","subarray","iv","iterations","ciphertext","hmac","aesKey","hmacKey","deriveKeys","toVerify","isValid","plaintext","verify","name","decrypt","counter","encryptMegolmKeyFile","options","kdfRounds","kdf_rounds","getRandomValues","encodedData","TextEncoder","encode","encrypt","cipherArray","bodyLength","resultBuffer","idx","set","toSign","sign","hmacArray","LINE_LENGTH","nLines","Math","ceil","lines","Array","o","encodeBase64","join","buffer","packMegolmKeyFile","start","Date","key","keybits","importKey","deriveBits","hash","now","log","getTime","aesProm","hmacProm","all","String","fromCharCode","apply","from","btoa"],"mappings":"8IA4BKA,E,iGAAK,SAALA,KAAK,YAALA,EAAK,uBAALA,MAAK,KAmBK,MAAMC,UAA4BC,IAAMC,UAG5CC,YAAYC,GACfC,MAAMD,GAAOE,IAAA,kBAHG,GAAKA,IAAA,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