function decryptfinish(filebuf,decryptor,pos) {
		var hdat, hdatcomp, modbyte;
		
		if (pos!==true) {
			modbyte=filebuf.get(1);
			if (modbyte===undefined) return "file corrupted (no modbyte)";
			modbyte=modbyte[0];
			hdat=arrayToString(filebuf.get(-1));
		}
		else 
		{
			pos=filebuf.length-33;
			modbyte=filebuf[pos];
			hdat=arrayToString(filebuf.subarray(pos+1));
		}

		if (!hdat || hdat.length!=32) return "file corrupted (invalid hmac block)";

		hdatcomp=decryptor.hmac.digest().data
		if ( hdat != hdatcomp ) {
			return "hmac does not match. Likely file corruption or tampering.";
		}
		if (modbyte!=0)
			decryptor.decipher.output.data=decryptor.decipher.output.data.slice(
				0,(modbyte-16)
			);
		return "";
	}
// if pos == true, filebuf is uint8array
if pos == true, filebuf is uint8array
if pos == true filebuf is uint8array
function decryptfinish(filebuf,decryptor,pos) {
		var hdat, hdatcomp, modbyte;
		if (pos!==true) {
			modbyte=filebuf.get(1);
			if (modbyte===undefined) return "file corrupted (no modbyte)";
			modbyte=modbyte[0];
			hdat=arrayToString(filebuf.get(-1));
		}
		else 
		{
			pos=filebuf.length-33;
			modbyte=filebuf[pos];
			hdat=arrayToString(filebuf.subarray(pos+1));
		}
		if (!hdat || hdat.length!=32) return "file corrupted (invalid hmac block)";
		hdatcomp=decryptor.hmac.digest().data
		if ( hdat != hdatcomp ) {
			return "hmac does not match. Likely file corruption or tampering.";
		}
		if (modbyte!=0)
			decryptor.decipher.output.data=decryptor.decipher.output.data.slice(
				0,(modbyte-16)
			);
		return "";
	}
function decryptfinish ( filebuf , decryptor , pos ) { var hdat , hdatcomp , modbyte ; if ( pos !== true ) { modbyte = filebuf . get ( 1 ) ; if ( modbyte === undefined ) return "file corrupted (no modbyte)" ; modbyte = modbyte [ 0 ] ; hdat = arrayToString ( filebuf . get ( - 1 ) ) ; } else { pos = filebuf . length - 33 ; modbyte = filebuf [ pos ] ; hdat = arrayToString ( filebuf . subarray ( pos + 1 ) ) ; } if ( ! hdat || hdat . length != 32 ) return "file corrupted (invalid hmac block)" ; hdatcomp = decryptor . hmac . digest ( ) . data if ( hdat != hdatcomp ) { return "hmac does not match. Likely file corruption or tampering." ; } if ( modbyte != 0 ) decryptor . decipher . output . data = decryptor . decipher . output . data . slice ( 0 , ( modbyte - 16 ) ) ; return "" ; }
if pos == true, filebuf is uint8array
if pos == true filebuf is uint8array