Class Protos.ScryptParameters.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<Protos.ScryptParameters,Protos.ScryptParameters.Builder>
org.bitcoinj.wallet.Protos.ScryptParameters.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, Cloneable, Protos.ScryptParametersOrBuilder
Enclosing class:
Protos.ScryptParameters

public static final class Protos.ScryptParameters.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<Protos.ScryptParameters,Protos.ScryptParameters.Builder> implements Protos.ScryptParametersOrBuilder
 The parameters used in the scrypt key derivation function.
  The default values are taken from http://www.tarsnap.com/scrypt/scrypt-slides.pdf.
  They can be increased - n is the number of iterations performed and
  r and p can be used to tweak the algorithm - see:
  http://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors
 
Protobuf type wallet.ScryptParameters
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance, isBuilt
  • Method Summary

    Modifier and Type
    Method
    Description
    CPU/ memory cost parameter
    Parallelisation parameter
    Block size parameter
    Salt to use in generation of the wallet password (8 bytes)
    long
    CPU/ memory cost parameter
    int
    Parallelisation parameter
    int
    Block size parameter
    com.google.protobuf.ByteString
    Salt to use in generation of the wallet password (8 bytes)
    boolean
    CPU/ memory cost parameter
    boolean
    Parallelisation parameter
    boolean
    Block size parameter
    boolean
    Salt to use in generation of the wallet password (8 bytes)
    setN(long value)
    CPU/ memory cost parameter
    setP(int value)
    Parallelisation parameter
    setR(int value)
    Block size parameter
    setSalt(com.google.protobuf.ByteString value)
    Salt to use in generation of the wallet password (8 bytes)

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • hasSalt

      public boolean hasSalt()
       Salt to use in generation of the wallet password (8 bytes)
       
      required bytes salt = 1;
      Specified by:
      hasSalt in interface Protos.ScryptParametersOrBuilder
      Returns:
      Whether the salt field is set.
    • getSalt

      public com.google.protobuf.ByteString getSalt()
       Salt to use in generation of the wallet password (8 bytes)
       
      required bytes salt = 1;
      Specified by:
      getSalt in interface Protos.ScryptParametersOrBuilder
      Returns:
      The salt.
    • setSalt

      public Protos.ScryptParameters.Builder setSalt(com.google.protobuf.ByteString value)
       Salt to use in generation of the wallet password (8 bytes)
       
      required bytes salt = 1;
      Parameters:
      value - The salt to set.
      Returns:
      This builder for chaining.
    • clearSalt

      public Protos.ScryptParameters.Builder clearSalt()
       Salt to use in generation of the wallet password (8 bytes)
       
      required bytes salt = 1;
      Returns:
      This builder for chaining.
    • hasN

      public boolean hasN()
       CPU/ memory cost parameter
       
      optional int64 n = 2 [default = 16384];
      Specified by:
      hasN in interface Protos.ScryptParametersOrBuilder
      Returns:
      Whether the n field is set.
    • getN

      public long getN()
       CPU/ memory cost parameter
       
      optional int64 n = 2 [default = 16384];
      Specified by:
      getN in interface Protos.ScryptParametersOrBuilder
      Returns:
      The n.
    • setN

      public Protos.ScryptParameters.Builder setN(long value)
       CPU/ memory cost parameter
       
      optional int64 n = 2 [default = 16384];
      Parameters:
      value - The n to set.
      Returns:
      This builder for chaining.
    • clearN

       CPU/ memory cost parameter
       
      optional int64 n = 2 [default = 16384];
      Returns:
      This builder for chaining.
    • hasR

      public boolean hasR()
       Block size parameter
       
      optional int32 r = 3 [default = 8];
      Specified by:
      hasR in interface Protos.ScryptParametersOrBuilder
      Returns:
      Whether the r field is set.
    • getR

      public int getR()
       Block size parameter
       
      optional int32 r = 3 [default = 8];
      Specified by:
      getR in interface Protos.ScryptParametersOrBuilder
      Returns:
      The r.
    • setR

      public Protos.ScryptParameters.Builder setR(int value)
       Block size parameter
       
      optional int32 r = 3 [default = 8];
      Parameters:
      value - The r to set.
      Returns:
      This builder for chaining.
    • clearR

       Block size parameter
       
      optional int32 r = 3 [default = 8];
      Returns:
      This builder for chaining.
    • hasP

      public boolean hasP()
       Parallelisation parameter
       
      optional int32 p = 4 [default = 1];
      Specified by:
      hasP in interface Protos.ScryptParametersOrBuilder
      Returns:
      Whether the p field is set.
    • getP

      public int getP()
       Parallelisation parameter
       
      optional int32 p = 4 [default = 1];
      Specified by:
      getP in interface Protos.ScryptParametersOrBuilder
      Returns:
      The p.
    • setP

      public Protos.ScryptParameters.Builder setP(int value)
       Parallelisation parameter
       
      optional int32 p = 4 [default = 1];
      Parameters:
      value - The p to set.
      Returns:
      This builder for chaining.
    • clearP

       Parallelisation parameter
       
      optional int32 p = 4 [default = 1];
      Returns:
      This builder for chaining.