class SPAKE2Plus::Algorithms

Defined in:

spake2_plus/algorithms.cr

Constant Summary

GRAPH = {Curve::P256 => {name: "P-256", hash: [OpenSSL::Algorithm::SHA256, OpenSSL::Algorithm::SHA512], m: "02886e2f97ace46e55ba9dd7242579f2993b64e16ef3dcab95afd497333d8fa12f", n: "03d8bbd6c639c62937b04d997f38c3770719c629d7014d49a24b4f98baa1292b49", ws_length: (256 // 8) + 8}, Curve::P384 => {name: "P-384", hash: [OpenSSL::Algorithm::SHA256, OpenSSL::Algorithm::SHA512], m: "030ff0895ae5ebf6187080a82d82b42e2765e3b2f8749c7e05eba366434b363d3dc36f15314739074d2eb8613fceec2853", n: "02c72cf2e390853a1c1c4ad816a62fd15824f56078918f43f922ca21518f9c543bb252c5490214cf9aa3f0baab4b665c10", ws_length: (384 // 8) + 8}, Curve::P521 => {name: "P-521", hash: [OpenSSL::Algorithm::SHA512], m: "02003f06f38131b2ba2600791e82488e8d20ab889af753a41806c5db18d37d85608cfae06b82e4a72cd744c719193562a653ea1f119eef9356907edc9b56979962d7aa", n: "0200c7924b9ec017f3094562894336a53c50167ba8c5963876880542bc669e494b2532d76c5b53dfb349fdf69154b9e0048c58a42e8ed04cef052a3bc349d95575cd25", ws_length: (521 // 8) + 8}, Curve::Edwards25519 => {name: "edwards25519", hash: [OpenSSL::Algorithm::SHA256], m: "d048032c6ea0b6d697ddc2e86bda85a33adac920f1bf18e1b0c6d166a5cecdaf", n: "d3bfb518f44f3430f29d0c92af503865a1ed3281dc69b35dd868ba85f886c4ab", ws_length: (255 // 8) + 8}}

Constructors

Instance Method Summary

Constructor Detail

def self.new(curve_name : Curve, hash_algorithm : OpenSSL::Algorithm | Nil = nil, mac_algorithm : MAC = MAC::HMAC) #

[View source]

Instance Method Detail

def compute_w0_l(pw : String | Bytes, salt : String | Bytes, iterations : Int) : Tuple(BigInt, Bytes) #

[View source]
def compute_w0_w1(pw : String | Bytes, salt : String | Bytes, iterations : Int) : Tuple(BigInt, BigInt) #

[View source]
def curve : OpenSSL::PKey::EC #

[View source]
def curve_group : OpenSSL::PKey::EC::Group #

[View source]
def curve_name : Curve #

[View source]
def generator_point : OpenSSL::PKey::EC::Point #

[View source]
def hash(data) : Bytes #
Description copied from class Reference

See Object#hash(hasher)


[View source]
def hash_algorithm : OpenSSL::Algorithm #

[View source]
def m : OpenSSL::PKey::EC::Point #

[View source]
def mac(key : Bytes, data : Bytes) : Bytes #

[View source]
def mac_algorithm : MAC #

[View source]
def n : OpenSSL::PKey::EC::Point #

[View source]
def ws_length : Int32 #

[View source]