ECC.jl Documentation

ECC.jl Documentation

Elliptic Curve Cryptography for Julia.


ECC.S256Point โ€” Type.

S256Point(๐‘ฅ::T, ๐‘ฆ::T) where {T<:Union{S256FieldElement, Integer, Infinity}} represents a point in an scep256k1 field.

ECC.PrivateKey โ€” Type.

PrivateKey(๐‘’) represents an S256Point determined by ๐‘ƒ = ๐‘’G, where ๐‘’ is an integer and G the scep256k1 generator point.

ECC.Signature โ€” Type.

Signature(๐‘Ÿ, ๐‘ ) represents a Signature for ๐‘ง in which ๐‘  = (๐‘ง + ๐‘Ÿ๐‘’) / ๐‘˜ ๐‘˜ being a random integer.


ECC.point2sec โ€” Function.

Serialize an S256Point() to compressed SEC format, uncompressed if false is set as second argument.

'point2sec(P::T, compressed::Bool=true) where {T<:S256Point} -> Array{UInt8,1}'

ECC.sec2point โ€” Function.

Parse a SEC binary to an S256Point()

sec2point(sec_bin::AbstractArray{UInt8}) -> S256Point

ECC.verify โ€” Function.

Returns true if Signature is valid for ๐‘ง given ๐‘ƒ, false if not

verify(๐‘ƒ::AbstractPoint, ๐‘ง::Integer, sig::Signature) -> Bool

ECC.pksign โ€” Function.

Returns a Signature for a given PrivateKey and data ๐‘ง pksign(pk::PrivateKey, ๐‘ง::Integer) -> Signature

ECC.sig2der โ€” Function.

Serialize a Signature to DER format

sig2der(x::Signature) -> Array{UInt8,1}

ECC.der2sig โ€” Function.

Parse a DER binary to a Signature

der2sig(signature_bin::AbstractArray{UInt8}) -> Signature


ECC.int2bytes โ€” Function.
Integer, Integer, Boolean -> Array{UInt8,1}

Convert Integer to an Array{UInt8}

BigInt -> Array{UInt8,1}

Convert BigInt to an Array{UInt8}

ECC.bytes2int โ€” Function.
Array{UInt8,1}, Boolean -> Integer

Convert Array{UInt8,1} to an Integer

Buy me a cup of coffee

Donate BitcoinDonate Litecoin