Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crypto-refresh references to RFC9580 #1770

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pg/src/main/j2me/org/bouncycastle/bcpg/S2K.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public Argon2Params(byte[] salt, int passes, int parallelism, int memSizeExp)

// log_2(p) = log_e(p) / log_e(2)
//double log2_p = Math.log((double)parallelism) / Math.log(2.0);
// see https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-05.html#section-3.7.1.4-5
// see https://www.rfc-editor.org/rfc/rfc9580.html#section-3.7.1.4-5
//if (memSizeExp < (3 + Math.ceil(log2_p)) || memSizeExp > 31)
//{
//throw new IllegalArgumentException("Memory size exponent MUST be between 3+ceil(log_2(parallelism)) and 31");
Expand Down
10 changes: 5 additions & 5 deletions pg/src/main/java/org/bouncycastle/bcpg/AEADAlgorithmTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

/**
* AEAD Algorithm IDs.
* Crypto-Refresh (OpenPGP) defines IDs 1 through 3, while LibrePGP only defines 1 and 2.
* Further, the use of AEAD differs between C-R and LibrePGP.
* RFC9580 (OpenPGP) defines IDs 1 through 3, while LibrePGP only defines 1 and 2.
* Further, the use of AEAD differs between OpenPGP and LibrePGP.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-aead-algorithms">
* Crypto-Refresh: AEAD Algorithms</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-aead-algorithms">
* OpenPGP - AEAD Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-encryption-modes">
* LibrePGP - Encryption Modes</a>
*/
Expand All @@ -18,7 +18,7 @@ public interface AEADAlgorithmTags
int EAX = 1;
/**
* OCB with 15-bit nonce/IV and 16-bit auth tag length.
* C-R compliant implementations MUST implement OCB.
* RFC9580-compliant implementations MUST implement OCB.
*/
int OCB = 2;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-9.3">
* RFC4880 - Compression Algorithms</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-compression-algorithms">
* RFC9580 - Compression Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-compression-algorithms">
* LibrePGP - Compression Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-compression-algorithms">
* Crypto-Refresh - Compression Algorithms</a>
*/
public interface CompressionAlgorithmTags
{
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/ECDHPublicBCPGKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* If you want to be compatible with legacy applications however, you should use this class instead.
* Note though, that for v6 keys, {@link X25519PublicBCPGKey} or {@link X448PublicBCPGKey} MUST be used for X25519, X448.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ecd">
* Crypto-Refresh - Algorithm-Specific Parts for ECDH Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ecd">
* OpenPGP - Algorithm-Specific Parts for ECDH Keys</a>
*/
public class ECDHPublicBCPGKey
extends ECPublicBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* Base class for an ECDSA Public Key.
* This type is used with {@link PublicKeyAlgorithmTags#ECDSA} and the curve is identified by providing an OID.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ec">
* Crypto-Refresh - Algorithm-Specific Parts for ECDSA Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ec">
* OpenPGP - Algorithm-Specific Parts for ECDSA Keys</a>
*/
public class ECDSAPublicBCPGKey
extends ECPublicBCPGKey
Expand Down
12 changes: 6 additions & 6 deletions pg/src/main/java/org/bouncycastle/bcpg/ECSecretBCPGKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* If you want to be compatible with legacy applications however, you should use this class instead.
* Note though, that for v6 keys, {@link X25519SecretBCPGKey} or {@link X448SecretBCPGKey} MUST be used for X25519, X448.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ecd">
* Crypto-Refresh - Algorithm-Specific Parts for ECDH Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ec">
* Crypto-Refresh - Algorithm-Specific Parts for ECDSA Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-curve25519legacy-ecdh-secre">
* Crypto-Refresh - Curve25519Legacy ECDH Secret Key Material (deprecated)</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ecd">
* OpenPGP - Algorithm-Specific Parts for ECDH Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ec">
* OpenPGP - Algorithm-Specific Parts for ECDSA Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-curve25519legacy-ecdh-secre">
* OpenPGP - Curve25519Legacy ECDH Secret Key Material (deprecated)</a>
*/
public class ECSecretBCPGKey
extends BCPGObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Public key of type {@link PublicKeyAlgorithmTags#Ed25519}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed2">
* Crypto-Refresh - Algorithm-Specific Part for Ed25519 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed2">
* OpenPGP - Algorithm-Specific Part for Ed25519 Keys</a>
*/
public class Ed25519PublicBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Secret key of type {@link PublicKeyAlgorithmTags#Ed25519}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed2">
* Crypto-Refresh - Algorithm-Specific Part for Ed25519 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed2">
* OpenPGP - Algorithm-Specific Part for Ed25519 Keys</a>
*/
public class Ed25519SecretBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Public key of type {@link PublicKeyAlgorithmTags#Ed448}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed4">
* Crypto-Refresh - Algorithm-Specific Part for Ed448 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed4">
* OpenPGP - Algorithm-Specific Part for Ed448 Keys</a>
*/
public class Ed448PublicBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

/**
* Secret key of type {@link PublicKeyAlgorithmTags#Ed448}.
* This type was introduced with Crypto-Refresh and can be used with v4, v6 keys.
* This type was introduced with RFC9580 and can be used with v4, v6 keys.
* Note however, that legacy implementations might not understand this key type yet.
* For a key type compatible with legacy v4 implementations, see {@link EdDSAPublicBCPGKey} with
* {@link PublicKeyAlgorithmTags#EDDSA_LEGACY}.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed4">
* Crypto-Refresh - Algorithm-Specific Part for Ed448 Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed4">
* OpenPGP - Algorithm-Specific Part for Ed448 Keys</a>
*/
public class Ed448SecretBCPGKey
extends OctetArrayBCPGKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* Modern OpenPGP uses dedicated key types:
* For {@link PublicKeyAlgorithmTags#Ed25519} see {@link Ed25519PublicBCPGKey} instead.
* For {@link PublicKeyAlgorithmTags#Ed448} see {@link Ed448PublicBCPGKey} instead.
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed">
* Crypto-Refresh - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed">
* OpenPGP - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
*/
public class EdDSAPublicBCPGKey
extends ECPublicBCPGKey
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/EdSecretBCPGKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* For {@link PublicKeyAlgorithmTags#Ed25519} see {@link Ed25519SecretBCPGKey} instead.
* For {@link PublicKeyAlgorithmTags#Ed448} see {@link Ed448SecretBCPGKey} instead.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-algorithm-specific-part-for-ed">
* Crypto-Refresh - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-algorithm-specific-part-for-ed">
* OpenPGP - Algorithm-Specific Parts for EdDSALegacy Keys (deprecated)</a>
*/
public class EdSecretBCPGKey
extends BCPGObject
Expand Down
6 changes: 3 additions & 3 deletions pg/src/main/java/org/bouncycastle/bcpg/HashAlgorithmTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-9.4">
* RFC4880 - Hash Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-hash-algorithms">
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-hash-algorithms">
* RFC9580 - Hash Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-01.html#name-hash-algorithms">
* LibrePGP - Hash Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-hash-algorithms">
* Crypto-Refresh - Hash Algorithms</a>
*/
public interface HashAlgorithmTags
{
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/HashUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public class HashUtils
/**
* Return the length of the salt per hash algorithm, used in OpenPGP v6 signatures.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#hash-algorithms-registry">
* Salt Size declarations</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#hash-algorithms-registry">
* OpenPGP - Salt Size declarations</a>
* @param hashAlgorithm hash algorithm tag
* @return size of the salt for the given hash algorithm in bytes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-5.4">
* Definition of version 3 OPS packets in RFC4880</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-one-pass-signature-packet-t">
* Definition of version 3 and 6 OPS packets in crypto-refresh</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-one-pass-signature-packet-t">
* Definition of version 3 and 6 OPS packets in RFC9580</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#section-5.4">
* Definition of version 3 and 6 OPS packets in librepgp</a>
*/
Expand Down
4 changes: 2 additions & 2 deletions pg/src/main/java/org/bouncycastle/bcpg/Packet.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public boolean hasNewPacketFormat()
* Tags 40 to 59 are reserved for unassigned, non-critical packets.
* Tags 60 to 63 are non-critical private or experimental packets.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-09.html#name-packet-tags">
* Packet Tags</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-packet-tags">
* OpenPGP - Packet Tags</a>
* @return true if the packet is critical, false otherwise.
*/
public boolean isCritical()
Expand Down
2 changes: 1 addition & 1 deletion pg/src/main/java/org/bouncycastle/bcpg/PacketFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* OpenPGP Packet Header Length Format.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-packet-headers">
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-packet-headers">
* OpenPGP Packet Headers</a>
*/
public enum PacketFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
/**
* Public Key Algorithm IDs.
*
* @see <a href="RFC4880 - Public-Key Algorithms">
* https://www.rfc-editor.org/rfc/rfc4880.html#section-9.1</a>
* @see <a href="LibrePGP - Public-Key Algorithms">
* https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-public-key-algorithms</a>
* @see <a href="Crypto-Refresh - Public-Key Algorithms">
* https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-public-key-algorithms</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-public-key-algorithms">
* RFC9580 - Public-Key Algorithms</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-9.1">
* RFC4880 - Public-Key Algorithms</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-public-key-algorithms">
* LibrePGP - Public-Key Algorithms</a>
*/
public interface PublicKeyAlgorithmTags
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public interface PublicKeyAlgorithmTags
int AEDSA = 24; // Reserved
/**
* X25519 encryption algorithm.
* C-R compliant implementations MUST implement support for this.
* RFC9580-compliant implementations MUST implement support for this.
*/
int X25519 = 25; // X25519
/**
Expand All @@ -89,7 +89,7 @@ public interface PublicKeyAlgorithmTags
int X448 = 26; // X448
/**
* Ed25519 signing algorithm.
* C-R compliant implementations MUST implement support for this.
* RFC9580-compliant implementations MUST implement support for this.
*/
int Ed25519 = 27; // new style Ed25519
/**
Expand Down
30 changes: 15 additions & 15 deletions pg/src/main/java/org/bouncycastle/bcpg/PublicKeyPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* An OpenPGP certificate (transferable public key) consists of one primary key and optionally multiple subkey packets.
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-5.5.1.1">
* rfc4880 - Public-Key Packet</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-public-key-packet-type-id-6">
* C-R - Public-Key Packet</a>
* RFC4880 - Public-Key Packet</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-public-key-packet-type-id-6">
* RFC9580 - Public-Key Packet</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-public-key-packet-tag-6">
* LibrePGP - Public-Key Packet</a>
*/
Expand All @@ -24,15 +24,15 @@ public class PublicKeyPacket
* OpenPGP v3 keys are deprecated.
* They can only be used with RSA.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-version-3-public-keys">
* C-R - Version 3 Public Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-version-3-public-keys">
* OpenPGP - Version 3 Public Keys</a>
*/
public static final int VERSION_3 = 3;
/**
* OpenPGP v4 keys are (at the time of writing) widely used, but are subject to some attacks.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-version-4-public-keys">
* C-R - Version 4 Public Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-version-4-public-keys">
* OpenPGP - Version 4 Public Keys</a>
*/
public static final int VERSION_4 = 4;
/**
Expand All @@ -42,8 +42,8 @@ public class PublicKeyPacket
/**
* OpenPGP v6 keys are newly introduced.
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-version-6-public-keys">
* C-R - Version 6 Public Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-version-6-public-keys">
* OpenPGP - Version 6 Public Keys</a>
*/
public static final int VERSION_6 = 6;

Expand Down Expand Up @@ -111,12 +111,12 @@ public class PublicKeyPacket
* @param newPacketFormat packet format
* @throws IOException if the key packet cannot be parsed
*
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-version-3-public-keys">
* C-R - Version 3 Public Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-version-4-public-keys">
* C-R - Version 4 Public Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-version-6-public-keys">
* C-R - Version 6 Public Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-version-3-public-keys">
* OpenPGP - Version 3 Public Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-version-4-public-keys">
* OpenPGP - Version 4 Public Keys</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-version-6-public-keys">
* OpenPGP - Version 6 Public Keys</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-01.html#name-public-key-packet-formats">
* LibrePGP - Public-Key Packet Formats</a>
*/
Expand Down
14 changes: 7 additions & 7 deletions pg/src/main/java/org/bouncycastle/bcpg/S2K.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
* </ul>
*
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-3.7">
* rfc4880 - String-to-Key (S2K) Specifiers</a>
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-string-to-key-s2k-specifier">
* C-R - String-to-Key (S2K) Specifier</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-string-to-key-s2k-specifier">
* RFC4880 - String-to-Key (S2K) Specifiers</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-string-to-key-s2k-specifier">
* RFC9580 - String-to-Key (S2K) Specifier</a>
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-01.html#name-string-to-key-s2k-specifier">
* LibrePGP - String-to-Key (S2K) Specifiers</a>
*/
public class S2K
Expand Down Expand Up @@ -480,8 +480,8 @@ private void writeOneOctetOrThrow(BCPGOutputStream out, int val, String valName)

/**
* Parameters for Argon2 S2K.
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-argon2">
* C-R - Argon2</a>
* @see <a href="https://www.rfc-editor.org/rfc/rfc9580.html#name-argon2">
* OpenPGP - Argon2</a>
*/
public static class Argon2Params
{
Expand Down Expand Up @@ -555,7 +555,7 @@ public Argon2Params(byte[] salt, int passes, int parallelism, int memSizeExp)

// log₂p = logₑp / logₑ2
double log2_p = Math.log(parallelism) / Math.log(2);
// see https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-05.html#section-3.7.1.4-5
// see https://www.rfc-editor.org/rfc/rfc9580.html#section-3.7.1.4-5
if (memSizeExp < (3 + Math.ceil(log2_p)) || memSizeExp > 31)
{
throw new IllegalArgumentException("Memory size exponent MUST be between 3 + ⌈log₂(parallelism)⌉ and 31");
Expand Down
Loading