diff options
author | David Hook <dgh@cryptoworkshop.com> | 2021-05-02 13:58:09 +1000 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2021-05-02 13:58:09 +1000 |
commit | 196bbb0190164b985580d8c4465f6f10f2306bca (patch) | |
tree | 92305fddb59b45c173715370c956ff3832fe103b | |
parent | minor refactor of Hkdf to HKdf (diff) | |
download | BouncyCastle.NET-ed25519-196bbb0190164b985580d8c4465f6f10f2306bca.tar.xz |
rewound case change
-rw-r--r-- | crypto/src/crypto/generators/HKdfBytesGenerator.cs | 10 | ||||
-rw-r--r-- | crypto/src/crypto/parameters/HKdfParameters.cs | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/crypto/src/crypto/generators/HKdfBytesGenerator.cs b/crypto/src/crypto/generators/HKdfBytesGenerator.cs index 9672f5ba3..6f36a6faa 100644 --- a/crypto/src/crypto/generators/HKdfBytesGenerator.cs +++ b/crypto/src/crypto/generators/HKdfBytesGenerator.cs @@ -13,7 +13,7 @@ namespace Org.BouncyCastle.Crypto.Generators * (output keying material) and is likely to have better security properties * than KDF's based on just a hash function. */ - public class HKdfBytesGenerator + public class HkdfBytesGenerator : IDerivationFunction { private HMac hMacHash; @@ -29,7 +29,7 @@ namespace Org.BouncyCastle.Crypto.Generators * * @param hash the digest to be used as the source of generatedBytes bytes */ - public HKdfBytesGenerator(IDigest hash) + public HkdfBytesGenerator(IDigest hash) { this.hMacHash = new HMac(hash); this.hashLen = hash.GetDigestSize(); @@ -37,10 +37,10 @@ namespace Org.BouncyCastle.Crypto.Generators public virtual void Init(IDerivationParameters parameters) { - if (!(parameters is HKdfParameters)) - throw new ArgumentException("HKDF parameters required for HKdfBytesGenerator", "parameters"); + if (!(parameters is HkdfParameters)) + throw new ArgumentException("HKDF parameters required for HkdfBytesGenerator", "parameters"); - HKdfParameters hkdfParameters = (HKdfParameters)parameters; + HkdfParameters hkdfParameters = (HkdfParameters)parameters; if (hkdfParameters.SkipExtract) { // use IKM directly as PRK diff --git a/crypto/src/crypto/parameters/HKdfParameters.cs b/crypto/src/crypto/parameters/HKdfParameters.cs index 348b1148a..6d1465e4c 100644 --- a/crypto/src/crypto/parameters/HKdfParameters.cs +++ b/crypto/src/crypto/parameters/HKdfParameters.cs @@ -6,9 +6,9 @@ using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Parameters { /** - * Parameter class for the HKdfBytesGenerator class. + * Parameter class for the HkdfBytesGenerator class. */ - public class HKdfParameters + public class HkdfParameters : IDerivationParameters { private readonly byte[] ikm; @@ -16,7 +16,7 @@ namespace Org.BouncyCastle.Crypto.Parameters private readonly byte[] salt; private readonly byte[] info; - private HKdfParameters(byte[] ikm, bool skip, byte[] salt, byte[] info) + private HkdfParameters(byte[] ikm, bool skip, byte[] salt, byte[] info) { if (ikm == null) throw new ArgumentNullException("ikm"); @@ -51,7 +51,7 @@ namespace Org.BouncyCastle.Crypto.Parameters * @param salt the salt to use, may be null for a salt for hashLen zeros * @param info the info to use, may be null for an info field of zero bytes */ - public HKdfParameters(byte[] ikm, byte[] salt, byte[] info) + public HkdfParameters(byte[] ikm, byte[] salt, byte[] info) : this(ikm, false, salt, info) { } @@ -65,14 +65,14 @@ namespace Org.BouncyCastle.Crypto.Parameters * @param info the info to use, may be null for an info field of zero bytes * @return HKDFParameters that makes the implementation skip step 1 */ - public static HKdfParameters SkipExtractParameters(byte[] ikm, byte[] info) + public static HkdfParameters SkipExtractParameters(byte[] ikm, byte[] info) { - return new HKdfParameters(ikm, true, null, info); + return new HkdfParameters(ikm, true, null, info); } - public static HKdfParameters DefaultParameters(byte[] ikm) + public static HkdfParameters DefaultParameters(byte[] ikm) { - return new HKdfParameters(ikm, false, null, null); + return new HkdfParameters(ikm, false, null, null); } /** |