Object StarknetCurve

  • All Implemented Interfaces:

    
    public class StarknetCurve
    
                        

    Starknet curve utilities.

    Class with utility methods related to starknet curve signatures generation and verification.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • pedersen

         final static Felt pedersen(Felt first, Felt second)

        Compute pedersen hash on input values

      • pedersen

         final static Felt pedersen(Iterable<Felt> values)

        Compute pedersen hash on iterable of Felts.

        Parameters:
        values - an iterable of Felts
      • pedersenOnElements

         final static Felt pedersenOnElements(Felt values)

        Compute pedersen hash on variable number of arguments.

        Parameters:
        values - any number of Felts
      • sign

         final static StarknetCurveSignature sign(Felt privateKey, Felt hash)

        Sign a provided hash.

        Parameters:
        privateKey - a private key used to generate a signature
        hash - a hash to be signed
      • verify

         final static Boolean verify(Felt publicKey, Felt hash, Felt r, Felt s)

        Verify a signature.

        Parameters:
        publicKey - a public key to be used to verify a signature
        hash - a value that was signed
        r - part of signature
        s - part of signature
      • getPublicKey

         final static Felt getPublicKey(Felt privateKey)

        Get a public key for provided private key.

        Parameters:
        privateKey - a private key from which public key will be derived