ECC.jl Documentation
Elliptic Curve Cryptography for Julia.
Types
ECC.S256Point
โ Type.S256Point{T<:Number}
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.
Functions
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
Helpers
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 Bitcoin Donate Litecoin