code: function _addBigIntegerToBuffer(buffer, val) {
    var hexVal = val.toString(16);
    // ensure 2s complement +ve
    if(hexVal[0] >= '8') {
      hexVal = '00' + hexVal;
    }
    var bytes = forge.util.hexToBytes(hexVal);
    buffer.putInt32(bytes.length);
    buffer.putBytes(bytes);
  }
docs: Adds len(val) then val to a buffer.
  
  @param buffer the buffer to add to.
  @param val a big integer.