From e03812c9bc4163adc09d5014007989d5b8dd8291 Mon Sep 17 00:00:00 2001 From: juergw Date: Thu, 27 Nov 2025 09:42:46 +0000 Subject: [PATCH 1/2] Suppress warnings about InlineMe suggestions. --- .../src/main/java/org/conscrypt/HpkeSuite.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/org/conscrypt/HpkeSuite.java b/common/src/main/java/org/conscrypt/HpkeSuite.java index 488110684..694ea45bb 100644 --- a/common/src/main/java/org/conscrypt/HpkeSuite.java +++ b/common/src/main/java/org/conscrypt/HpkeSuite.java @@ -109,6 +109,7 @@ public AEAD getAead() { * @return {@link KEM} representation. */ @Deprecated // Use KEM.forId() + @SuppressWarnings("InlineMeSuggester") public KEM convertKem(int kem) { return KEM.forId(kem); } @@ -120,6 +121,7 @@ public KEM convertKem(int kem) { * @return {@link KDF} representation. */ @Deprecated // Use KDF.forId() + @SuppressWarnings("InlineMeSuggester") public KDF convertKdf(int kdf) { return KDF.forId(kdf); } @@ -131,6 +133,7 @@ public KDF convertKdf(int kdf) { * @return {@link AEAD} representation. */ @Deprecated // Use AEAD.forId() + @SuppressWarnings("InlineMeSuggester") public AEAD convertAead(int aead) { return AEAD.forId(aead); } @@ -178,9 +181,11 @@ public int getId() { * Returns the length in bytes of an encapsulated key produced by this KEM. */ @Deprecated // Use getEncapsulatedLength + @SuppressWarnings("InlineMeSuggester") public int getnEnc() { return getEncapsulatedLength(); } + public int getEncapsulatedLength() { return nEnc; } @@ -258,7 +263,9 @@ public int getId() { public int getMacLength() { return hLength; } + @Deprecated // Use getMacLength + @SuppressWarnings("InlineMeSuggester") public int getHLength() { return getMacLength(); } @@ -278,10 +285,12 @@ public long maxExportLength() { * * @return name of mac algorithm used by the kdf. */ - @Deprecated // Use getMacName + @Deprecated // Use getMacName() + @SuppressWarnings("InlineMeSuggester") public String getMacAlgorithmName() { return getMacName(); } + public String getMacName() { return hName; } @@ -342,9 +351,11 @@ public int getId() { * AEAD ids */ @Deprecated // Use getKeyLength() + @SuppressWarnings("InlineMeSuggester") public int getNk() { return getKeyLength(); } + public int getKeyLength() { return nk; } @@ -357,9 +368,11 @@ public int getKeyLength() { * AEAD ids */ @Deprecated // Use getNonceLength() + @SuppressWarnings("InlineMeSuggester") public int getNn() { return getNonceLength(); } + public int getNonceLength() { return nn; } @@ -372,9 +385,11 @@ public int getNonceLength() { * AEAD ids */ @Deprecated // Use getTagLength() + @SuppressWarnings("InlineMeSuggester") public int getNt() { return nt; } + public int getTagLength() { return nt; } @@ -392,3 +407,4 @@ public static AEAD forId(int id) { } } } + From 638d85158142e8185876c6056453ffd3fb153cb6 Mon Sep 17 00:00:00 2001 From: juergw Date: Thu, 27 Nov 2025 09:48:06 +0000 Subject: [PATCH 2/2] Fix format. --- common/src/main/java/org/conscrypt/HpkeSuite.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/org/conscrypt/HpkeSuite.java b/common/src/main/java/org/conscrypt/HpkeSuite.java index 694ea45bb..92dbe5551 100644 --- a/common/src/main/java/org/conscrypt/HpkeSuite.java +++ b/common/src/main/java/org/conscrypt/HpkeSuite.java @@ -71,8 +71,7 @@ public HpkeSuite(int kem, int kdf, int aead) { } public String name() { - return String.format("%s/%s/%s", - mKem.name(), mKdf.name(), mAead.name()); + return String.format("%s/%s/%s", mKem.name(), mKdf.name(), mAead.name()); } /** @@ -347,7 +346,8 @@ public int getId() { * Returns the length in bytes of a key for this algorithm. * * @return AEAD Nk - * @see + * @see * AEAD ids */ @Deprecated // Use getKeyLength() @@ -364,7 +364,8 @@ public int getKeyLength() { * Returns the length in bytes of a nonce for this algorithm. * * @return AEAD Nn - * @see + * @see * AEAD ids */ @Deprecated // Use getNonceLength() @@ -381,7 +382,8 @@ public int getNonceLength() { * Returns the length in bytes of the AEAD authentication tag for this algorithm. * * @return AEAD Nt - * @see + * @see * AEAD ids */ @Deprecated // Use getTagLength() @@ -407,4 +409,3 @@ public static AEAD forId(int id) { } } } -