Class BcAEADUtil
java.lang.Object
org.bouncycastle.openpgp.operator.bc.BcAEADUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.crypto.modes.AEADBlockCiphercreateAEADCipher(int encAlgorithm, int aeadAlgorithm) protected static longgetChunkLength(int chunkSize) Calculate an actual chunk length from the encoded chunk size.protected static byte[]getNonce(byte[] iv, long chunkIndex) Generate a nonce by xor-ing the given iv with the chunk index.protected static voidxorChunkId(byte[] nonce, long chunkIndex) XOR the byte array with the chunk index in-place.
-
Constructor Details
-
BcAEADUtil
public BcAEADUtil()
-
-
Method Details
-
getNonce
protected static byte[] getNonce(byte[] iv, long chunkIndex) Generate a nonce by xor-ing the given iv with the chunk index.- Parameters:
iv- initialization vectorchunkIndex- chunk index- Returns:
- nonce
-
xorChunkId
protected static void xorChunkId(byte[] nonce, long chunkIndex) XOR the byte array with the chunk index in-place.- Parameters:
nonce- byte arraychunkIndex- chunk index
-
getChunkLength
protected static long getChunkLength(int chunkSize) Calculate an actual chunk length from the encoded chunk size.- Parameters:
chunkSize- encoded chunk size- Returns:
- decoded length
-
createAEADCipher
public static org.bouncycastle.crypto.modes.AEADBlockCipher createAEADCipher(int encAlgorithm, int aeadAlgorithm) throws PGPException - Throws:
PGPException
-