1package org.bouncycastle.crypto.params;
2
3import org.bouncycastle.crypto.CipherParameters;
4
5public class AEADParameters
6    implements CipherParameters
7{
8    private byte[] associatedText;
9    private byte[] nonce;
10    private KeyParameter key;
11    private int macSize;
12
13    /**
14     * Base constructor.
15     *
16     * @param key key to be used by underlying cipher
17     * @param macSize macSize in bits
18     * @param nonce nonce to be used
19     * @param associatedText associated text, if any
20     */
21    public AEADParameters(KeyParameter key, int macSize, byte[] nonce, byte[] associatedText)
22    {
23        this.key = key;
24        this.nonce = nonce;
25        this.macSize = macSize;
26        this.associatedText = associatedText;
27    }
28
29    public KeyParameter getKey()
30    {
31        return key;
32    }
33
34    public int getMacSize()
35    {
36        return macSize;
37    }
38
39    public byte[] getAssociatedText()
40    {
41        return associatedText;
42    }
43
44    public byte[] getNonce()
45    {
46        return nonce;
47    }
48}
49