class String

Public Instance Methods

rb25519_clamp() click to toggle source
# File lib/rb-pure25519.rb, line 53
def rb25519_clamp
  bytes = self.each_byte.to_a
  bytes[0] &= 248;
  bytes[31] &= 127;
  bytes[31] |= 64;

  return bytes.pack('c*')
end
to_binary() click to toggle source

Convert to a binary fixed size; LSB first

# File lib/rb-pure25519.rb, line 46
def to_binary
  v = 0
  self.reverse.each_byte do |byte| 
    v = (v << 8) | byte
  end
  v
end