Sha256: 3b769b7bf4f792d4e19bd74320ce6c8c983e7d3df8faba7f028a8af0ee6519d3

Contents?: true

Size: 945 Bytes

Versions: 5

Compression:

Stored size: 945 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/test_helper')

class ClientTest < Test::Unit::TestCase

  def setup
    @login = "testuser"
    @password = "password"
  end

  def test_calculation_of_private_key
    @client = SRP::Client.new(@login, @password, "7686acb8".hex)
    assert_equal "84d6bb567ddf584b1d8c8728289644d45dbfbb02deedd05c0f64db96740f0398",
      "%x" % @client.send(:private_key)
  end

  # using python srp:
  # s,V = pysrp.create_salted_verification_key("testuser", "password", pysrp.SHA256, pysrp.NG_1024)

  def test_verifier
    @client = SRP::Client.new(@login, @password, '4c78c3f8'.hex)
    v = '474c26aa42d11f20544a00f7bf9711c4b5cf7aab95ed448df82b95521b96668e7480b16efce81c861870302560ddf6604c67df54f1d04b99d5bb9d0f02c6051ada5dc9d594f0d4314e12f876cfca3dcd99fc9c98c2e6a5e04298b11061fb8549a22cde0564e91514080df79bca1c38c682214d65d590f66b3719f954b078b83c'
    assert_equal v, "%x" % @client.verifier
  end
end



Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby-srp-0.1.4 test/client_test.rb
ruby-srp-0.1.3 test/client_test.rb
ruby-srp-0.1.2 test/client_test.rb
ruby-srp-0.1.1 test/client_test.rb
ruby-srp-0.1.0 test/client_test.rb