package aalg.algebra;

/**
 * Domain parameters of discrete logarithm system.
 * @author Ing. Petr Ležák
 *
 * @param <T> type of group element
 */
public class DlDomainParameters<T extends IElement> {

	private final IGroup<T> group;
	
	private final SubGroupDefinition<T> fullSubGroup;   // Subgroup that contains all elements of the group
	private final SubGroupDefinition<T> primeSubGroup;   // Subgroup that has prime order

	/**
	 * Creates domain parameters.
	 * @param group
	 * @param fullSubGroup subgroup that contains all elements of the group
	 * @param primeSubGroup subgroup that has prime order
	 */
	public DlDomainParameters(final IGroup<T> group, final SubGroupDefinition<T> fullSubGroup, final SubGroupDefinition<T> primeSubGroup) {
		this.group = group;
		this.fullSubGroup = fullSubGroup;
		this.primeSubGroup = primeSubGroup;
	}

	/**
	 * Returns group.
	 * @return group
	 */
	public IGroup<T> getGroup() {
		return group;
	}

	/**
	 * Returns full subgroup
	 * @return subgroup that contains all elements of the group
	 */
	public SubGroupDefinition<T> getFullSubGroup() {
		return fullSubGroup;
	}

	/**
	 * Returns prime subgroup.
	 * @return subgroup that has prime order
	 */
	public SubGroupDefinition<T> getPrimeSubGroup() {
		return primeSubGroup;
	}

}
