+# RTMP handshake
+
 crypto = require 'crypto'
 
 MESSAGE_FORMAT_1 = 1

  generateS1 messageFormat, dh, (err, s1Bytes) ->
    generateS2 messageFormat, clientsig, (err, s2Bytes, keys) ->
      allBytes = Buffer.concat [
        new Buffer([ clientType ]),  # version
        s1Bytes,
        s2Bytes
      ], 3073
      keys.dh = dh
      callback null, allBytes, keys

GenuineFMSConst = "Genuine Adobe Flash Media Server 001"
GenuineFMSConstCrud = Buffer.concat [new Buffer(GenuineFMSConst, "utf8"), RandomCrud]

GenuineFPConst  = "Genuine Adobe Flash Player 001"
GenuineFPConstCrud = Buffer.concat [new Buffer(GenuineFPConst, "utf8"), RandomCrud]

GetClientGenuineConstDigestOffset = (buf) ->
