lib/ed25519_keccak/ed25519base.rb
def point_compress(p)
      zinv = modp_inv(p[2])
      x = p[0] * zinv % @@p
      y = p[1] * zinv % @@p
      # OR can be used to set the least significant bit of x to the most significant bit of y
      # because the most significant bit of "y" is always zero
      c = y | ((x & 1) << 255)
      return int_to_bytes(y | ((x & 1) << 255) , 32)
    end
def point_compress(p)
      zinv = modp_inv(p[2])
      x = p[0] * zinv % @@p
      y = p[1] * zinv % @@p
      # OR can be used to set the least significant bit of x to the most significant bit of y
      # because the most significant bit of "y" is always zero
      c = y | ((x & 1) << 255)
      return int_to_bytes(y | ((x & 1) << 255) , 32)
    end
compress element[point] of ed25519 curve

 = Compressed format of Point(x,y) =
 [ y0,y1...y253,y254 | x0 ] ArgumentError ,

 Change the most significant bit of "y" to the least significant bit of "x"
 The most significant bit of "y" is always zero because "0 <= y < 2^255-19"