Restructure "net" packages
This commit is contained in:
27
src/main/java/net/encryption/ClientCyphers.java
Normal file
27
src/main/java/net/encryption/ClientCyphers.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package net.encryption;
|
||||
|
||||
import constants.net.ServerConstants;
|
||||
|
||||
public class ClientCyphers {
|
||||
private final MapleAESOFB send;
|
||||
private final MapleAESOFB receive;
|
||||
|
||||
private ClientCyphers(MapleAESOFB send, MapleAESOFB receive) {
|
||||
this.send = send;
|
||||
this.receive = receive;
|
||||
}
|
||||
|
||||
public static ClientCyphers of(InitializationVector sendIv, InitializationVector receiveIv) {
|
||||
MapleAESOFB send = new MapleAESOFB(sendIv, (short) (0xFFFF - ServerConstants.VERSION));
|
||||
MapleAESOFB receive = new MapleAESOFB(receiveIv, ServerConstants.VERSION);
|
||||
return new ClientCyphers(send, receive);
|
||||
}
|
||||
|
||||
public MapleAESOFB getSendCypher() {
|
||||
return send;
|
||||
}
|
||||
|
||||
public MapleAESOFB getReceiveCypher() {
|
||||
return receive;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user