diff options
author | hemagx <hemagx2@gmail.com> | 2016-02-17 14:01:22 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-07-12 20:58:31 +0200 |
commit | a19ecac6d3405652f766eb7b18c7ee6a3270a78b (patch) | |
tree | e4caf7d3cead26529b412dd207275c4c45e239fb /src/common/des.c | |
parent | 4b8dd1cdaadba7ae2200f114a4e11ef62454eaa1 (diff) | |
download | hercules-a19ecac6d3405652f766eb7b18c7ee6a3270a78b.tar.gz hercules-a19ecac6d3405652f766eb7b18c7ee6a3270a78b.tar.bz2 hercules-a19ecac6d3405652f766eb7b18c7ee6a3270a78b.tar.xz hercules-a19ecac6d3405652f766eb7b18c7ee6a3270a78b.zip |
Interface des.c
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; } |