Ejemplo n.º 1
0
def G(x, y, z, r):
    """
  md5 G 'macro'
  x, y, z, r should be registers that are scalars
  puts result in r
  """
    # return (x & z) | (y & ~z)
    global xcode
    temp = xcode.acquire_register()
    cal.iand(r, x, z)  # x & z
    cal.inot(temp, z)  # temp = ~z
    cal.iand(temp, y, temp)  # temp = y & ~z
    cal.ior(r, r, temp)
    xcode.release_register(temp)
Ejemplo n.º 2
0
def G(x, y, z, r):
  """
  md5 G 'macro'
  x, y, z, r should be registers that are scalars
  puts result in r
  """
  # return (x & z) | (y & ~z)
  global xcode
  temp = xcode.acquire_register()
  cal.iand(r, x, z)       # x & z
  cal.inot(temp, z)       # temp = ~z
  cal.iand(temp, y, temp) # temp = y & ~z
  cal.ior(r, r, temp)
  xcode.release_register(temp)
Ejemplo n.º 3
0
def F(x, y, z, r):
    """
  md5 F 'macro'
  x, y, z, r should be registers that are scalars
  puts result in r
  """
    # return (x & y) | (~x & z)
    global xcode
    temp = xcode.acquire_register()
    cal.iand(r, x, y)  #  x & y
    cal.inot(temp, x)  # temp = ~x
    cal.iand(temp, temp, z)  # temp = (~x) & z
    cal.ior(r, r, temp)
    xcode.release_register(temp)
Ejemplo n.º 4
0
def F(x, y, z, r):
  """
  md5 F 'macro'
  x, y, z, r should be registers that are scalars
  puts result in r
  """
  # return (x & y) | (~x & z)
  global xcode
  temp = xcode.acquire_register()
  cal.iand(r, x, y)       #  x & y
  cal.inot(temp, x)       # temp = ~x
  cal.iand(temp, temp, z) # temp = (~x) & z
  cal.ior(r, r, temp)
  xcode.release_register(temp)