forked from bcgit/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for AEADAlgorithmTags
- Loading branch information
1 parent
d7ffa8b
commit a610c98
Showing
1 changed file
with
26 additions
and
3 deletions.
There are no files selected for viewing
29 changes: 26 additions & 3 deletions
29
pg/src/main/java/org/bouncycastle/bcpg/AEADAlgorithmTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |