Object

com.alexdupre.litecoin

Crypto

Related Doc: package litecoin

Permalink

object Crypto

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Crypto
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Point(value: ECPoint) extends Product with Serializable

    Permalink

    Curve point

    Curve point

    value

    ecPoint to initialize this point with

  2. case class PointProxy(bin: BinaryData) extends Product with Serializable

    Permalink
  3. case class PrivateKey(value: Scalar, compressed: Boolean = true) extends Product with Serializable

    Permalink

    value

    value of this private key (a number)

    compressed

    flags which specifies if the associated public key will be compressed or uncompressed.

  4. case class PublicKey(raw: BinaryData, checkValid: Boolean = true) extends Product with Serializable

    Permalink

    raw

    serialized value of this public key (a point)

    checkValid

    indicates whether or not we check that this is a valid public key; this should be used carefully for optimization purposes

  5. case class Scalar(value: BigInteger) extends Product with Serializable

    Permalink

    A scalar is a 256 bit number

    A scalar is a 256 bit number

    value

    value to initialize this scalar with

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Point extends Serializable

    Permalink
  5. object PrivateKey extends Serializable

    Permalink
  6. object PublicKey extends Serializable

    Permalink
  7. object Scalar extends Serializable

    Permalink
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. implicit def biginteger2scalar(value: BigInteger): Scalar

    Permalink
  10. implicit def bin2scalar(value: BinaryData): Scalar

    Permalink
  11. def checkPubKeyEncoding(key: Seq[Byte], flags: Int, sigVersion: Int): Boolean

    Permalink
  12. def checkSignatureEncoding(sig: Seq[Byte], flags: Int): Boolean

    Permalink
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. val curve: ECDomainParameters

    Permalink
  15. def decodeSignature(blob: Seq[Byte]): (BigInteger, BigInteger)

    Permalink

    An ECDSA signature is a (r, s) pair.

    An ECDSA signature is a (r, s) pair. Litecoin uses DER encoded signatures

    blob

    sigbyte data

    returns

    the decoded (r, s) signature

  16. def decodeSignatureLax(input: BinaryData): (BigInteger, BigInteger)

    Permalink
  17. def decodeSignatureLax(input: ByteArrayInputStream): (BigInteger, BigInteger)

    Permalink
  18. def ecdh(priv: Scalar, pub: Point): BinaryData

    Permalink

    Computes ecdh using secp256k1's variant: sha256(priv * pub serialized in compressed format)

    Computes ecdh using secp256k1's variant: sha256(priv * pub serialized in compressed format)

    priv

    private value

    pub

    public value

    returns

    ecdh(priv, pub) as computed by libsecp256k1

  19. implicit def ecpoint2point(value: ECPoint): Point

    Permalink
  20. def encodeSignature(t: (BigInteger, BigInteger)): BinaryData

    Permalink
  21. def encodeSignature(r: BigInteger, s: BigInteger): BinaryData

    Permalink

    An ECDSA signature is a (r, s) pair.

    An ECDSA signature is a (r, s) pair. Litecoin uses DER encoded signatures

    r

    first value

    s

    second value

    returns

    (r, s) in DER format

  22. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def fixSize(data: BinaryData): BinaryData

    Permalink
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. val halfCurveOrder: BigInteger

    Permalink
  28. def hash(digest: Digest)(input: Seq[Byte]): BinaryData

    Permalink
  29. def hash160(input: Seq[Byte]): BinaryData

    Permalink

    160 bits litecoin hash, used mostly for address encoding hash160(input) = RIPEMD160(SHA256(input))

    160 bits litecoin hash, used mostly for address encoding hash160(input) = RIPEMD160(SHA256(input))

    input

    array of byte

    returns

    the 160 bits LTC hash of input

  30. def hash256(input: Seq[Byte]): BinaryData

    Permalink

    256 bits litecoin hash hash256(input) = SHA256(SHA256(input))

    256 bits litecoin hash hash256(input) = SHA256(SHA256(input))

    input

    array of byte

    returns

    the 256 bits LTC hash of input

  31. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  32. def hmac512(key: Seq[Byte], data: Seq[Byte]): BinaryData

    Permalink
  33. def isDERSignature(sig: Seq[Byte]): Boolean

    Permalink
  34. def isDefinedHashtypeSignature(sig: Seq[Byte]): Boolean

    Permalink
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. def isLowDERSignature(sig: Seq[Byte]): Boolean

    Permalink
  37. def isPrivateKeyCompressed(key: PrivateKey): Boolean

    Permalink
  38. def isPubKeyCompressed(key: Seq[Byte]): Boolean

    Permalink
  39. def isPubKeyCompressedOrUncompressed(key: Seq[Byte]): Boolean

    Permalink
  40. def isPubKeyValid(key: Seq[Byte]): Boolean

    Permalink

    key

    serialized public key

    returns

    true if the key is valid. Please not that this performs very basic tests and does not check that the point represented by this key is actually valid.

  41. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  42. def normalizeSignature(sig: BinaryData): BinaryData

    Permalink
  43. def normalizeSignature(r: BigInteger, s: BigInteger): (BigInteger, BigInteger)

    Permalink
  44. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. val one: BigInteger

    Permalink
  47. val params: X9ECParameters

    Permalink
  48. implicit def point2ecpoint(point: Point): ECPoint

    Permalink
  49. implicit def privatekey2scalar(priv: PrivateKey): Scalar

    Permalink
  50. def publicKeyFromPrivateKey(privateKey: BinaryData): PublicKey

    Permalink

    privateKey

    private key

    returns

    the corresponding public key

  51. implicit def publickey2bin(pub: PublicKey): BinaryData

    Permalink
  52. implicit def publickey2point(pub: PublicKey): Point

    Permalink
  53. def recoverPoint(x: BigInteger): (Point, Point)

    Permalink

    x

    x coordinate

    returns

    a tuple (p1, p2) where p1 and p2 are points on the curve and p1.x = p2.x = x p1.y is even, p2.y is odd

  54. def recoverPublicKey(sig: BinaryData, message: BinaryData): (PublicKey, PublicKey)

    Permalink
  55. def recoverPublicKey(t: (BigInteger, BigInteger), message: BinaryData): (PublicKey, PublicKey)

    Permalink

    Recover public keys from a signature and the message that was signed.

    Recover public keys from a signature and the message that was signed. This method will return 2 public keys, and the signature can be verified with both, but only one of them matches that private key that was used to generate the signature.

    t

    signature

    message

    message that was signed

    returns

    a (pub1, pub2) tuple where pub1 and pub2 are candidates public keys. If you have the recovery id then use pub1 if the recovery id is even and pub2 if it is odd

  56. def ripemd160: (Seq[Byte]) ⇒ BinaryData

    Permalink
  57. implicit def scalar2biginteger(scalar: Scalar): BigInteger

    Permalink
  58. implicit def scalar2bin(scalar: Scalar): BinaryData

    Permalink
  59. def sha1: (Seq[Byte]) ⇒ BinaryData

    Permalink
  60. def sha256: (Seq[Byte]) ⇒ BinaryData

    Permalink
  61. def sign(data: BinaryData, privateKey: PrivateKey): (BigInteger, BigInteger)

    Permalink

    Sign data with a private key, using RCF6979 deterministic signatures

    Sign data with a private key, using RCF6979 deterministic signatures

    data

    data to sign

    privateKey

    private key. If you are using litecoin "compressed" private keys make sure to only use the first 32 bytes of the key (there is an extra "1" appended to the key)

    returns

    a (r, s) ECDSA signature pair

  62. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  63. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  64. def verifySignature(data: BinaryData, signature: BinaryData, publicKey: PublicKey): Boolean

    Permalink

    data

    data

    signature

    signature

    publicKey

    public key

    returns

    true is signature is valid for this data with this public key

  65. def verifySignature(data: Seq[Byte], signature: (BigInteger, BigInteger), publicKey: PublicKey): Boolean

    Permalink
  66. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. val zero: BigInteger

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped