| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef MD5_H |
| 20 | #define MD5_Hcxx . . $ `md5/md5.h:20:9`! |
| 21 | |
| 22 | #include <array> |
| 23 | #include <cstdint> |
| 24 | |
| 25 | class MD5cxx . . $ MD5# { |
| 26 | private: |
| 27 | stdcxx . . $ std/::arraycxx . . $ std/array#<stdcxx . . $ std/::uint32_tcxx . . $ std/uint32_t#, 4> sums_cxx . . $ MD5#sums_.{0x67452301UL, 0XEFCDAB89UL, 0x98BADCFEUL, 0x10325476UL}; |
| 28 | stdcxx . . $ std/::arraycxx . . $ std/array#<uint8_tcxx . . $ uint8_t#, 64> tmpbuf_cxx . . $ MD5#tmpbuf_.; |
| 29 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# tmpbuf_n_cxx . . $ MD5#tmpbuf_n_.{0}; |
| 30 | stdcxx . . $ std/::uint64_tcxx . . $ std/uint64_t# message_len_cxx . . $ MD5#message_len_.{0}; |
| 31 | |
| 32 | void roundcxx . . $ MD5#round(edd025765e4e5935).(const uint8_tcxx . . $ uint8_t# *block) noexcept; |
| 33 | void roundcxx . . $ MD5#round(5fa761607a5a5a5a).(stdcxx . . $ std/::arraycxx . . $ std/array#<stdcxx . . $ std/::uint32_tcxx . . $ std/uint32_t#, 4> &sums, const uint8_tcxx . . $ uint8_t# *block) const noexcept; |
| 34 | void place_lengthcxx . . $ MD5#place_length(2c93ef52c863c53f).(uint8_tcxx . . $ uint8_t# *destination) const noexcept; |
| 35 | |
| 36 | public: |
| 37 | void updatecxx . . $ MD5#update(d0cd15426258c4d3).(const uint8_tcxx . . $ uint8_t# *data, stdcxx . . $ std/::size_tcxx . . $ std/size_t# n) noexcept; |
| 38 | void updatecxx . . $ MD5#update(75096ca55fa6cf9c).(float val) noexcept; |
| 39 | void updatecxx . . $ MD5#update(f349c77f591a7878).(int val) noexcept; |
| 40 | void updatecxx . . $ MD5#update(6bab9b75950d6f3).(uint32_tcxx . . $ uint32_t# val) noexcept; |
| 41 | void updatecxx . . $ MD5#update(2008a3f7800ba735).(uint8_tcxx . . $ uint8_t# val) noexcept; |
| 42 | void updatecxx . . $ MD5#update(e258ceb3f488048a).(int16_tcxx . . $ int16_t# val) noexcept; |
| 43 | stdcxx . . $ std/::arraycxx . . $ std/array#<uint8_tcxx . . $ uint8_t#, 16> digestcxx . . $ MD5#digest(8552f21bb2c3f060).() const noexcept; |
| 44 | void digestcxx . . $ MD5#digest(2c93ef52c863c53f).(uint8_tcxx . . $ uint8_t# *destination) const noexcept; |
| 45 | }; |
| 46 | |
| 47 | #endif // MD5_H |