Package org.bitcoinj.wallet
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-factorsProtobuf type
wallet.ScryptParameters
-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance, isBuilt
-
Method Summary
Modifier and TypeMethodDescriptionclearN()
CPU/ memory cost parameterclearP()
Parallelisation parameterclearR()
Block size parameterSalt to use in generation of the wallet password (8 bytes)long
getN()
CPU/ memory cost parameterint
getP()
Parallelisation parameterint
getR()
Block size parametercom.google.protobuf.ByteString
getSalt()
Salt to use in generation of the wallet password (8 bytes)boolean
hasN()
CPU/ memory cost parameterboolean
hasP()
Parallelisation parameterboolean
hasR()
Block size parameterboolean
hasSalt()
Salt to use in generation of the wallet password (8 bytes)setN
(long value) CPU/ memory cost parametersetP
(int value) Parallelisation parametersetR
(int value) Block size parametersetSalt
(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 interfaceProtos.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 interfaceProtos.ScryptParametersOrBuilder
- Returns:
- The salt.
-
setSalt
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
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 interfaceProtos.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 interfaceProtos.ScryptParametersOrBuilder
- Returns:
- The n.
-
setN
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 interfaceProtos.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 interfaceProtos.ScryptParametersOrBuilder
- Returns:
- The r.
-
setR
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 interfaceProtos.ScryptParametersOrBuilder
- Returns:
- Whether the p field is set.
-
getP
public int getP()Parallelisation parameter
optional int32 p = 4 [default = 1];
- Specified by:
getP
in interfaceProtos.ScryptParametersOrBuilder
- Returns:
- The p.
-
setP
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.
-