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
,java.lang.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 typewallet.ScryptParameters
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Protos.ScryptParameters.Builder
clearN()
CPU/ memory cost parameterProtos.ScryptParameters.Builder
clearP()
Parallelisation parameterProtos.ScryptParameters.Builder
clearR()
Block size parameterProtos.ScryptParameters.Builder
clearSalt()
Salt 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)Protos.ScryptParameters.Builder
setN(long value)
CPU/ memory cost parameterProtos.ScryptParameters.Builder
setP(int value)
Parallelisation parameterProtos.ScryptParameters.Builder
setR(int value)
Block size parameterProtos.ScryptParameters.Builder
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
-
-
-
-
Method Detail
-
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
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 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
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
public Protos.ScryptParameters.Builder 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
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
public Protos.ScryptParameters.Builder 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
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
public Protos.ScryptParameters.Builder clearP()
Parallelisation parameter
optional int32 p = 4 [default = 1];
- Returns:
- This builder for chaining.
-
-