<commit_before>module Ecc
  class Point
    
    attr_accessor :x, :y
    
    def initialize(curve, x, y)

      if curve.class != Curve
        raise "1st argument type error"
      end
      
      @curve = curve
      @x = x
      @y = y
      
    end

    def to_s
        
      "(#{@x}, #{@y})"
      
    end

    def zero?
      
      @x == 0 and @y == 0
        
    end
    
    def ==(other)
      
      @x == other.x and @y == other.y
      
    end

    def +(other)
      
      u = Point.new(@ecc, self) if u.class != Point
      v = Point.new(@ecc, other) if v.class != Point
       
      return u if v.zero?
      return v if u.zero?
      
      lambda = nil
        
      if u != v
        lambda = ((v.y - u.y) * (((v.x - u.x) ** (@fp - 2)) % @fp)) % @fp
      else
        lambda = ((3 * u.x ** 2 + @a) * (((2 * u.y) ** (@fp - 2)) % @fp)) % @fp
      end
       
      x3 = lambda ** 2 - u.x - v.x
      y3 = lambda * (u.x - x3) - u.y
      Point.new(@ecc, [x3 % @fp, y3 % @fp])

    end

    def *(d)
        
      sum = Point.new(@ecc, self)
      
      (d - 1).times do
        sum = sum + self
      end
      
      sum<commit_msg>UPDATE bug<commit_after>module Ecc
  
  class Point
    
    attr_accessor :x, :y
    
    def initialize(curve, x, y)

      if curve.class != Curve
        raise "1st argument type error: "
      end
      
      @curve = curve
      @x = x
      @y = y
      
    end

    def to_s
        
      "(#{@x}, #{@y})"
      
    end

    def zero?
      
      @x == 0 and @y == 0
        
    end
    
    def ==(other)
      
      @x == other.x and @y == other.y
      
    end

    def +(other)
      
      u = self
      v = other
      
      return u if v.zero?
      return v if u.zero?
      
      t = 0
      
      if u != v
        t = ((v.y - u.y) * (((v.x - u.x) ** (@curve.fp - 2)) % @curve.fp)) % @curve.fp
      else
        t = ((3 * u.x ** 2 + @curve.a) * (((2 * u.y) ** (@curve.fp - 2)) % @curve.fp)) % @curve.fp
      end
       
      x3 = t ** 2 - u.x - v.x
      y3 = t * (u.x - x3) - u.y
      
      Point.new(@curve, x3 % @curve.fp, y3 % @curve.fp)

    end

    def *(d)
        
      sum = self
      
      (d - 1).times do
        sum = sum + self
      end
      
      sum
{'fraction_non_alphanumeric': 0.15360915492957747, 'fraction_numerical': 0.013644366197183098, 'mean_word_length': 1.0061782877316858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6226123', 'n_tokens_mistral': 902, 'n_tokens_neox': 862, 'n_words': 243}