From 892fc5e3ae05a80512105766cc983bf8b0709011 Mon Sep 17 00:00:00 2001 From: Usman Saleem Date: Wed, 8 May 2024 11:15:30 +1000 Subject: [PATCH] build: Add default constructor and javadoc for crypto, datatypes subprojects (#7069) * javadoc - Adding default constructor and javadoc for :crypto * javadoc - Adding default constructor and javadoc for :datatypes --------- Signed-off-by: Usman Saleem Co-authored-by: Sally MacFarlane --- .../java/org/hyperledger/besu/crypto/ECPointUtil.java | 3 +++ .../java/org/hyperledger/besu/crypto/KeyPairUtil.java | 3 +++ .../hyperledger/besu/crypto/SecureRandomProvider.java | 3 +++ .../besu/crypto/altbn128/AltBn128Fq12Pairer.java | 7 +++++-- .../org/hyperledger/besu/datatypes/AccessListEntry.java | 7 ++++++- .../hyperledger/besu/datatypes/BlobsWithCommitments.java | 9 ++++++++- 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/ECPointUtil.java b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/ECPointUtil.java index e000feb1f6..c9d6e3992f 100644 --- a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/ECPointUtil.java +++ b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/ECPointUtil.java @@ -24,6 +24,9 @@ import org.bouncycastle.util.BigIntegers; /** The Ec point util class. */ public class ECPointUtil { + /** Default constructor. */ + private ECPointUtil() {} + /** * From bouncy castle ec point to ECPoint. * diff --git a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/KeyPairUtil.java b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/KeyPairUtil.java index 013b385c3c..ac1c9a7bf2 100644 --- a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/KeyPairUtil.java +++ b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/KeyPairUtil.java @@ -38,6 +38,9 @@ public class KeyPairUtil { private static final Supplier SIGNATURE_ALGORITHM = Suppliers.memoize(SignatureAlgorithmFactory::getInstance); + /** Default constructor */ + private KeyPairUtil() {} + /** * Load resource file string. * diff --git a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/SecureRandomProvider.java b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/SecureRandomProvider.java index a13ef8a073..2b987ee391 100644 --- a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/SecureRandomProvider.java +++ b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/SecureRandomProvider.java @@ -23,6 +23,9 @@ import java.security.SecureRandom; public class SecureRandomProvider { private static final SecureRandom publicSecureRandom = secureRandom(); + /** Default constructor. */ + private SecureRandomProvider() {} + /** * Returns a shared instance of secure random intended to be used where the value is used publicly * diff --git a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12Pairer.java b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12Pairer.java index 40e0073134..cd55e8d68c 100644 --- a/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12Pairer.java +++ b/crypto/algorithms/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq12Pairer.java @@ -20,8 +20,8 @@ import java.math.BigInteger; import java.util.Arrays; /** - * Adapted from the pc_ecc (Apache 2 License) implementation: - * https://github.com/ethereum/py_ecc/blob/master/py_ecc/bn128/bn128_field_elements.py + * Adapted from the pc_ecc (Apache 2 License) implementation. */ public class AltBn128Fq12Pairer { @@ -33,6 +33,9 @@ public class AltBn128Fq12Pairer { new BigInteger( "21888242871839275222246405745257275088548364400416034343698204186575808495617"); + /** Default constructor */ + private AltBn128Fq12Pairer() {} + /** * Pair fq 12. * diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java index 33d2d8677a..7d242128bf 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccessListEntry.java @@ -22,7 +22,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; -/** An access list entry as defined in EIP-2930 */ +/** + * An access list entry as defined in EIP-2930 + * + * @param address The Address + * @param storageKeys List of storage keys + */ public record AccessListEntry(Address address, List storageKeys) { /** * Create access list entry. diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java index 86380a7aa6..6127fe9c77 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/BlobsWithCommitments.java @@ -22,7 +22,14 @@ import java.util.Objects; /** A class to hold the blobs, commitments, proofs and versioned hashes for a set of blobs. */ public class BlobsWithCommitments { - /** A record to hold the blob, commitment, proof and versioned hash for a blob. */ + /** + * A record to hold the blob, commitment, proof and versioned hash for a blob. + * + * @param blob The blob + * @param kzgCommitment The commitment + * @param kzgProof The proof + * @param versionedHash The versioned hash + */ public record BlobQuad( Blob blob, KZGCommitment kzgCommitment, KZGProof kzgProof, VersionedHash versionedHash) {}