diff options
Diffstat (limited to 'src/common/des.c')
-rw-r--r-- | src/common/des.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common/des.c b/src/common/des.c index ce64309f3..c811dd96c 100644 --- a/src/common/des.c +++ b/src/common/des.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -24,6 +24,9 @@ #include "common/cbasetypes.h" +struct des_interface des_s; +struct des_interface *des; + /// DES (Data Encryption Standard) algorithm, modified version. /// @see http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5099. /// @see http://en.wikipedia.org/wiki/Data_Encryption_Standard @@ -232,5 +235,12 @@ void des_decrypt(unsigned char* data, size_t size) size_t i; for( i = 0; i*8 < size; i += 8 ) - des_decrypt_block(p); + des->decrypt_block(p); +} + +void des_defaults(void) +{ + des = &des_s; + des->decrypt = des_decrypt; + des->decrypt_block = des_decrypt_block; } |