public final class LinkEncryption
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
HEADER_SIZE |
private static int |
IV_LENGTH |
private mybouncycastle.org.bouncycastle.crypto.modes.GCMBlockCipher |
m_cipherDecrypt |
private mybouncycastle.org.bouncycastle.crypto.modes.GCMBlockCipher |
m_cipherEncrypt |
private byte[] |
m_decryptIV |
private MyAEADParameters |
m_decryptKeySpec |
private byte[] |
m_decryptPlainLinkHeader |
private Counter |
m_encryptCounter |
private byte[] |
m_encryptIV |
private MyAEADParameters |
m_encryptKeySpec |
private byte[] |
m_plainHeader |
static int |
OVERHEAD |
Constructor and Description |
---|
LinkEncryption(byte[] linkKey) |
Modifier and Type | Method and Description |
---|---|
IPacket |
decrypt(byte[] packetBytes) |
int |
encrypt(IPacket packet,
byte[] encryptedBytes) |
private static final int HEADER_SIZE
public static final int OVERHEAD
private static final int IV_LENGTH
private final mybouncycastle.org.bouncycastle.crypto.modes.GCMBlockCipher m_cipherEncrypt
private final byte[] m_encryptIV
private MyAEADParameters m_encryptKeySpec
private final Counter m_encryptCounter
private final byte[] m_plainHeader
private final mybouncycastle.org.bouncycastle.crypto.modes.GCMBlockCipher m_cipherDecrypt
private final byte[] m_decryptIV
private MyAEADParameters m_decryptKeySpec
private final byte[] m_decryptPlainLinkHeader
public int encrypt(IPacket packet, byte[] encryptedBytes) throws EncryptionFailed
EncryptionFailed
public IPacket decrypt(byte[] packetBytes) throws DecryptionFailed
DecryptionFailed
Copyright © 2023. All rights reserved.