<commit_before>package com.wesabe.grendel.openpgp;

import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.RSAKeyGenParameterSpec;

import org.bouncycastle.bcpg.PublicKeyAlgorithmTags;

import com.wesabe.grendel.util.IntegerEquivalent;

/**
 * An asymmetric encryption or signing algorithm for OpenPGP messages.
 * 
 * @author coda
 * @see <a href="http://www.ietf.org/rfc/rfc4880.txt">Section 9.1, RFC 4880</a>
 */
public enum AsymmetricAlgorithm implements IntegerEquivalent {
	/**
	 * Elgamal (Encrypt-Only)
	 * 
	 * @see <a href="http://en.wikipedia.org/wiki/ElGamal_encryption">Wikipedia</a>
	 */
	ELGAMAL(	"ElGamal",		PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT) {
		@Override
		public AlgorithmParameterSpec getAlgorithmParameterSpec() {
			return new PregeneratedDHParameterSpec();
		}},
	
	/**
	 * DSA (Digital Signature Algorithm)
	 * 
	 * @see <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">Wikipedia</a>
	 */
	DSA(		"DSA",			PublicKeyAlgorithmTags.DSA) {
		@Override
		public AlgorithmParameterSpec getAlgorithmParameterSpec() {
			return new PregeneratedDSAParameterSpec();
		}},
	
	/**
	 * RSA (Encrypt or Sign)
	 * 
	 * @see <a href="http://en.wikipedia.org/wiki/RSA">Wikipedia</a>
	 */
	RSA(		"RSA",			PublicKeyAlgorithmTags.RSA_GENERAL) {
		@Override
		public AlgorithmParameterSpec getAlgorithmParameterSpec() {
			return new RSAKeyGenParameterSpec(2048, RSAKeyGenParameterSpec.F0);
		}},<commit_msg>Use F4 exponent for RSA key generation.<commit_after>package com.wesabe.grendel.openpgp;

import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.RSAKeyGenParameterSpec;

import org.bouncycastle.bcpg.PublicKeyAlgorithmTags;

import com.wesabe.grendel.util.IntegerEquivalent;

/**
 * An asymmetric encryption or signing algorithm for OpenPGP messages.
 * 
 * @author coda
 * @see <a href="http://www.ietf.org/rfc/rfc4880.txt">Section 9.1, RFC 4880</a>
 */
public enum AsymmetricAlgorithm implements IntegerEquivalent {
	/**
	 * Elgamal (Encrypt-Only)
	 * 
	 * @see <a href="http://en.wikipedia.org/wiki/ElGamal_encryption">Wikipedia</a>
	 */
	ELGAMAL(	"ElGamal",		PublicKeyAlgorithmTags.ELGAMAL_ENCRYPT) {
		@Override
		public AlgorithmParameterSpec getAlgorithmParameterSpec() {
			return new PregeneratedDHParameterSpec();
		}},
	
	/**
	 * DSA (Digital Signature Algorithm)
	 * 
	 * @see <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">Wikipedia</a>
	 */
	DSA(		"DSA",			PublicKeyAlgorithmTags.DSA) {
		@Override
		public AlgorithmParameterSpec getAlgorithmParameterSpec() {
			return new PregeneratedDSAParameterSpec();
		}},
	
	/**
	 * RSA (Encrypt or Sign)
	 * 
	 * @see <a href="http://en.wikipedia.org/wiki/RSA">Wikipedia</a>
	 */
	RSA(		"RSA",			PublicKeyAlgorithmTags.RSA_GENERAL) {
		@Override
		public AlgorithmParameterSpec getAlgorithmParameterSpec() {
			return new RSAKeyGenParameterSpec(2048, RSAKeyGenParameterSpec.F4);
		}},
{'fraction_non_alphanumeric': 0.1278118609406953, 'fraction_numerical': 0.010565780504430812, 'mean_word_length': 4.71011673151751, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4669901', 'n_tokens_mistral': 1103, 'n_tokens_neox': 957, 'n_words': 170}