@zerodensity/smb-cpp 0.0.0-bootstrap.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -3
- package/darwin_arm64/libsmb2.1.dylib +0 -0
- package/darwin_arm64/libsmb2.6.1.0.dylib +0 -0
- package/darwin_arm64/libsmb2.dylib +0 -0
- package/darwin_arm64/smb_server_cpp_darwin_arm64 +0 -0
- package/darwin_arm64/third-party/libsmb2/COPYING +24 -0
- package/darwin_arm64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
- package/darwin_arm64/third-party/libsmb2/NOTICE.txt +13 -0
- package/darwin_arm64/third-party/libsmb2/README +413 -0
- package/darwin_arm64/third-party/libsmb2/source/CMakeLists.txt +205 -0
- package/darwin_arm64/third-party/libsmb2/source/COPYING +24 -0
- package/darwin_arm64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
- package/darwin_arm64/third-party/libsmb2/source/Makefile.am +15 -0
- package/darwin_arm64/third-party/libsmb2/source/Makefile.platform +112 -0
- package/darwin_arm64/third-party/libsmb2/source/README +413 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
- package/darwin_arm64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
- package/darwin_arm64/third-party/libsmb2/source/bootstrap +2 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
- package/darwin_arm64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
- package/darwin_arm64/third-party/libsmb2/source/component.mk +5 -0
- package/darwin_arm64/third-party/libsmb2/source/configure.ac +184 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
- package/darwin_arm64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/Makefile.am +54 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/README.md +2 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
- package/darwin_arm64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
- package/darwin_arm64/third-party/libsmb2/source/idf_component.yml +5 -0
- package/darwin_arm64/third-party/libsmb2/source/include/Makefile.am +15 -0
- package/darwin_arm64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/apple/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/asprintf.h +65 -0
- package/darwin_arm64/third-party/libsmb2/source/include/esp/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
- package/darwin_arm64/third-party/libsmb2/source/include/module.modulemap +21 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/README.md +2 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
- package/darwin_arm64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
- package/darwin_arm64/third-party/libsmb2/source/include/portable-endian.h +377 -0
- package/darwin_arm64/third-party/libsmb2/source/include/ps3/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/slist.h +63 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
- package/darwin_arm64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
- package/darwin_arm64/third-party/libsmb2/source/include/xbox/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/Makefile.am +85 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes.c +33 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes.h +29 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/alloc.c +154 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/compat.c +599 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/compat.h +829 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/errors.c +1192 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/hmac.c +245 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/init.c +778 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md4.h +43 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md4c.c +289 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md5.c +249 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/md5.h +76 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/pdu.c +1159 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha-private.h +28 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha.h +334 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha1.c +450 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/socket.c +1502 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/sync.c +988 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/timestamps.c +70 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/unicode.c +307 -0
- package/darwin_arm64/third-party/libsmb2/source/lib/usha.c +345 -0
- package/darwin_arm64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
- package/darwin_arm64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
- package/darwin_arm64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/Makefile.am +34 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/README +28 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/functions.sh +11 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
- package/darwin_arm64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
- package/darwin_arm64/third-party/libsmb2/source/utils/Makefile.am +11 -0
- package/darwin_arm64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
- package/darwin_arm64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
- package/linux_x64/libsmb2.so +0 -0
- package/linux_x64/libsmb2.so.1 +0 -0
- package/linux_x64/libsmb2.so.6.1.0 +0 -0
- package/linux_x64/smb_server_cpp_linux_x64 +0 -0
- package/linux_x64/third-party/libsmb2/COPYING +24 -0
- package/linux_x64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
- package/linux_x64/third-party/libsmb2/NOTICE.txt +13 -0
- package/linux_x64/third-party/libsmb2/README +413 -0
- package/linux_x64/third-party/libsmb2/source/CMakeLists.txt +205 -0
- package/linux_x64/third-party/libsmb2/source/COPYING +24 -0
- package/linux_x64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
- package/linux_x64/third-party/libsmb2/source/Makefile.am +15 -0
- package/linux_x64/third-party/libsmb2/source/Makefile.platform +112 -0
- package/linux_x64/third-party/libsmb2/source/README +413 -0
- package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
- package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
- package/linux_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
- package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
- package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
- package/linux_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
- package/linux_x64/third-party/libsmb2/source/bootstrap +2 -0
- package/linux_x64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
- package/linux_x64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
- package/linux_x64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
- package/linux_x64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
- package/linux_x64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
- package/linux_x64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
- package/linux_x64/third-party/libsmb2/source/component.mk +5 -0
- package/linux_x64/third-party/libsmb2/source/configure.ac +184 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
- package/linux_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
- package/linux_x64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
- package/linux_x64/third-party/libsmb2/source/examples/Makefile.am +54 -0
- package/linux_x64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/README.md +2 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
- package/linux_x64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
- package/linux_x64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
- package/linux_x64/third-party/libsmb2/source/idf_component.yml +5 -0
- package/linux_x64/third-party/libsmb2/source/include/Makefile.am +15 -0
- package/linux_x64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/apple/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/asprintf.h +65 -0
- package/linux_x64/third-party/libsmb2/source/include/esp/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
- package/linux_x64/third-party/libsmb2/source/include/module.modulemap +21 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/README.md +2 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
- package/linux_x64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
- package/linux_x64/third-party/libsmb2/source/include/portable-endian.h +377 -0
- package/linux_x64/third-party/libsmb2/source/include/ps3/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/slist.h +63 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
- package/linux_x64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
- package/linux_x64/third-party/libsmb2/source/include/xbox/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
- package/linux_x64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
- package/linux_x64/third-party/libsmb2/source/lib/Makefile.am +85 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes.c +33 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes.h +29 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
- package/linux_x64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
- package/linux_x64/third-party/libsmb2/source/lib/alloc.c +154 -0
- package/linux_x64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
- package/linux_x64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
- package/linux_x64/third-party/libsmb2/source/lib/compat.c +599 -0
- package/linux_x64/third-party/libsmb2/source/lib/compat.h +829 -0
- package/linux_x64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
- package/linux_x64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
- package/linux_x64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
- package/linux_x64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
- package/linux_x64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
- package/linux_x64/third-party/libsmb2/source/lib/errors.c +1192 -0
- package/linux_x64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
- package/linux_x64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
- package/linux_x64/third-party/libsmb2/source/lib/hmac.c +245 -0
- package/linux_x64/third-party/libsmb2/source/lib/init.c +778 -0
- package/linux_x64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
- package/linux_x64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
- package/linux_x64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
- package/linux_x64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
- package/linux_x64/third-party/libsmb2/source/lib/md4.h +43 -0
- package/linux_x64/third-party/libsmb2/source/lib/md4c.c +289 -0
- package/linux_x64/third-party/libsmb2/source/lib/md5.c +249 -0
- package/linux_x64/third-party/libsmb2/source/lib/md5.h +76 -0
- package/linux_x64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
- package/linux_x64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
- package/linux_x64/third-party/libsmb2/source/lib/pdu.c +1159 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
- package/linux_x64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha-private.h +28 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha.h +334 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha1.c +450 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
- package/linux_x64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
- package/linux_x64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
- package/linux_x64/third-party/libsmb2/source/lib/socket.c +1502 -0
- package/linux_x64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
- package/linux_x64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
- package/linux_x64/third-party/libsmb2/source/lib/sync.c +988 -0
- package/linux_x64/third-party/libsmb2/source/lib/timestamps.c +70 -0
- package/linux_x64/third-party/libsmb2/source/lib/unicode.c +307 -0
- package/linux_x64/third-party/libsmb2/source/lib/usha.c +345 -0
- package/linux_x64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
- package/linux_x64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
- package/linux_x64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
- package/linux_x64/third-party/libsmb2/source/tests/Makefile.am +34 -0
- package/linux_x64/third-party/libsmb2/source/tests/README +28 -0
- package/linux_x64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
- package/linux_x64/third-party/libsmb2/source/tests/functions.sh +11 -0
- package/linux_x64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
- package/linux_x64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
- package/linux_x64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
- package/linux_x64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
- package/linux_x64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
- package/linux_x64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
- package/linux_x64/third-party/libsmb2/source/utils/Makefile.am +11 -0
- package/linux_x64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
- package/linux_x64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
- package/package.json +10 -4
- package/smb2.proto +164 -0
- package/win32_x64/smb2.dll +0 -0
- package/win32_x64/smb_server_cpp_win32_x64.exe +0 -0
- package/win32_x64/third-party/libsmb2/COPYING +24 -0
- package/win32_x64/third-party/libsmb2/LICENCE-LGPL-2.1.txt +502 -0
- package/win32_x64/third-party/libsmb2/NOTICE.txt +13 -0
- package/win32_x64/third-party/libsmb2/README +413 -0
- package/win32_x64/third-party/libsmb2/source/CMakeLists.txt +205 -0
- package/win32_x64/third-party/libsmb2/source/COPYING +24 -0
- package/win32_x64/third-party/libsmb2/source/LICENCE-LGPL-2.1.txt +502 -0
- package/win32_x64/third-party/libsmb2/source/Makefile.am +15 -0
- package/win32_x64/third-party/libsmb2/source/Makefile.platform +112 -0
- package/win32_x64/third-party/libsmb2/source/README +413 -0
- package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.sln +25 -0
- package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj +248 -0
- package/win32_x64/third-party/libsmb2/source/Xbox/libsmb2.vcxproj.filters +304 -0
- package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.sln +32 -0
- package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj +327 -0
- package/win32_x64/third-party/libsmb2/source/Xbox 360/libsmb2.vcxproj.filters +268 -0
- package/win32_x64/third-party/libsmb2/source/bootstrap +2 -0
- package/win32_x64/third-party/libsmb2/source/cmake/ConfigureChecks.cmake +63 -0
- package/win32_x64/third-party/libsmb2/source/cmake/FindSMB2.cmake +37 -0
- package/win32_x64/third-party/libsmb2/source/cmake/Modules/FindGSSAPI.cmake +30 -0
- package/win32_x64/third-party/libsmb2/source/cmake/Modules/FindLibKrb5.cmake +44 -0
- package/win32_x64/third-party/libsmb2/source/cmake/config.h.cmake +126 -0
- package/win32_x64/third-party/libsmb2/source/cmake/libsmb2.pc.cmake +14 -0
- package/win32_x64/third-party/libsmb2/source/component.mk +5 -0
- package/win32_x64/third-party/libsmb2/source/configure.ac +184 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareAdd.yaml +9 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareCheck.yaml +4 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDel.yaml +5 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareDelSticky.yaml +5 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareEnum.yaml +7 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareGetInfo.yaml +6 -0
- package/win32_x64/third-party/libsmb2/source/dcerpc-examples/srvsvc-NetrShareSetInfo.yaml +11 -0
- package/win32_x64/third-party/libsmb2/source/examples/CMakeLists.txt +28 -0
- package/win32_x64/third-party/libsmb2/source/examples/Makefile.am +54 -0
- package/win32_x64/third-party/libsmb2/source/examples/dcerpc.c +254 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/CMakeLists.txt +72 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/README.md +2 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/main.cpp +119 -0
- package/win32_x64/third-party/libsmb2/source/examples/picow/smb-ls-sync.c +0 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-CMD-FIND.c +335 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-cat-async.c +183 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-cat-sync.c +105 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-ftruncate-sync.c +87 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-ls-async.c +185 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-ls-epoll.c +234 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-lsa-lookupsids.c +292 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-lseek-sync.c +101 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-notify.c +183 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-put-async.c +175 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-put-sync.c +100 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-fsstat-async.c +353 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-getsd-async.c +401 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-raw-stat-async.c +448 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-readlink.c +80 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-rename-sync.c +80 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-server-sync.c +497 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-share-enum-sync.c +146 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-share-enum.c +208 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-share-info.c +255 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-stat-sync.c +103 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-statvfs-sync.c +85 -0
- package/win32_x64/third-party/libsmb2/source/examples/smb2-truncate-sync.c +78 -0
- package/win32_x64/third-party/libsmb2/source/idf_component.yml +5 -0
- package/win32_x64/third-party/libsmb2/source/include/Makefile.am +15 -0
- package/win32_x64/third-party/libsmb2/source/include/amiga_os/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/apple/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/asprintf.h +65 -0
- package/win32_x64/third-party/libsmb2/source/include/esp/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/libsmb2-private.h +670 -0
- package/win32_x64/third-party/libsmb2/source/include/module.modulemap +21 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/FreeRTOSConfig.h +143 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/README.md +2 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/lwipopts.h +27 -0
- package/win32_x64/third-party/libsmb2/source/include/picow/lwipopts_examples_common.h +90 -0
- package/win32_x64/third-party/libsmb2/source/include/portable-endian.h +377 -0
- package/win32_x64/third-party/libsmb2/source/include/ps3/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/slist.h +63 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-lsa.h +172 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc-srvsvc.h +276 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-dcerpc.h +203 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2-raw.h +497 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/libsmb2.h +1409 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/smb2-errors.h +549 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/smb2-ioctl.h +83 -0
- package/win32_x64/third-party/libsmb2/source/include/smb2/smb2.h +1251 -0
- package/win32_x64/third-party/libsmb2/source/include/xbox/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/include/xbox 360/config.h +139 -0
- package/win32_x64/third-party/libsmb2/source/lib/CMakeLists.txt +260 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA +46 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_AROS +59 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.AMIGA_OS3 +59 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.PS3_PPU +100 -0
- package/win32_x64/third-party/libsmb2/source/lib/Makefile.am +85 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes.c +33 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes.h +29 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes128ccm.c +185 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes128ccm.h +28 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_apple.c +70 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_apple.h +34 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_reference.c +560 -0
- package/win32_x64/third-party/libsmb2/source/lib/aes_reference.h +49 -0
- package/win32_x64/third-party/libsmb2/source/lib/alloc.c +154 -0
- package/win32_x64/third-party/libsmb2/source/lib/asn1-ber.c +1078 -0
- package/win32_x64/third-party/libsmb2/source/lib/asn1-ber.h +161 -0
- package/win32_x64/third-party/libsmb2/source/lib/compat.c +599 -0
- package/win32_x64/third-party/libsmb2/source/lib/compat.h +829 -0
- package/win32_x64/third-party/libsmb2/source/lib/dcerpc-lsa.c +641 -0
- package/win32_x64/third-party/libsmb2/source/lib/dcerpc-srvsvc.c +885 -0
- package/win32_x64/third-party/libsmb2/source/lib/dcerpc.c +2513 -0
- package/win32_x64/third-party/libsmb2/source/lib/dreamcast/vfs.c +328 -0
- package/win32_x64/third-party/libsmb2/source/lib/dreamcast/vfs.h +15 -0
- package/win32_x64/third-party/libsmb2/source/lib/errors.c +1192 -0
- package/win32_x64/third-party/libsmb2/source/lib/hmac-md5.c +84 -0
- package/win32_x64/third-party/libsmb2/source/lib/hmac-md5.h +42 -0
- package/win32_x64/third-party/libsmb2/source/lib/hmac.c +245 -0
- package/win32_x64/third-party/libsmb2/source/lib/init.c +778 -0
- package/win32_x64/third-party/libsmb2/source/lib/krb5-wrapper.c +1072 -0
- package/win32_x64/third-party/libsmb2/source/lib/krb5-wrapper.h +134 -0
- package/win32_x64/third-party/libsmb2/source/lib/libsmb2.c +4292 -0
- package/win32_x64/third-party/libsmb2/source/lib/libsmb2.syms +168 -0
- package/win32_x64/third-party/libsmb2/source/lib/md4.h +43 -0
- package/win32_x64/third-party/libsmb2/source/lib/md4c.c +289 -0
- package/win32_x64/third-party/libsmb2/source/lib/md5.c +249 -0
- package/win32_x64/third-party/libsmb2/source/lib/md5.h +76 -0
- package/win32_x64/third-party/libsmb2/source/lib/ntlmssp.c +1380 -0
- package/win32_x64/third-party/libsmb2/source/lib/ntlmssp.h +84 -0
- package/win32_x64/third-party/libsmb2/source/lib/pdu.c +1159 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/TODO +6 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/imports.lst +84 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/irx_imports.h +28 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/ps2smb2.h +35 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.c +816 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2_fio.h +15 -0
- package/win32_x64/third-party/libsmb2/source/lib/ps2/smb2man.c +69 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha-private.h +28 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha.h +334 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha1.c +450 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha224-256.c +611 -0
- package/win32_x64/third-party/libsmb2/source/lib/sha384-512.c +1059 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-close.c +240 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-create.c +508 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-echo.c +202 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-error.c +157 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-flush.c +207 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-ioctl.c +445 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-lock.c +312 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-logoff.c +190 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-negotiate.c +646 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-notify-change.c +278 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-oplock-break.c +543 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-query-directory.c +580 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-query-info.c +753 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-read.c +391 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-session-setup.c +331 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-set-info.c +361 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-connect.c +278 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-tree-disconnect.c +171 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-cmd-write.c +319 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-file-info.c +537 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-filesystem-info.c +384 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-reparse-point.c +117 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-data-security-descriptor.c +361 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-share-enum.c +181 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-signing.c +279 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb2-signing.h +51 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb3-seal.c +165 -0
- package/win32_x64/third-party/libsmb2/source/lib/smb3-seal.h +43 -0
- package/win32_x64/third-party/libsmb2/source/lib/socket.c +1502 -0
- package/win32_x64/third-party/libsmb2/source/lib/spnego-wrapper.c +634 -0
- package/win32_x64/third-party/libsmb2/source/lib/spnego-wrapper.h +74 -0
- package/win32_x64/third-party/libsmb2/source/lib/sync.c +988 -0
- package/win32_x64/third-party/libsmb2/source/lib/timestamps.c +70 -0
- package/win32_x64/third-party/libsmb2/source/lib/unicode.c +307 -0
- package/win32_x64/third-party/libsmb2/source/lib/usha.c +345 -0
- package/win32_x64/third-party/libsmb2/source/libsmb2.pc.in +14 -0
- package/win32_x64/third-party/libsmb2/source/packaging/RPM/libsmb2.spec.in +135 -0
- package/win32_x64/third-party/libsmb2/source/packaging/RPM/makerpms.sh +114 -0
- package/win32_x64/third-party/libsmb2/source/tests/Makefile.am +34 -0
- package/win32_x64/third-party/libsmb2/source/tests/README +28 -0
- package/win32_x64/third-party/libsmb2/source/tests/aes128ccm-test.c +119 -0
- package/win32_x64/third-party/libsmb2/source/tests/functions.sh +11 -0
- package/win32_x64/third-party/libsmb2/source/tests/ld_sockerr.c +58 -0
- package/win32_x64/third-party/libsmb2/source/tests/metastat-0202-censored.c +136 -0
- package/win32_x64/third-party/libsmb2/source/tests/ntlmssp_generate_blob.c +123 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_cat.c +188 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_cat_cancel.c +203 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_ls.c +189 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_mkdir.c +85 -0
- package/win32_x64/third-party/libsmb2/source/tests/prog_rmdir.c +84 -0
- package/win32_x64/third-party/libsmb2/source/tests/smb2-dcerpc-coder-test.c +635 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0100_ls_basic.sh +22 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0101_ls_basic_valgrind.sh +23 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0102_ls_basic_socket_error.sh +16 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0103_ls_basic_valgrind_malloc_error.sh +25 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0200_mkdir.sh +15 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0201_mkdir_valgrind.sh +15 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0210_cp_basic.sh +25 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0211_cp_valgrind.sh +26 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0212_cp_valgrind_socket_error.sh +29 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0300_cat_basic.sh +13 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0301_cat_valgrind.sh +13 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0302_cat_valgrind_socket_error.sh +18 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0310_cancel_pdu.sh +13 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_0400_overdrawn_0202.sh +25 -0
- package/win32_x64/third-party/libsmb2/source/tests/test_900_dcerpc.sh +10 -0
- package/win32_x64/third-party/libsmb2/source/utils/Makefile.am +11 -0
- package/win32_x64/third-party/libsmb2/source/utils/smb2-cp.c +265 -0
- package/win32_x64/third-party/libsmb2/source/utils/smb2-ls.c +135 -0
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
/*************************** sha384-512.c ***************************/
|
|
2
|
+
/********************* See RFC 4634 for details *********************/
|
|
3
|
+
/*
|
|
4
|
+
* Description:
|
|
5
|
+
* This file implements the Secure Hash Signature Standard
|
|
6
|
+
* algorithms as defined in the National Institute of Standards
|
|
7
|
+
* and Technology Federal Information Processing Standards
|
|
8
|
+
* Publication (FIPS PUB) 180-1 published on April 17, 1995, 180-2
|
|
9
|
+
* published on August 1, 2002, and the FIPS PUB 180-2 Change
|
|
10
|
+
* Notice published on February 28, 2004.
|
|
11
|
+
*
|
|
12
|
+
* A combined document showing all algorithms is available at
|
|
13
|
+
* http://csrc.nist.gov/publications/fips/
|
|
14
|
+
* fips180-2/fips180-2withchangenotice.pdf
|
|
15
|
+
*
|
|
16
|
+
* The SHA-384 and SHA-512 algorithms produce 384-bit and 512-bit
|
|
17
|
+
* message digests for a given data stream. It should take about
|
|
18
|
+
* 2**n steps to find a message with the same digest as a given
|
|
19
|
+
* message and 2**(n/2) to find any two messages with the same
|
|
20
|
+
* digest, when n is the digest size in bits. Therefore, this
|
|
21
|
+
* algorithm can serve as a means of providing a
|
|
22
|
+
* "fingerprint" for a message.
|
|
23
|
+
*
|
|
24
|
+
* Portability Issues:
|
|
25
|
+
* SHA-384 and SHA-512 are defined in terms of 64-bit "words",
|
|
26
|
+
* but if USE_32BIT_ONLY is #defined, this code is implemented in
|
|
27
|
+
* terms of 32-bit "words". This code uses <stdint.h> (included
|
|
28
|
+
* via "sha.h") to define the 64, 32 and 8 bit unsigned integer
|
|
29
|
+
* types. If your C compiler does not support 64 bit unsigned
|
|
30
|
+
* integers, and you do not #define USE_32BIT_ONLY, this code is
|
|
31
|
+
* not appropriate.
|
|
32
|
+
*
|
|
33
|
+
* Caveats:
|
|
34
|
+
* SHA-384 and SHA-512 are designed to work with messages less
|
|
35
|
+
* than 2^128 bits long. This implementation uses
|
|
36
|
+
* SHA384/512Input() to hash the bits that are a multiple of the
|
|
37
|
+
* size of an 8-bit character, and then uses SHA384/256FinalBits()
|
|
38
|
+
* to hash the final few bits of the input.
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
#include "compat.h"
|
|
43
|
+
|
|
44
|
+
#include "sha.h"
|
|
45
|
+
#include "sha-private.h"
|
|
46
|
+
|
|
47
|
+
#if defined(USE_SHA384_SHA512) && USE_SHA384_SHA512
|
|
48
|
+
|
|
49
|
+
#ifdef USE_32BIT_ONLY
|
|
50
|
+
/*
|
|
51
|
+
* Define 64-bit arithmetic in terms of 32-bit arithmetic.
|
|
52
|
+
* Each 64-bit number is represented in a 2-word array.
|
|
53
|
+
* All macros are defined such that the result is the last parameter.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* Define shift, rotate left and rotate right functions
|
|
58
|
+
*/
|
|
59
|
+
#define SHA512_SHR(bits, word, ret) ( \
|
|
60
|
+
/* (((uint64_t)((word))) >> (bits)) */ \
|
|
61
|
+
(ret)[0] = (((bits) < 32) && ((bits) >= 0)) ? \
|
|
62
|
+
((word)[0] >> (bits)) : 0, \
|
|
63
|
+
(ret)[1] = ((bits) > 32) ? ((word)[0] >> ((bits) - 32)) : \
|
|
64
|
+
((bits) == 32) ? (word)[0] : \
|
|
65
|
+
((bits) >= 0) ? \
|
|
66
|
+
(((word)[0] << (32 - (bits))) | \
|
|
67
|
+
((word)[1] >> (bits))) : 0 )
|
|
68
|
+
|
|
69
|
+
#define SHA512_SHL(bits, word, ret) ( \
|
|
70
|
+
/* (((uint64_t)(word)) << (bits)) */ \
|
|
71
|
+
(ret)[0] = ((bits) > 32) ? ((word)[1] << ((bits) - 32)) : \
|
|
72
|
+
((bits) == 32) ? (word)[1] : \
|
|
73
|
+
((bits) >= 0) ? \
|
|
74
|
+
(((word)[0] << (bits)) | \
|
|
75
|
+
((word)[1] >> (32 - (bits)))) : \
|
|
76
|
+
0, \
|
|
77
|
+
(ret)[1] = (((bits) < 32) && ((bits) >= 0)) ? \
|
|
78
|
+
((word)[1] << (bits)) : 0 )
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
* Define 64-bit OR
|
|
82
|
+
*/
|
|
83
|
+
#define SHA512_OR(word1, word2, ret) ( \
|
|
84
|
+
(ret)[0] = (word1)[0] | (word2)[0], \
|
|
85
|
+
(ret)[1] = (word1)[1] | (word2)[1] )
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
* Define 64-bit XOR
|
|
89
|
+
*/
|
|
90
|
+
#define SHA512_XOR(word1, word2, ret) ( \
|
|
91
|
+
(ret)[0] = (word1)[0] ^ (word2)[0], \
|
|
92
|
+
(ret)[1] = (word1)[1] ^ (word2)[1] )
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* Define 64-bit AND
|
|
96
|
+
*/
|
|
97
|
+
#define SHA512_AND(word1, word2, ret) ( \
|
|
98
|
+
(ret)[0] = (word1)[0] & (word2)[0], \
|
|
99
|
+
(ret)[1] = (word1)[1] & (word2)[1] )
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* Define 64-bit TILDA
|
|
103
|
+
*/
|
|
104
|
+
#define SHA512_TILDA(word, ret) \
|
|
105
|
+
( (ret)[0] = ~(word)[0], (ret)[1] = ~(word)[1] )
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
* Define 64-bit ADD
|
|
109
|
+
*/
|
|
110
|
+
#define SHA512_ADD(word1, word2, ret) ( \
|
|
111
|
+
(ret)[1] = (word1)[1], (ret)[1] += (word2)[1], \
|
|
112
|
+
(ret)[0] = (word1)[0] + (word2)[0] + ((ret)[1] < (word1)[1]) )
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Add the 4word value in word2 to word1.
|
|
116
|
+
*/
|
|
117
|
+
#define SHA512_ADDTO4(word1, word2) ( \
|
|
118
|
+
ADDTO4_temp = (word1)[3], \
|
|
119
|
+
(word1)[3] += (word2)[3], \
|
|
120
|
+
ADDTO4_temp2 = (word1)[2], \
|
|
121
|
+
(word1)[2] += (word2)[2] + ((word1)[3] < ADDTO4_temp), \
|
|
122
|
+
ADDTO4_temp = (word1)[1], \
|
|
123
|
+
(word1)[1] += (word2)[1] + ((word1)[2] < ADDTO4_temp2), \
|
|
124
|
+
(word1)[0] += (word2)[0] + ((word1)[1] < ADDTO4_temp) )
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
* Add the 2word value in word2 to word1.
|
|
128
|
+
*/
|
|
129
|
+
#define SHA512_ADDTO2(word1, word2) ( \
|
|
130
|
+
ADDTO2_temp = (word1)[1], \
|
|
131
|
+
(word1)[1] += (word2)[1], \
|
|
132
|
+
(word1)[0] += (word2)[0] + ((word1)[1] < ADDTO2_temp) )
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
* SHA rotate ((word >> bits) | (word << (64-bits)))
|
|
136
|
+
*/
|
|
137
|
+
#define SHA512_ROTR(bits, word, ret) ( \
|
|
138
|
+
SHA512_SHR((bits), (word), ROTR_temp1), \
|
|
139
|
+
SHA512_SHL(64-(bits), (word), ROTR_temp2), \
|
|
140
|
+
SHA512_OR(ROTR_temp1, ROTR_temp2, (ret)) )
|
|
141
|
+
|
|
142
|
+
/*
|
|
143
|
+
* Define the SHA SIGMA and sigma macros
|
|
144
|
+
* SHA512_ROTR(28,word) ^ SHA512_ROTR(34,word) ^ SHA512_ROTR(39,word)
|
|
145
|
+
*/
|
|
146
|
+
#define SHA512_SIGMA0(word, ret) ( \
|
|
147
|
+
SHA512_ROTR(28, (word), SIGMA0_temp1), \
|
|
148
|
+
SHA512_ROTR(34, (word), SIGMA0_temp2), \
|
|
149
|
+
SHA512_ROTR(39, (word), SIGMA0_temp3), \
|
|
150
|
+
SHA512_XOR(SIGMA0_temp2, SIGMA0_temp3, SIGMA0_temp4), \
|
|
151
|
+
SHA512_XOR(SIGMA0_temp1, SIGMA0_temp4, (ret)) )
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
* SHA512_ROTR(14,word) ^ SHA512_ROTR(18,word) ^ SHA512_ROTR(41,word)
|
|
155
|
+
*/
|
|
156
|
+
#define SHA512_SIGMA1(word, ret) ( \
|
|
157
|
+
SHA512_ROTR(14, (word), SIGMA1_temp1), \
|
|
158
|
+
SHA512_ROTR(18, (word), SIGMA1_temp2), \
|
|
159
|
+
SHA512_ROTR(41, (word), SIGMA1_temp3), \
|
|
160
|
+
SHA512_XOR(SIGMA1_temp2, SIGMA1_temp3, SIGMA1_temp4), \
|
|
161
|
+
SHA512_XOR(SIGMA1_temp1, SIGMA1_temp4, (ret)) )
|
|
162
|
+
|
|
163
|
+
/*
|
|
164
|
+
* (SHA512_ROTR( 1,word) ^ SHA512_ROTR( 8,word) ^ SHA512_SHR( 7,word))
|
|
165
|
+
*/
|
|
166
|
+
#define SHA512_sigma0(word, ret) ( \
|
|
167
|
+
SHA512_ROTR( 1, (word), sigma0_temp1), \
|
|
168
|
+
SHA512_ROTR( 8, (word), sigma0_temp2), \
|
|
169
|
+
SHA512_SHR( 7, (word), sigma0_temp3), \
|
|
170
|
+
SHA512_XOR(sigma0_temp2, sigma0_temp3, sigma0_temp4), \
|
|
171
|
+
SHA512_XOR(sigma0_temp1, sigma0_temp4, (ret)) )
|
|
172
|
+
|
|
173
|
+
/*
|
|
174
|
+
* (SHA512_ROTR(19,word) ^ SHA512_ROTR(61,word) ^ SHA512_SHR( 6,word))
|
|
175
|
+
*/
|
|
176
|
+
#define SHA512_sigma1(word, ret) ( \
|
|
177
|
+
SHA512_ROTR(19, (word), sigma1_temp1), \
|
|
178
|
+
SHA512_ROTR(61, (word), sigma1_temp2), \
|
|
179
|
+
SHA512_SHR( 6, (word), sigma1_temp3), \
|
|
180
|
+
SHA512_XOR(sigma1_temp2, sigma1_temp3, sigma1_temp4), \
|
|
181
|
+
SHA512_XOR(sigma1_temp1, sigma1_temp4, (ret)) )
|
|
182
|
+
|
|
183
|
+
#undef SHA_Ch
|
|
184
|
+
#undef SHA_Maj
|
|
185
|
+
|
|
186
|
+
#ifndef USE_MODIFIED_MACROS
|
|
187
|
+
/*
|
|
188
|
+
* These definitions are the ones used in FIPS-180-2, section 4.1.3
|
|
189
|
+
* Ch(x,y,z) ((x & y) ^ (~x & z))
|
|
190
|
+
*/
|
|
191
|
+
#define SHA_Ch(x, y, z, ret) ( \
|
|
192
|
+
SHA512_AND(x, y, Ch_temp1), \
|
|
193
|
+
SHA512_TILDA(x, Ch_temp2), \
|
|
194
|
+
SHA512_AND(Ch_temp2, z, Ch_temp3), \
|
|
195
|
+
SHA512_XOR(Ch_temp1, Ch_temp3, (ret)) )
|
|
196
|
+
/*
|
|
197
|
+
* Maj(x,y,z) (((x)&(y)) ^ ((x)&(z)) ^ ((y)&(z)))
|
|
198
|
+
*/
|
|
199
|
+
#define SHA_Maj(x, y, z, ret) ( \
|
|
200
|
+
SHA512_AND(x, y, Maj_temp1), \
|
|
201
|
+
SHA512_AND(x, z, Maj_temp2), \
|
|
202
|
+
SHA512_AND(y, z, Maj_temp3), \
|
|
203
|
+
SHA512_XOR(Maj_temp2, Maj_temp3, Maj_temp4), \
|
|
204
|
+
SHA512_XOR(Maj_temp1, Maj_temp4, (ret)) )
|
|
205
|
+
|
|
206
|
+
#else /* !USE_32BIT_ONLY */
|
|
207
|
+
/*
|
|
208
|
+
* These definitions are potentially faster equivalents for the ones
|
|
209
|
+
* used in FIPS-180-2, section 4.1.3.
|
|
210
|
+
* ((x & y) ^ (~x & z)) becomes
|
|
211
|
+
* ((x & (y ^ z)) ^ z)
|
|
212
|
+
*/
|
|
213
|
+
#define SHA_Ch(x, y, z, ret) ( \
|
|
214
|
+
(ret)[0] = (((x)[0] & ((y)[0] ^ (z)[0])) ^ (z)[0]), \
|
|
215
|
+
(ret)[1] = (((x)[1] & ((y)[1] ^ (z)[1])) ^ (z)[1]) )
|
|
216
|
+
|
|
217
|
+
/*
|
|
218
|
+
* ((x & y) ^ (x & z) ^ (y & z)) becomes
|
|
219
|
+
* ((x & (y | z)) | (y & z))
|
|
220
|
+
*/
|
|
221
|
+
#define SHA_Maj(x, y, z, ret) ( \
|
|
222
|
+
ret[0] = (((x)[0] & ((y)[0] | (z)[0])) | ((y)[0] & (z)[0])), \
|
|
223
|
+
ret[1] = (((x)[1] & ((y)[1] | (z)[1])) | ((y)[1] & (z)[1])) )
|
|
224
|
+
#endif /* USE_MODIFIED_MACROS */
|
|
225
|
+
|
|
226
|
+
/*
|
|
227
|
+
* add "length" to the length
|
|
228
|
+
*/
|
|
229
|
+
#define SHA384_512AddLength(context, length) ( \
|
|
230
|
+
addTemp[3] = (length), SHA512_ADDTO4((context)->Length, addTemp), \
|
|
231
|
+
(context)->Corrupted = (((context)->Length[3] == 0) && \
|
|
232
|
+
((context)->Length[2] == 0) && ((context)->Length[1] == 0) && \
|
|
233
|
+
((context)->Length[0] < 8)) ? 1 : 0 )
|
|
234
|
+
|
|
235
|
+
/* Local Function Prototypes */
|
|
236
|
+
static void SHA384_512Finalize (SHA512Context * context, uint8_t Pad_Byte);
|
|
237
|
+
static void SHA384_512PadMessage (SHA512Context * context, uint8_t Pad_Byte);
|
|
238
|
+
static void SHA384_512ProcessMessageBlock (SHA512Context * context);
|
|
239
|
+
static int SHA384_512Reset (SHA512Context * context, uint32_t H0[]);
|
|
240
|
+
static int SHA384_512ResultN (SHA512Context * context,
|
|
241
|
+
uint8_t Message_Digest[], int HashSize);
|
|
242
|
+
|
|
243
|
+
/* Initial Hash Values: FIPS-180-2 sections 5.3.3 and 5.3.4 */
|
|
244
|
+
static uint32_t SHA384_H0[SHA512HashSize / 4] = {
|
|
245
|
+
0xCBBB9D5D, 0xC1059ED8, 0x629A292A, 0x367CD507, 0x9159015A,
|
|
246
|
+
0x3070DD17, 0x152FECD8, 0xF70E5939, 0x67332667, 0xFFC00B31,
|
|
247
|
+
0x8EB44A87, 0x68581511, 0xDB0C2E0D, 0x64F98FA7, 0x47B5481D,
|
|
248
|
+
0xBEFA4FA4
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
static uint32_t SHA512_H0[SHA512HashSize / 4] = {
|
|
252
|
+
0x6A09E667, 0xF3BCC908, 0xBB67AE85, 0x84CAA73B, 0x3C6EF372,
|
|
253
|
+
0xFE94F82B, 0xA54FF53A, 0x5F1D36F1, 0x510E527F, 0xADE682D1,
|
|
254
|
+
0x9B05688C, 0x2B3E6C1F, 0x1F83D9AB, 0xFB41BD6B, 0x5BE0CD19,
|
|
255
|
+
0x137E2179
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
#else /* !USE_32BIT_ONLY */
|
|
259
|
+
|
|
260
|
+
/* Define the SHA shift, rotate left and rotate right macro */
|
|
261
|
+
#define SHA512_SHR(bits,word) (((uint64_t)(word)) >> (bits))
|
|
262
|
+
#define SHA512_ROTR(bits,word) ((((uint64_t)(word)) >> (bits)) | \
|
|
263
|
+
(((uint64_t)(word)) << (64-(bits))))
|
|
264
|
+
|
|
265
|
+
/* Define the SHA SIGMA and sigma macros */
|
|
266
|
+
#define SHA512_SIGMA0(word) \
|
|
267
|
+
(SHA512_ROTR(28,word) ^ SHA512_ROTR(34,word) ^ SHA512_ROTR(39,word))
|
|
268
|
+
#define SHA512_SIGMA1(word) \
|
|
269
|
+
(SHA512_ROTR(14,word) ^ SHA512_ROTR(18,word) ^ SHA512_ROTR(41,word))
|
|
270
|
+
#define SHA512_sigma0(word) \
|
|
271
|
+
(SHA512_ROTR( 1,word) ^ SHA512_ROTR( 8,word) ^ SHA512_SHR( 7,word))
|
|
272
|
+
#define SHA512_sigma1(word) \
|
|
273
|
+
(SHA512_ROTR(19,word) ^ SHA512_ROTR(61,word) ^ SHA512_SHR( 6,word))
|
|
274
|
+
|
|
275
|
+
/*
|
|
276
|
+
* add "length" to the length
|
|
277
|
+
*/
|
|
278
|
+
#define SHA384_512AddLength(context, length) \
|
|
279
|
+
(addTemp = context->Length_Low, context->Corrupted = \
|
|
280
|
+
((context->Length_Low += length) < addTemp) && \
|
|
281
|
+
(++context->Length_High == 0) ? 1 : 0)
|
|
282
|
+
|
|
283
|
+
/* Local Function Prototypes */
|
|
284
|
+
static void SHA384_512Finalize (SHA512Context * context, uint8_t Pad_Byte);
|
|
285
|
+
static void SHA384_512PadMessage (SHA512Context * context, uint8_t Pad_Byte);
|
|
286
|
+
static void SHA384_512ProcessMessageBlock (SHA512Context * context);
|
|
287
|
+
static int SHA384_512Reset (SHA512Context * context, uint64_t H0[]);
|
|
288
|
+
static int SHA384_512ResultN (SHA512Context * context,
|
|
289
|
+
uint8_t Message_Digest[], int HashSize);
|
|
290
|
+
|
|
291
|
+
/* Initial Hash Values: FIPS-180-2 sections 5.3.3 and 5.3.4 */
|
|
292
|
+
static uint64_t SHA384_H0[] = {
|
|
293
|
+
0xCBBB9D5DC1059ED8ll, 0x629A292A367CD507ll, 0x9159015A3070DD17ll,
|
|
294
|
+
0x152FECD8F70E5939ll, 0x67332667FFC00B31ll, 0x8EB44A8768581511ll,
|
|
295
|
+
0xDB0C2E0D64F98FA7ll, 0x47B5481DBEFA4FA4ll
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
static uint64_t SHA512_H0[] = {
|
|
299
|
+
0x6A09E667F3BCC908ll, 0xBB67AE8584CAA73Bll, 0x3C6EF372FE94F82Bll,
|
|
300
|
+
0xA54FF53A5F1D36F1ll, 0x510E527FADE682D1ll, 0x9B05688C2B3E6C1Fll,
|
|
301
|
+
0x1F83D9ABFB41BD6Bll, 0x5BE0CD19137E2179ll
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
#endif /* USE_32BIT_ONLY */
|
|
305
|
+
|
|
306
|
+
/*
|
|
307
|
+
* SHA384Reset
|
|
308
|
+
*
|
|
309
|
+
* Description:
|
|
310
|
+
* This function will initialize the SHA384Context in preparation
|
|
311
|
+
* for computing a new SHA384 message digest.
|
|
312
|
+
*
|
|
313
|
+
* Parameters:
|
|
314
|
+
* context: [in/out]
|
|
315
|
+
* The context to reset.
|
|
316
|
+
*
|
|
317
|
+
* Returns:
|
|
318
|
+
* sha Error Code.
|
|
319
|
+
*
|
|
320
|
+
*/
|
|
321
|
+
int
|
|
322
|
+
SHA384Reset (SHA384Context * context)
|
|
323
|
+
{
|
|
324
|
+
return SHA384_512Reset (context, SHA384_H0);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/*
|
|
328
|
+
* SHA384Input
|
|
329
|
+
*
|
|
330
|
+
* Description:
|
|
331
|
+
* This function accepts an array of octets as the next portion
|
|
332
|
+
* of the message.
|
|
333
|
+
*
|
|
334
|
+
* Parameters:
|
|
335
|
+
* context: [in/out]
|
|
336
|
+
* The SHA context to update
|
|
337
|
+
* message_array: [in]
|
|
338
|
+
* An array of characters representing the next portion of
|
|
339
|
+
* the message.
|
|
340
|
+
* length: [in]
|
|
341
|
+
* The length of the message in message_array
|
|
342
|
+
*
|
|
343
|
+
* Returns:
|
|
344
|
+
* sha Error Code.
|
|
345
|
+
*
|
|
346
|
+
*/
|
|
347
|
+
int
|
|
348
|
+
SHA384Input (SHA384Context * context,
|
|
349
|
+
const uint8_t * message_array, size_t length)
|
|
350
|
+
{
|
|
351
|
+
return SHA512Input (context, message_array, length);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/*
|
|
355
|
+
* SHA384FinalBits
|
|
356
|
+
*
|
|
357
|
+
* Description:
|
|
358
|
+
* This function will add in any final bits of the message.
|
|
359
|
+
*
|
|
360
|
+
* Parameters:
|
|
361
|
+
* context: [in/out]
|
|
362
|
+
* The SHA context to update
|
|
363
|
+
* message_bits: [in]
|
|
364
|
+
* The final bits of the message, in the upper portion of the
|
|
365
|
+
* byte. (Use 0b###00000 instead of 0b00000### to input the
|
|
366
|
+
* three bits ###.)
|
|
367
|
+
* length: [in]
|
|
368
|
+
* The number of bits in message_bits, between 1 and 7.
|
|
369
|
+
*
|
|
370
|
+
* Returns:
|
|
371
|
+
* sha Error Code.
|
|
372
|
+
*
|
|
373
|
+
*/
|
|
374
|
+
int
|
|
375
|
+
SHA384FinalBits (SHA384Context * context,
|
|
376
|
+
const uint8_t message_bits, size_t length)
|
|
377
|
+
{
|
|
378
|
+
return SHA512FinalBits (context, message_bits, length);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/*
|
|
382
|
+
* SHA384Result
|
|
383
|
+
*
|
|
384
|
+
* Description:
|
|
385
|
+
* This function will return the 384-bit message
|
|
386
|
+
* digest into the Message_Digest array provided by the caller.
|
|
387
|
+
* NOTE: The first octet of hash is stored in the 0th element,
|
|
388
|
+
* the last octet of hash in the 48th element.
|
|
389
|
+
*
|
|
390
|
+
* Parameters:
|
|
391
|
+
* context: [in/out]
|
|
392
|
+
* The context to use to calculate the SHA hash.
|
|
393
|
+
* Message_Digest: [out]
|
|
394
|
+
* Where the digest is returned.
|
|
395
|
+
*
|
|
396
|
+
* Returns:
|
|
397
|
+
* sha Error Code.
|
|
398
|
+
*
|
|
399
|
+
*/
|
|
400
|
+
int
|
|
401
|
+
SHA384Result (SHA384Context * context, uint8_t Message_Digest[SHA384HashSize])
|
|
402
|
+
{
|
|
403
|
+
return SHA384_512ResultN (context, Message_Digest, SHA384HashSize);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/*
|
|
407
|
+
* SHA512Reset
|
|
408
|
+
*
|
|
409
|
+
* Description:
|
|
410
|
+
* This function will initialize the SHA512Context in preparation
|
|
411
|
+
* for computing a new SHA512 message digest.
|
|
412
|
+
*
|
|
413
|
+
* Parameters:
|
|
414
|
+
* context: [in/out]
|
|
415
|
+
* The context to reset.
|
|
416
|
+
*
|
|
417
|
+
* Returns:
|
|
418
|
+
* sha Error Code.
|
|
419
|
+
*
|
|
420
|
+
*/
|
|
421
|
+
int
|
|
422
|
+
SHA512Reset (SHA512Context * context)
|
|
423
|
+
{
|
|
424
|
+
return SHA384_512Reset (context, SHA512_H0);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/*
|
|
428
|
+
* SHA512Input
|
|
429
|
+
*
|
|
430
|
+
* Description:
|
|
431
|
+
* This function accepts an array of octets as the next portion
|
|
432
|
+
* of the message.
|
|
433
|
+
*
|
|
434
|
+
* Parameters:
|
|
435
|
+
* context: [in/out]
|
|
436
|
+
* The SHA context to update
|
|
437
|
+
* message_array: [in]
|
|
438
|
+
* An array of characters representing the next portion of
|
|
439
|
+
* the message.
|
|
440
|
+
* length: [in]
|
|
441
|
+
* The length of the message in message_array
|
|
442
|
+
*
|
|
443
|
+
* Returns:
|
|
444
|
+
* sha Error Code.
|
|
445
|
+
*
|
|
446
|
+
*/
|
|
447
|
+
int
|
|
448
|
+
SHA512Input (SHA512Context * context,
|
|
449
|
+
const uint8_t * message_array, size_t length)
|
|
450
|
+
{
|
|
451
|
+
#ifdef USE_32BIT_ONLY
|
|
452
|
+
/* nothing */
|
|
453
|
+
#else
|
|
454
|
+
uint64_t addTemp;
|
|
455
|
+
#endif
|
|
456
|
+
|
|
457
|
+
if (!length)
|
|
458
|
+
return shaSuccess;
|
|
459
|
+
|
|
460
|
+
if (!context || !message_array)
|
|
461
|
+
return shaNull;
|
|
462
|
+
|
|
463
|
+
if (context->Computed)
|
|
464
|
+
{
|
|
465
|
+
context->Corrupted = shaStateError;
|
|
466
|
+
return shaStateError;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (context->Corrupted)
|
|
470
|
+
return context->Corrupted;
|
|
471
|
+
|
|
472
|
+
while (length-- && !context->Corrupted)
|
|
473
|
+
{
|
|
474
|
+
context->Message_Block[context->Message_Block_Index++] =
|
|
475
|
+
(*message_array & 0xFF);
|
|
476
|
+
|
|
477
|
+
if (!SHA384_512AddLength (context, 8) &&
|
|
478
|
+
(context->Message_Block_Index == SHA512_Message_Block_Size))
|
|
479
|
+
SHA384_512ProcessMessageBlock (context);
|
|
480
|
+
|
|
481
|
+
message_array++;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return shaSuccess;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/*
|
|
488
|
+
* SHA512FinalBits
|
|
489
|
+
*
|
|
490
|
+
* Description:
|
|
491
|
+
* This function will add in any final bits of the message.
|
|
492
|
+
*
|
|
493
|
+
* Parameters:
|
|
494
|
+
* context: [in/out]
|
|
495
|
+
* The SHA context to update
|
|
496
|
+
* message_bits: [in]
|
|
497
|
+
* The final bits of the message, in the upper portion of the
|
|
498
|
+
* byte. (Use 0b###00000 instead of 0b00000### to input the
|
|
499
|
+
* three bits ###.)
|
|
500
|
+
* length: [in]
|
|
501
|
+
* The number of bits in message_bits, between 1 and 7.
|
|
502
|
+
*
|
|
503
|
+
* Returns:
|
|
504
|
+
* sha Error Code.
|
|
505
|
+
*
|
|
506
|
+
*/
|
|
507
|
+
int
|
|
508
|
+
SHA512FinalBits (SHA512Context * context,
|
|
509
|
+
const uint8_t message_bits, size_t length)
|
|
510
|
+
{
|
|
511
|
+
#ifdef USE_32BIT_ONLY
|
|
512
|
+
/* nothing */
|
|
513
|
+
#else
|
|
514
|
+
uint64_t addTemp;
|
|
515
|
+
#endif
|
|
516
|
+
uint8_t masks[8] = {
|
|
517
|
+
/* 0 0b00000000 */ 0x00, /* 1 0b10000000 */ 0x80,
|
|
518
|
+
/* 2 0b11000000 */ 0xC0, /* 3 0b11100000 */ 0xE0,
|
|
519
|
+
/* 4 0b11110000 */ 0xF0, /* 5 0b11111000 */ 0xF8,
|
|
520
|
+
/* 6 0b11111100 */ 0xFC, /* 7 0b11111110 */ 0xFE
|
|
521
|
+
};
|
|
522
|
+
uint8_t markbit[8] = {
|
|
523
|
+
/* 0 0b10000000 */ 0x80, /* 1 0b01000000 */ 0x40,
|
|
524
|
+
/* 2 0b00100000 */ 0x20, /* 3 0b00010000 */ 0x10,
|
|
525
|
+
/* 4 0b00001000 */ 0x08, /* 5 0b00000100 */ 0x04,
|
|
526
|
+
/* 6 0b00000010 */ 0x02, /* 7 0b00000001 */ 0x01
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
if (!length)
|
|
530
|
+
return shaSuccess;
|
|
531
|
+
|
|
532
|
+
if (!context)
|
|
533
|
+
return shaNull;
|
|
534
|
+
|
|
535
|
+
if ((context->Computed) || (length >= 8) || (length == 0))
|
|
536
|
+
{
|
|
537
|
+
context->Corrupted = shaStateError;
|
|
538
|
+
return shaStateError;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (context->Corrupted)
|
|
542
|
+
return context->Corrupted;
|
|
543
|
+
|
|
544
|
+
SHA384_512AddLength (context, length);
|
|
545
|
+
SHA384_512Finalize (context, (uint8_t)
|
|
546
|
+
((message_bits & masks[length]) | markbit[length]));
|
|
547
|
+
|
|
548
|
+
return shaSuccess;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/*
|
|
552
|
+
* SHA384_512Finalize
|
|
553
|
+
*
|
|
554
|
+
* Description:
|
|
555
|
+
* This helper function finishes off the digest calculations.
|
|
556
|
+
*
|
|
557
|
+
* Parameters:
|
|
558
|
+
* context: [in/out]
|
|
559
|
+
* The SHA context to update
|
|
560
|
+
* Pad_Byte: [in]
|
|
561
|
+
* The last byte to add to the digest before the 0-padding
|
|
562
|
+
* and length. This will contain the last bits of the message
|
|
563
|
+
* followed by another single bit. If the message was an
|
|
564
|
+
* exact multiple of 8-bits long, Pad_Byte will be 0x80.
|
|
565
|
+
*
|
|
566
|
+
* Returns:
|
|
567
|
+
* sha Error Code.
|
|
568
|
+
*
|
|
569
|
+
*/
|
|
570
|
+
static void
|
|
571
|
+
SHA384_512Finalize (SHA512Context * context, uint8_t Pad_Byte)
|
|
572
|
+
{
|
|
573
|
+
int_least16_t i;
|
|
574
|
+
SHA384_512PadMessage (context, Pad_Byte);
|
|
575
|
+
/* message may be sensitive, clear it out */
|
|
576
|
+
for (i = 0; i < SHA512_Message_Block_Size; ++i)
|
|
577
|
+
context->Message_Block[i] = 0;
|
|
578
|
+
#ifdef USE_32BIT_ONLY /* and clear length */
|
|
579
|
+
context->Length[0] = context->Length[1] = 0;
|
|
580
|
+
context->Length[2] = context->Length[3] = 0;
|
|
581
|
+
#else /* !USE_32BIT_ONLY */
|
|
582
|
+
context->Length_Low = 0;
|
|
583
|
+
context->Length_High = 0;
|
|
584
|
+
#endif /* USE_32BIT_ONLY */
|
|
585
|
+
context->Computed = 1;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/*
|
|
589
|
+
* SHA512Result
|
|
590
|
+
*
|
|
591
|
+
* Description:
|
|
592
|
+
* This function will return the 512-bit message
|
|
593
|
+
* digest into the Message_Digest array provided by the caller.
|
|
594
|
+
* NOTE: The first octet of hash is stored in the 0th element,
|
|
595
|
+
* the last octet of hash in the 64th element.
|
|
596
|
+
*
|
|
597
|
+
* Parameters:
|
|
598
|
+
* context: [in/out]
|
|
599
|
+
* The context to use to calculate the SHA hash.
|
|
600
|
+
* Message_Digest: [out]
|
|
601
|
+
* Where the digest is returned.
|
|
602
|
+
*
|
|
603
|
+
* Returns:
|
|
604
|
+
* sha Error Code.
|
|
605
|
+
*
|
|
606
|
+
*/
|
|
607
|
+
int
|
|
608
|
+
SHA512Result (SHA512Context * context, uint8_t Message_Digest[SHA512HashSize])
|
|
609
|
+
{
|
|
610
|
+
return SHA384_512ResultN (context, Message_Digest, SHA512HashSize);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/*
|
|
614
|
+
* SHA384_512PadMessage
|
|
615
|
+
*
|
|
616
|
+
* Description:
|
|
617
|
+
* According to the standard, the message must be padded to an
|
|
618
|
+
* even 1024 bits. The first padding bit must be a '1'. The
|
|
619
|
+
* last 128 bits represent the length of the original message.
|
|
620
|
+
* All bits in between should be 0. This helper function will
|
|
621
|
+
* pad the message according to those rules by filling the
|
|
622
|
+
* Message_Block array accordingly. When it returns, it can be
|
|
623
|
+
* assumed that the message digest has been computed.
|
|
624
|
+
*
|
|
625
|
+
* Parameters:
|
|
626
|
+
* context: [in/out]
|
|
627
|
+
* The context to pad
|
|
628
|
+
* Pad_Byte: [in]
|
|
629
|
+
* The last byte to add to the digest before the 0-padding
|
|
630
|
+
* and length. This will contain the last bits of the message
|
|
631
|
+
* followed by another single bit. If the message was an
|
|
632
|
+
* exact multiple of 8-bits long, Pad_Byte will be 0x80.
|
|
633
|
+
*
|
|
634
|
+
* Returns:
|
|
635
|
+
* Nothing.
|
|
636
|
+
*
|
|
637
|
+
*/
|
|
638
|
+
static void
|
|
639
|
+
SHA384_512PadMessage (SHA512Context * context, uint8_t Pad_Byte)
|
|
640
|
+
{
|
|
641
|
+
/*
|
|
642
|
+
* Check to see if the current message block is too small to hold
|
|
643
|
+
* the initial padding bits and length. If so, we will pad the
|
|
644
|
+
* block, process it, and then continue padding into a second
|
|
645
|
+
* block.
|
|
646
|
+
*/
|
|
647
|
+
if (context->Message_Block_Index >= (SHA512_Message_Block_Size - 16))
|
|
648
|
+
{
|
|
649
|
+
context->Message_Block[context->Message_Block_Index++] = Pad_Byte;
|
|
650
|
+
while (context->Message_Block_Index < SHA512_Message_Block_Size)
|
|
651
|
+
context->Message_Block[context->Message_Block_Index++] = 0;
|
|
652
|
+
|
|
653
|
+
SHA384_512ProcessMessageBlock (context);
|
|
654
|
+
}
|
|
655
|
+
else
|
|
656
|
+
context->Message_Block[context->Message_Block_Index++] = Pad_Byte;
|
|
657
|
+
|
|
658
|
+
while (context->Message_Block_Index < (SHA512_Message_Block_Size - 16))
|
|
659
|
+
context->Message_Block[context->Message_Block_Index++] = 0;
|
|
660
|
+
|
|
661
|
+
/*
|
|
662
|
+
* Store the message length as the last 16 octets
|
|
663
|
+
*/
|
|
664
|
+
#ifdef USE_32BIT_ONLY
|
|
665
|
+
context->Message_Block[112] = (uint8_t) (context->Length[0] >> 24);
|
|
666
|
+
context->Message_Block[113] = (uint8_t) (context->Length[0] >> 16);
|
|
667
|
+
context->Message_Block[114] = (uint8_t) (context->Length[0] >> 8);
|
|
668
|
+
context->Message_Block[115] = (uint8_t) (context->Length[0]);
|
|
669
|
+
context->Message_Block[116] = (uint8_t) (context->Length[1] >> 24);
|
|
670
|
+
context->Message_Block[117] = (uint8_t) (context->Length[1] >> 16);
|
|
671
|
+
context->Message_Block[118] = (uint8_t) (context->Length[1] >> 8);
|
|
672
|
+
context->Message_Block[119] = (uint8_t) (context->Length[1]);
|
|
673
|
+
|
|
674
|
+
context->Message_Block[120] = (uint8_t) (context->Length[2] >> 24);
|
|
675
|
+
context->Message_Block[121] = (uint8_t) (context->Length[2] >> 16);
|
|
676
|
+
context->Message_Block[122] = (uint8_t) (context->Length[2] >> 8);
|
|
677
|
+
context->Message_Block[123] = (uint8_t) (context->Length[2]);
|
|
678
|
+
context->Message_Block[124] = (uint8_t) (context->Length[3] >> 24);
|
|
679
|
+
context->Message_Block[125] = (uint8_t) (context->Length[3] >> 16);
|
|
680
|
+
context->Message_Block[126] = (uint8_t) (context->Length[3] >> 8);
|
|
681
|
+
context->Message_Block[127] = (uint8_t) (context->Length[3]);
|
|
682
|
+
#else /* !USE_32BIT_ONLY */
|
|
683
|
+
context->Message_Block[112] = (uint8_t) (context->Length_High >> 56);
|
|
684
|
+
context->Message_Block[113] = (uint8_t) (context->Length_High >> 48);
|
|
685
|
+
context->Message_Block[114] = (uint8_t) (context->Length_High >> 40);
|
|
686
|
+
context->Message_Block[115] = (uint8_t) (context->Length_High >> 32);
|
|
687
|
+
context->Message_Block[116] = (uint8_t) (context->Length_High >> 24);
|
|
688
|
+
context->Message_Block[117] = (uint8_t) (context->Length_High >> 16);
|
|
689
|
+
context->Message_Block[118] = (uint8_t) (context->Length_High >> 8);
|
|
690
|
+
context->Message_Block[119] = (uint8_t) (context->Length_High);
|
|
691
|
+
|
|
692
|
+
context->Message_Block[120] = (uint8_t) (context->Length_Low >> 56);
|
|
693
|
+
context->Message_Block[121] = (uint8_t) (context->Length_Low >> 48);
|
|
694
|
+
context->Message_Block[122] = (uint8_t) (context->Length_Low >> 40);
|
|
695
|
+
context->Message_Block[123] = (uint8_t) (context->Length_Low >> 32);
|
|
696
|
+
context->Message_Block[124] = (uint8_t) (context->Length_Low >> 24);
|
|
697
|
+
context->Message_Block[125] = (uint8_t) (context->Length_Low >> 16);
|
|
698
|
+
context->Message_Block[126] = (uint8_t) (context->Length_Low >> 8);
|
|
699
|
+
context->Message_Block[127] = (uint8_t) (context->Length_Low);
|
|
700
|
+
#endif /* USE_32BIT_ONLY */
|
|
701
|
+
|
|
702
|
+
SHA384_512ProcessMessageBlock (context);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/*
|
|
706
|
+
* SHA384_512ProcessMessageBlock
|
|
707
|
+
*
|
|
708
|
+
* Description:
|
|
709
|
+
* This helper function will process the next 1024 bits of the
|
|
710
|
+
* message stored in the Message_Block array.
|
|
711
|
+
*
|
|
712
|
+
* Parameters:
|
|
713
|
+
* context: [in/out]
|
|
714
|
+
* The SHA context to update
|
|
715
|
+
*
|
|
716
|
+
* Returns:
|
|
717
|
+
* Nothing.
|
|
718
|
+
*
|
|
719
|
+
* Comments:
|
|
720
|
+
* Many of the variable names in this code, especially the
|
|
721
|
+
* single character names, were used because those were the
|
|
722
|
+
* names used in the publication.
|
|
723
|
+
*
|
|
724
|
+
*
|
|
725
|
+
*/
|
|
726
|
+
static void
|
|
727
|
+
SHA384_512ProcessMessageBlock (SHA512Context * context)
|
|
728
|
+
{
|
|
729
|
+
/* Constants defined in FIPS-180-2, section 4.2.3 */
|
|
730
|
+
#ifdef USE_32BIT_ONLY
|
|
731
|
+
static const uint32_t K[80 * 2] = {
|
|
732
|
+
0x428A2F98, 0xD728AE22, 0x71374491, 0x23EF65CD, 0xB5C0FBCF,
|
|
733
|
+
0xEC4D3B2F, 0xE9B5DBA5, 0x8189DBBC, 0x3956C25B, 0xF348B538,
|
|
734
|
+
0x59F111F1, 0xB605D019, 0x923F82A4, 0xAF194F9B, 0xAB1C5ED5,
|
|
735
|
+
0xDA6D8118, 0xD807AA98, 0xA3030242, 0x12835B01, 0x45706FBE,
|
|
736
|
+
0x243185BE, 0x4EE4B28C, 0x550C7DC3, 0xD5FFB4E2, 0x72BE5D74,
|
|
737
|
+
0xF27B896F, 0x80DEB1FE, 0x3B1696B1, 0x9BDC06A7, 0x25C71235,
|
|
738
|
+
0xC19BF174, 0xCF692694, 0xE49B69C1, 0x9EF14AD2, 0xEFBE4786,
|
|
739
|
+
0x384F25E3, 0x0FC19DC6, 0x8B8CD5B5, 0x240CA1CC, 0x77AC9C65,
|
|
740
|
+
0x2DE92C6F, 0x592B0275, 0x4A7484AA, 0x6EA6E483, 0x5CB0A9DC,
|
|
741
|
+
0xBD41FBD4, 0x76F988DA, 0x831153B5, 0x983E5152, 0xEE66DFAB,
|
|
742
|
+
0xA831C66D, 0x2DB43210, 0xB00327C8, 0x98FB213F, 0xBF597FC7,
|
|
743
|
+
0xBEEF0EE4, 0xC6E00BF3, 0x3DA88FC2, 0xD5A79147, 0x930AA725,
|
|
744
|
+
0x06CA6351, 0xE003826F, 0x14292967, 0x0A0E6E70, 0x27B70A85,
|
|
745
|
+
0x46D22FFC, 0x2E1B2138, 0x5C26C926, 0x4D2C6DFC, 0x5AC42AED,
|
|
746
|
+
0x53380D13, 0x9D95B3DF, 0x650A7354, 0x8BAF63DE, 0x766A0ABB,
|
|
747
|
+
0x3C77B2A8, 0x81C2C92E, 0x47EDAEE6, 0x92722C85, 0x1482353B,
|
|
748
|
+
0xA2BFE8A1, 0x4CF10364, 0xA81A664B, 0xBC423001, 0xC24B8B70,
|
|
749
|
+
0xD0F89791, 0xC76C51A3, 0x0654BE30, 0xD192E819, 0xD6EF5218,
|
|
750
|
+
0xD6990624, 0x5565A910, 0xF40E3585, 0x5771202A, 0x106AA070,
|
|
751
|
+
0x32BBD1B8, 0x19A4C116, 0xB8D2D0C8, 0x1E376C08, 0x5141AB53,
|
|
752
|
+
0x2748774C, 0xDF8EEB99, 0x34B0BCB5, 0xE19B48A8, 0x391C0CB3,
|
|
753
|
+
0xC5C95A63, 0x4ED8AA4A, 0xE3418ACB, 0x5B9CCA4F, 0x7763E373,
|
|
754
|
+
0x682E6FF3, 0xD6B2B8A3, 0x748F82EE, 0x5DEFB2FC, 0x78A5636F,
|
|
755
|
+
0x43172F60, 0x84C87814, 0xA1F0AB72, 0x8CC70208, 0x1A6439EC,
|
|
756
|
+
0x90BEFFFA, 0x23631E28, 0xA4506CEB, 0xDE82BDE9, 0xBEF9A3F7,
|
|
757
|
+
0xB2C67915, 0xC67178F2, 0xE372532B, 0xCA273ECE, 0xEA26619C,
|
|
758
|
+
0xD186B8C7, 0x21C0C207, 0xEADA7DD6, 0xCDE0EB1E, 0xF57D4F7F,
|
|
759
|
+
0xEE6ED178, 0x06F067AA, 0x72176FBA, 0x0A637DC5, 0xA2C898A6,
|
|
760
|
+
0x113F9804, 0xBEF90DAE, 0x1B710B35, 0x131C471B, 0x28DB77F5,
|
|
761
|
+
0x23047D84, 0x32CAAB7B, 0x40C72493, 0x3C9EBE0A, 0x15C9BEBC,
|
|
762
|
+
0x431D67C4, 0x9C100D4C, 0x4CC5D4BE, 0xCB3E42B6, 0x597F299C,
|
|
763
|
+
0xFC657E2A, 0x5FCB6FAB, 0x3AD6FAEC, 0x6C44198C, 0x4A475817
|
|
764
|
+
};
|
|
765
|
+
int t, t2, t8; /* Loop counter */
|
|
766
|
+
uint32_t temp1[2], temp2[2], /* Temporary word values */
|
|
767
|
+
temp3[2], temp4[2], temp5[2];
|
|
768
|
+
uint32_t W[2 * 80]; /* Word sequence */
|
|
769
|
+
uint32_t A[2], B[2], C[2], D[2], /* Word buffers */
|
|
770
|
+
E[2], F[2], G[2], H[2];
|
|
771
|
+
|
|
772
|
+
/* Initialize the first 16 words in the array W */
|
|
773
|
+
for (t = t2 = t8 = 0; t < 16; t++, t8 += 8)
|
|
774
|
+
{
|
|
775
|
+
W[t2++] = ((((uint32_t) context->Message_Block[t8])) << 24) |
|
|
776
|
+
((((uint32_t) context->Message_Block[t8 + 1])) << 16) |
|
|
777
|
+
((((uint32_t) context->Message_Block[t8 + 2])) << 8) |
|
|
778
|
+
((((uint32_t) context->Message_Block[t8 + 3])));
|
|
779
|
+
W[t2++] = ((((uint32_t) context->Message_Block[t8 + 4])) << 24) |
|
|
780
|
+
((((uint32_t) context->Message_Block[t8 + 5])) << 16) |
|
|
781
|
+
((((uint32_t) context->Message_Block[t8 + 6])) << 8) |
|
|
782
|
+
((((uint32_t) context->Message_Block[t8 + 7])));
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
for (t = 16; t < 80; t++, t2 += 2)
|
|
786
|
+
{
|
|
787
|
+
/* W[t] = SHA512_sigma1(W[t-2]) + W[t-7] +
|
|
788
|
+
SHA512_sigma0(W[t-15]) + W[t-16]; */
|
|
789
|
+
uint32_t *Wt2 = &W[t2 - 2 * 2];
|
|
790
|
+
uint32_t *Wt7 = &W[t2 - 7 * 2];
|
|
791
|
+
uint32_t *Wt15 = &W[t2 - 15 * 2];
|
|
792
|
+
uint32_t *Wt16 = &W[t2 - 16 * 2];
|
|
793
|
+
SHA512_sigma1 (Wt2, temp1);
|
|
794
|
+
SHA512_ADD (temp1, Wt7, temp2);
|
|
795
|
+
SHA512_sigma0 (Wt15, temp1);
|
|
796
|
+
SHA512_ADD (temp1, Wt16, temp3);
|
|
797
|
+
SHA512_ADD (temp2, temp3, &W[t2]);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
A[0] = context->Intermediate_Hash[0];
|
|
801
|
+
A[1] = context->Intermediate_Hash[1];
|
|
802
|
+
B[0] = context->Intermediate_Hash[2];
|
|
803
|
+
B[1] = context->Intermediate_Hash[3];
|
|
804
|
+
C[0] = context->Intermediate_Hash[4];
|
|
805
|
+
C[1] = context->Intermediate_Hash[5];
|
|
806
|
+
D[0] = context->Intermediate_Hash[6];
|
|
807
|
+
D[1] = context->Intermediate_Hash[7];
|
|
808
|
+
E[0] = context->Intermediate_Hash[8];
|
|
809
|
+
E[1] = context->Intermediate_Hash[9];
|
|
810
|
+
F[0] = context->Intermediate_Hash[10];
|
|
811
|
+
F[1] = context->Intermediate_Hash[11];
|
|
812
|
+
G[0] = context->Intermediate_Hash[12];
|
|
813
|
+
G[1] = context->Intermediate_Hash[13];
|
|
814
|
+
H[0] = context->Intermediate_Hash[14];
|
|
815
|
+
H[1] = context->Intermediate_Hash[15];
|
|
816
|
+
|
|
817
|
+
for (t = t2 = 0; t < 80; t++, t2 += 2)
|
|
818
|
+
{
|
|
819
|
+
#if 0
|
|
820
|
+
temp1 = H + SHA512_SIGMA1(E) + SHA_Ch(E,F,G) + K[t] + W[t];
|
|
821
|
+
#endif
|
|
822
|
+
SHA512_SIGMA1 (E, temp1);
|
|
823
|
+
SHA512_ADD (H, temp1, temp2);
|
|
824
|
+
SHA_Ch (E, F, G, temp3);
|
|
825
|
+
SHA512_ADD (temp2, temp3, temp4);
|
|
826
|
+
SHA512_ADD (&K[t2], &W[t2], temp5);
|
|
827
|
+
SHA512_ADD (temp4, temp5, temp1);
|
|
828
|
+
#if 0
|
|
829
|
+
temp2 = SHA512_SIGMA0(A) + SHA_Maj(A,B,C);
|
|
830
|
+
#endif
|
|
831
|
+
SHA512_SIGMA0 (A, temp3);
|
|
832
|
+
SHA_Maj (A, B, C, temp4);
|
|
833
|
+
SHA512_ADD (temp3, temp4, temp2);
|
|
834
|
+
H[0] = G[0];
|
|
835
|
+
H[1] = G[1];
|
|
836
|
+
G[0] = F[0];
|
|
837
|
+
G[1] = F[1];
|
|
838
|
+
F[0] = E[0];
|
|
839
|
+
F[1] = E[1];
|
|
840
|
+
SHA512_ADD (D, temp1, E);
|
|
841
|
+
D[0] = C[0];
|
|
842
|
+
D[1] = C[1];
|
|
843
|
+
C[0] = B[0];
|
|
844
|
+
C[1] = B[1];
|
|
845
|
+
B[0] = A[0];
|
|
846
|
+
B[1] = A[1];
|
|
847
|
+
SHA512_ADD (temp1, temp2, A);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[0], A);
|
|
851
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[2], B);
|
|
852
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[4], C);
|
|
853
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[6], D);
|
|
854
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[8], E);
|
|
855
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[10], F);
|
|
856
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[12], G);
|
|
857
|
+
SHA512_ADDTO2 (&context->Intermediate_Hash[14], H);
|
|
858
|
+
|
|
859
|
+
#else /* !USE_32BIT_ONLY */
|
|
860
|
+
static const uint64_t K[80] = {
|
|
861
|
+
0x428A2F98D728AE22ll, 0x7137449123EF65CDll, 0xB5C0FBCFEC4D3B2Fll,
|
|
862
|
+
0xE9B5DBA58189DBBCll, 0x3956C25BF348B538ll, 0x59F111F1B605D019ll,
|
|
863
|
+
0x923F82A4AF194F9Bll, 0xAB1C5ED5DA6D8118ll, 0xD807AA98A3030242ll,
|
|
864
|
+
0x12835B0145706FBEll, 0x243185BE4EE4B28Cll, 0x550C7DC3D5FFB4E2ll,
|
|
865
|
+
0x72BE5D74F27B896Fll, 0x80DEB1FE3B1696B1ll, 0x9BDC06A725C71235ll,
|
|
866
|
+
0xC19BF174CF692694ll, 0xE49B69C19EF14AD2ll, 0xEFBE4786384F25E3ll,
|
|
867
|
+
0x0FC19DC68B8CD5B5ll, 0x240CA1CC77AC9C65ll, 0x2DE92C6F592B0275ll,
|
|
868
|
+
0x4A7484AA6EA6E483ll, 0x5CB0A9DCBD41FBD4ll, 0x76F988DA831153B5ll,
|
|
869
|
+
0x983E5152EE66DFABll, 0xA831C66D2DB43210ll, 0xB00327C898FB213Fll,
|
|
870
|
+
0xBF597FC7BEEF0EE4ll, 0xC6E00BF33DA88FC2ll, 0xD5A79147930AA725ll,
|
|
871
|
+
0x06CA6351E003826Fll, 0x142929670A0E6E70ll, 0x27B70A8546D22FFCll,
|
|
872
|
+
0x2E1B21385C26C926ll, 0x4D2C6DFC5AC42AEDll, 0x53380D139D95B3DFll,
|
|
873
|
+
0x650A73548BAF63DEll, 0x766A0ABB3C77B2A8ll, 0x81C2C92E47EDAEE6ll,
|
|
874
|
+
0x92722C851482353Bll, 0xA2BFE8A14CF10364ll, 0xA81A664BBC423001ll,
|
|
875
|
+
0xC24B8B70D0F89791ll, 0xC76C51A30654BE30ll, 0xD192E819D6EF5218ll,
|
|
876
|
+
0xD69906245565A910ll, 0xF40E35855771202All, 0x106AA07032BBD1B8ll,
|
|
877
|
+
0x19A4C116B8D2D0C8ll, 0x1E376C085141AB53ll, 0x2748774CDF8EEB99ll,
|
|
878
|
+
0x34B0BCB5E19B48A8ll, 0x391C0CB3C5C95A63ll, 0x4ED8AA4AE3418ACBll,
|
|
879
|
+
0x5B9CCA4F7763E373ll, 0x682E6FF3D6B2B8A3ll, 0x748F82EE5DEFB2FCll,
|
|
880
|
+
0x78A5636F43172F60ll, 0x84C87814A1F0AB72ll, 0x8CC702081A6439ECll,
|
|
881
|
+
0x90BEFFFA23631E28ll, 0xA4506CEBDE82BDE9ll, 0xBEF9A3F7B2C67915ll,
|
|
882
|
+
0xC67178F2E372532Bll, 0xCA273ECEEA26619Cll, 0xD186B8C721C0C207ll,
|
|
883
|
+
0xEADA7DD6CDE0EB1Ell, 0xF57D4F7FEE6ED178ll, 0x06F067AA72176FBAll,
|
|
884
|
+
0x0A637DC5A2C898A6ll, 0x113F9804BEF90DAEll, 0x1B710B35131C471Bll,
|
|
885
|
+
0x28DB77F523047D84ll, 0x32CAAB7B40C72493ll, 0x3C9EBE0A15C9BEBCll,
|
|
886
|
+
0x431D67C49C100D4Cll, 0x4CC5D4BECB3E42B6ll, 0x597F299CFC657E2All,
|
|
887
|
+
0x5FCB6FAB3AD6FAECll, 0x6C44198C4A475817ll
|
|
888
|
+
};
|
|
889
|
+
int t, t8; /* Loop counter */
|
|
890
|
+
uint64_t temp1, temp2; /* Temporary word value */
|
|
891
|
+
uint64_t W[80] _U_; /* Word sequence */
|
|
892
|
+
uint64_t A, B, C, D, E, F, G, H; /* Word buffers */
|
|
893
|
+
|
|
894
|
+
/*
|
|
895
|
+
* Initialize the first 16 words in the array W
|
|
896
|
+
*/
|
|
897
|
+
for (t = t8 = 0; t < 16; t++, t8 += 8)
|
|
898
|
+
W[t] = ((uint64_t) (context->Message_Block[t8]) << 56) |
|
|
899
|
+
((uint64_t) (context->Message_Block[t8 + 1]) << 48) |
|
|
900
|
+
((uint64_t) (context->Message_Block[t8 + 2]) << 40) |
|
|
901
|
+
((uint64_t) (context->Message_Block[t8 + 3]) << 32) |
|
|
902
|
+
((uint64_t) (context->Message_Block[t8 + 4]) << 24) |
|
|
903
|
+
((uint64_t) (context->Message_Block[t8 + 5]) << 16) |
|
|
904
|
+
((uint64_t) (context->Message_Block[t8 + 6]) << 8) |
|
|
905
|
+
((uint64_t) (context->Message_Block[t8 + 7]));
|
|
906
|
+
|
|
907
|
+
for (t = 16; t < 80; t++)
|
|
908
|
+
W[t] = SHA512_sigma1 (W[t - 2]) + W[t - 7] +
|
|
909
|
+
SHA512_sigma0 (W[t - 15]) + W[t - 16];
|
|
910
|
+
|
|
911
|
+
A = context->Intermediate_Hash[0];
|
|
912
|
+
B = context->Intermediate_Hash[1];
|
|
913
|
+
C = context->Intermediate_Hash[2];
|
|
914
|
+
D = context->Intermediate_Hash[3];
|
|
915
|
+
E = context->Intermediate_Hash[4];
|
|
916
|
+
F = context->Intermediate_Hash[5];
|
|
917
|
+
G = context->Intermediate_Hash[6];
|
|
918
|
+
H = context->Intermediate_Hash[7];
|
|
919
|
+
|
|
920
|
+
for (t = 0; t < 80; t++)
|
|
921
|
+
{
|
|
922
|
+
temp1 = H + SHA512_SIGMA1 (E) + SHA_Ch (E, F, G) + K[t] + W[t];
|
|
923
|
+
temp2 = SHA512_SIGMA0 (A) + SHA_Maj (A, B, C);
|
|
924
|
+
H = G;
|
|
925
|
+
G = F;
|
|
926
|
+
F = E;
|
|
927
|
+
E = D + temp1;
|
|
928
|
+
D = C;
|
|
929
|
+
C = B;
|
|
930
|
+
B = A;
|
|
931
|
+
A = temp1 + temp2;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
context->Intermediate_Hash[0] += A;
|
|
935
|
+
context->Intermediate_Hash[1] += B;
|
|
936
|
+
context->Intermediate_Hash[2] += C;
|
|
937
|
+
context->Intermediate_Hash[3] += D;
|
|
938
|
+
context->Intermediate_Hash[4] += E;
|
|
939
|
+
context->Intermediate_Hash[5] += F;
|
|
940
|
+
context->Intermediate_Hash[6] += G;
|
|
941
|
+
context->Intermediate_Hash[7] += H;
|
|
942
|
+
#endif /* USE_32BIT_ONLY */
|
|
943
|
+
|
|
944
|
+
context->Message_Block_Index = 0;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/*
|
|
948
|
+
* SHA384_512Reset
|
|
949
|
+
*
|
|
950
|
+
* Description:
|
|
951
|
+
* This helper function will initialize the SHA512Context in
|
|
952
|
+
* preparation for computing a new SHA384 or SHA512 message
|
|
953
|
+
* digest.
|
|
954
|
+
*
|
|
955
|
+
* Parameters:
|
|
956
|
+
* context: [in/out]
|
|
957
|
+
* The context to reset.
|
|
958
|
+
* H0
|
|
959
|
+
* The initial hash value to use.
|
|
960
|
+
*
|
|
961
|
+
* Returns:
|
|
962
|
+
* sha Error Code.
|
|
963
|
+
*
|
|
964
|
+
*/
|
|
965
|
+
#ifdef USE_32BIT_ONLY
|
|
966
|
+
static int
|
|
967
|
+
SHA384_512Reset (SHA512Context * context, uint32_t H0[])
|
|
968
|
+
#else /* !USE_32BIT_ONLY */
|
|
969
|
+
static int
|
|
970
|
+
SHA384_512Reset (SHA512Context * context, uint64_t H0[])
|
|
971
|
+
#endif /* USE_32BIT_ONLY */
|
|
972
|
+
{
|
|
973
|
+
int i;
|
|
974
|
+
if (!context)
|
|
975
|
+
return shaNull;
|
|
976
|
+
|
|
977
|
+
context->Message_Block_Index = 0;
|
|
978
|
+
|
|
979
|
+
#ifdef USE_32BIT_ONLY
|
|
980
|
+
context->Length[0] = context->Length[1] = 0;
|
|
981
|
+
context->Length[2] = context->Length[3] = 0;
|
|
982
|
+
|
|
983
|
+
for (i = 0; i < SHA512HashSize / 4; i++)
|
|
984
|
+
context->Intermediate_Hash[i] = H0[i];
|
|
985
|
+
#else /* !USE_32BIT_ONLY */
|
|
986
|
+
context->Length_High = context->Length_Low = 0;
|
|
987
|
+
|
|
988
|
+
for (i = 0; i < SHA512HashSize / 8; i++)
|
|
989
|
+
context->Intermediate_Hash[i] = H0[i];
|
|
990
|
+
#endif /* USE_32BIT_ONLY */
|
|
991
|
+
|
|
992
|
+
context->Computed = 0;
|
|
993
|
+
context->Corrupted = 0;
|
|
994
|
+
|
|
995
|
+
return shaSuccess;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/*
|
|
999
|
+
* SHA384_512ResultN
|
|
1000
|
+
*
|
|
1001
|
+
* Description:
|
|
1002
|
+
* This helper function will return the 384-bit or 512-bit message
|
|
1003
|
+
* digest into the Message_Digest array provided by the caller.
|
|
1004
|
+
* NOTE: The first octet of hash is stored in the 0th element,
|
|
1005
|
+
* the last octet of hash in the 48th/64th element.
|
|
1006
|
+
*
|
|
1007
|
+
* Parameters:
|
|
1008
|
+
* context: [in/out]
|
|
1009
|
+
* The context to use to calculate the SHA hash.
|
|
1010
|
+
* Message_Digest: [out]
|
|
1011
|
+
* Where the digest is returned.
|
|
1012
|
+
* HashSize: [in]
|
|
1013
|
+
* The size of the hash, either 48 or 64.
|
|
1014
|
+
*
|
|
1015
|
+
* Returns:
|
|
1016
|
+
* sha Error Code.
|
|
1017
|
+
*
|
|
1018
|
+
*/
|
|
1019
|
+
static int
|
|
1020
|
+
SHA384_512ResultN (SHA512Context * context,
|
|
1021
|
+
uint8_t Message_Digest[], int HashSize)
|
|
1022
|
+
{
|
|
1023
|
+
int i;
|
|
1024
|
+
|
|
1025
|
+
#ifdef USE_32BIT_ONLY
|
|
1026
|
+
int i2;
|
|
1027
|
+
#endif /* USE_32BIT_ONLY */
|
|
1028
|
+
|
|
1029
|
+
if (!context || !Message_Digest)
|
|
1030
|
+
return shaNull;
|
|
1031
|
+
|
|
1032
|
+
if (context->Corrupted)
|
|
1033
|
+
return context->Corrupted;
|
|
1034
|
+
|
|
1035
|
+
if (!context->Computed)
|
|
1036
|
+
SHA384_512Finalize (context, 0x80);
|
|
1037
|
+
|
|
1038
|
+
#ifdef USE_32BIT_ONLY
|
|
1039
|
+
for (i = i2 = 0; i < HashSize;)
|
|
1040
|
+
{
|
|
1041
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2] >> 24);
|
|
1042
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2] >> 16);
|
|
1043
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2] >> 8);
|
|
1044
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2++]);
|
|
1045
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2] >> 24);
|
|
1046
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2] >> 16);
|
|
1047
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2] >> 8);
|
|
1048
|
+
Message_Digest[i++] = (uint8_t) (context->Intermediate_Hash[i2++]);
|
|
1049
|
+
}
|
|
1050
|
+
#else /* !USE_32BIT_ONLY */
|
|
1051
|
+
for (i = 0; i < HashSize; ++i)
|
|
1052
|
+
Message_Digest[i] = (uint8_t)
|
|
1053
|
+
(context->Intermediate_Hash[i >> 3] >> 8 * (7 - (i % 8)));
|
|
1054
|
+
#endif /* USE_32BIT_ONLY */
|
|
1055
|
+
|
|
1056
|
+
return shaSuccess;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
#endif
|