Skip to content

Commit

Permalink
Add documentation for AEADAlgorithmTags
Browse files Browse the repository at this point in the history
  • Loading branch information
vanitasvitae committed May 7, 2024
1 parent d7ffa8b commit a610c98
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions pg/src/main/java/org/bouncycastle/bcpg/AEADAlgorithmTags.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
package org.bouncycastle.bcpg;

/**
* 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.
*
* @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.ietf.org/archive/id/draft-koch-librepgp-00.html#name-encryption-modes">
* LibrePGP - Encryption Modes</a>
*/
public interface AEADAlgorithmTags
{
int EAX = 1; // EAX (IV len: 16 octets, Tag len: 16 octets)
int OCB = 2; // OCB (IV len: 15 octets, Tag len: 16 octets)
int GCM = 3; // GCM (IV len: 12 octets, Tag len: 16 octets)
/**
* EAX with 16-bit nonce/IV and 16-bit auth tag length.
*/
int EAX = 1;
/**
* OCB with 15-bit nonce/IV and 16-bit auth tag length.
* C-R compliant implementations MUST implement OCB.
*/
int OCB = 2;
/**
* GCM with 12-bit nonce/IV and 16-bit auth tag length.
* OpenPGP only.
*/
int GCM = 3;

// 100 to 110: Experimental algorithms
}

0 comments on commit a610c98

Please sign in to comment.