code: function transformIV(iv) {
    if(typeof iv === 'string') {
      // convert iv string into byte buffer
      iv = forge.util.createBuffer(iv);
    }
  
    if(forge.util.isArray(iv) && iv.length > 4) {
      // convert iv byte array into byte buffer
      var tmp = iv;
      iv = forge.util.createBuffer();
      for(var i = 0; i < tmp.length; ++i) {
        iv.putByte(tmp[i]);
      }
    }
    if(!forge.util.isArray(iv)) {
      // convert iv byte buffer into 32-bit integer array
      iv = [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()];
    }
  
    return iv;
  }
docs: Utility functions