PHP Class Trianglman\Sqrl\Ed25519\Crypto

Inheritance: implements Trianglman\Sqrl\Ed25519\CryptoInterface
Mostra file Open project: trianglman/sqrl Class Usage Examples

Protected Properties

Property Type Description
$B
$Bx
$By
$I
$b
$d
$l
$q

Public Methods

Method Description
__construct ( )
checkvalid ( $s, $m, $pk )
publickey ( string $sk ) : string Generates the public key of a given private key
signature ( $m, $sk, $pk )

Protected Methods

Method Description
H ( $m )
Hint ( $m )
bit ( $h, $i )
bitsToString ( $bits )
dec2bin_i ( $decimal_i )
decodeint ( $s )
decodepoint ( $s ) * def decodepoint(s): y = sum(2**i * bit(s,i) for i in range(0,b-1)) x = xrecover(y) if x & 1 != bit(s,b-1): x = q-x P = [x,y] if not isoncurve(P): raise Exception("decoding point that is not on curve") return P
edwards ( $P, $Q )
encodeint ( $y )
encodepoint ( $P )
expmod ( $b, $e, $m )
inv ( $x )
isoncurve ( $P )
pymod ( $x, $m ) ((n % M) + M) % M //python modulus craziness
scalarloop ( $P, $e )
scalarmult ( $P, $e )
xrecover ( $y )

Method Details

H() protected method

protected H ( $m )

Hint() protected method

protected Hint ( $m )

__construct() public method

public __construct ( )

bit() protected method

protected bit ( $h, $i )

bitsToString() protected method

protected bitsToString ( $bits )

checkvalid() public method

public checkvalid ( $s, $m, $pk )

dec2bin_i() protected method

protected dec2bin_i ( $decimal_i )

decodeint() protected method

protected decodeint ( $s )

decodepoint() protected method

* def decodepoint(s): y = sum(2**i * bit(s,i) for i in range(0,b-1)) x = xrecover(y) if x & 1 != bit(s,b-1): x = q-x P = [x,y] if not isoncurve(P): raise Exception("decoding point that is not on curve") return P
protected decodepoint ( $s )

edwards() protected method

protected edwards ( $P, $Q )

encodeint() protected method

protected encodeint ( $y )

encodepoint() protected method

protected encodepoint ( $P )

expmod() protected method

protected expmod ( $b, $e, $m )

inv() protected method

protected inv ( $x )

isoncurve() protected method

protected isoncurve ( $P )

publickey() public method

Generates the public key of a given private key
public publickey ( string $sk ) : string
$sk string the secret key
return string

pymod() protected method

((n % M) + M) % M //python modulus craziness
protected pymod ( $x, $m )

scalarloop() protected method

protected scalarloop ( $P, $e )

scalarmult() protected method

protected scalarmult ( $P, $e )

signature() public method

public signature ( $m, $sk, $pk )

xrecover() protected method

protected xrecover ( $y )

Property Details

$B protected_oe property

protected $B

$Bx protected_oe property

protected $Bx

$By protected_oe property

protected $By

$I protected_oe property

protected $I

$b protected_oe property

protected $b

$d protected_oe property

protected $d

$l protected_oe property

protected $l

$q protected_oe property

protected $q