Sha256: b3cd9ecd39f6ebe01b1f0df4b0b199aef6b773a8f8f49089e95feb331a4ece32

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true
module H2C
  module M2C
    # https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-16.html#section-6.6.3
    class SSWUAB0
      attr_reader :sswu, :iso

      # Constructor
      # @param [H2C::M2C::ISOGeny] iso
      # @param [Integer] z
      def initialize(iso, z)
        @sswu = SSWU.new(iso.e0, z)
        @iso = iso
      end

      # https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-16.html#section-6.6.3
      # @param [Integer] u
      # @return [ECDSA::Point]
      def map(u)
        p = sswu.map(u)
        coordinate = iso.map(p.x, p.y)
        iso.e1.new_point(coordinate)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
h2c-0.2.1 lib/h2c/m2c/sswuab0.rb
h2c-0.2.0 lib/h2c/m2c/sswuab0.rb