Class: H2C::Suite
- Inherits:
-
Object
- Object
- H2C::Suite
- Defined in:
- lib/h2c/suite.rb
Overview
Hash to curve suites
Constant Summary collapse
- SECP256K1_XMDSHA256_SSWU_NU_ =
"secp256k1_XMD:SHA-256_SSWU_NU_"
- SECP256K1_XMDSHA256_SSWU_RO_ =
"secp256k1_XMD:SHA-256_SSWU_RO_"
Instance Attribute Summary collapse
-
#curve ⇒ Object
readonly
Returns the value of attribute curve.
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#k ⇒ Object
readonly
Returns the value of attribute k.
-
#l ⇒ Object
readonly
Returns the value of attribute l.
-
#m ⇒ Object
readonly
Returns the value of attribute m.
-
#map ⇒ Object
readonly
Returns the value of attribute map.
-
#ro ⇒ Object
readonly
Returns the value of attribute ro.
Instance Method Summary collapse
-
#initialize(id, dst) ⇒ Suite
constructor
Initialize suite.
Constructor Details
#initialize(id, dst) ⇒ Suite
Initialize suite
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/h2c/suite.rb', line 13 def initialize(id, dst) @id = id case id when SECP256K1_XMDSHA256_SSWU_NU_, SECP256K1_XMDSHA256_SSWU_RO_ @curve = ECDSA::Group::Secp256k1 @k = 128 @exp = Expander.get(HashFunc::SHA256, dst, @k) @m = 1 @l = 48 @map = M2C::SSWUAB0.new(H2C::M2C::ISOGeny::Secp256k1.new, -11) @ro = (id == SECP256K1_XMDSHA256_SSWU_RO_) else raise H2C::Error, "suite #{curve} unsupported." end end |
Instance Attribute Details
#curve ⇒ Object (readonly)
Returns the value of attribute curve.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def curve @curve end |
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def exp @exp end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def id @id end |
#k ⇒ Object (readonly)
Returns the value of attribute k.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def k @k end |
#l ⇒ Object (readonly)
Returns the value of attribute l.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def l @l end |
#m ⇒ Object (readonly)
Returns the value of attribute m.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def m @m end |
#map ⇒ Object (readonly)
Returns the value of attribute map.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def map @map end |
#ro ⇒ Object (readonly)
Returns the value of attribute ro.
5 6 7 |
# File 'lib/h2c/suite.rb', line 5 def ro @ro end |