code: function assertAlgorithms({name, iv, tagLength}){
    if(Object.keys(params.ciphers).indexOf(name) < 0) throw new Error('UnsupportedAlgorithm');
    if(params.ciphers[name].ivLength){
      if(!(iv instanceof Uint8Array)) throw new Error('InvalidArguments');
      if(iv.byteLength < 2 || iv.byteLength > 16) throw new Error('InvalidIVLength');
      if(params.ciphers[name].staticIvLength && (params.ciphers[name].ivLength !== iv.byteLength)) throw new Error('InvalidIVLength');
    }
    if(params.ciphers[name].tagLength && tagLength){
      if(!Number.isInteger(tagLength)) throw new Error('InvalidArguments');
      if(tagLength < 4 || tagLength > 16) throw new Error('InvalidTagLength');
    }
  }
docs: Check if the given algorithm spec is valid.
  @param {String} name - Name of the specified algorithm like 'AES-GCM'.
  @param {Uint8Array} iv - IV byte array if required
  @param {Number} tagLength - Authentication tag length if required
  @throws {Error} - Throws if UnsupportedAlgorithm, InvalidArguments, InvalidIVLength, or InvalidTagLength.