ooxml_crypt 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ooxml_crypt/version.rb +1 -1
  3. data/vendor/cybozulib/common.mk +3 -3
  4. data/vendor/cybozulib/common.props +1 -1
  5. data/vendor/cybozulib/debug.props +1 -1
  6. data/vendor/cybozulib/include/cybozu/atomic.hpp +15 -5
  7. data/vendor/cybozulib/include/cybozu/bfd.hpp +1 -1
  8. data/vendor/cybozulib/include/cybozu/bit_operation.hpp +8 -10
  9. data/vendor/cybozulib/include/cybozu/crypto.hpp +59 -5
  10. data/vendor/cybozulib/include/cybozu/endian.hpp +0 -2
  11. data/vendor/cybozulib/include/cybozu/inttype.hpp +17 -3
  12. data/vendor/cybozulib/include/cybozu/link_libeay32.hpp +1 -1
  13. data/vendor/cybozulib/include/cybozu/link_mpir.hpp +1 -1
  14. data/vendor/cybozulib/include/cybozu/link_ssleay32.hpp +1 -1
  15. data/vendor/cybozulib/include/cybozu/random_generator.hpp +1 -0
  16. data/vendor/cybozulib/include/cybozu/sha2.hpp +102 -0
  17. data/vendor/cybozulib/sample/proj/ssl_smpl/ssl_smpl.vcxproj +1 -1
  18. data/vendor/cybozulib/sample/proj/stacktrace_smpl/stacktrace_smpl.vcxproj +1 -1
  19. data/vendor/cybozulib/test/Makefile +3 -3
  20. data/vendor/cybozulib/test/base/proj/array_test/array_test.vcxproj +1 -1
  21. data/vendor/cybozulib/test/base/proj/atoi_test/atoi_test.vcxproj +1 -1
  22. data/vendor/cybozulib/test/base/proj/atomic_test/atomic_test.vcxproj +1 -1
  23. data/vendor/cybozulib/test/base/proj/base64_test/base64_test.vcxproj +1 -1
  24. data/vendor/cybozulib/test/base/proj/condition_variable_cs_test/condition_variable_cs_test.vcxproj +1 -1
  25. data/vendor/cybozulib/test/base/proj/condition_variable_test/condition_variable_test.vcxproj +1 -1
  26. data/vendor/cybozulib/test/base/proj/config_test/config_test.vcxproj +1 -1
  27. data/vendor/cybozulib/test/base/proj/csv_test/csv_test.vcxproj +1 -1
  28. data/vendor/cybozulib/test/base/proj/endian_test/endian_test.vcxproj +1 -1
  29. data/vendor/cybozulib/test/base/proj/env_test/env_test.vcxproj +1 -1
  30. data/vendor/cybozulib/test/base/proj/event_test/event_test.vcxproj +1 -1
  31. data/vendor/cybozulib/test/base/proj/file_test/file_test.vcxproj +1 -1
  32. data/vendor/cybozulib/test/base/proj/itoa_test/itoa_test.vcxproj +1 -1
  33. data/vendor/cybozulib/test/base/proj/mecab_test/mecab_test.vcxproj +1 -1
  34. data/vendor/cybozulib/test/base/proj/minixml_test/minixml_test.vcxproj +1 -1
  35. data/vendor/cybozulib/test/base/proj/mmap_test/mmap_test.vcxproj +1 -1
  36. data/vendor/cybozulib/test/base/proj/serializer_test/serializer_test.vcxproj +1 -1
  37. data/vendor/cybozulib/test/base/proj/sha1_test/sha1_test.vcxproj +1 -1
  38. data/vendor/cybozulib/test/base/proj/stream_test/stream_test.vcxproj +1 -1
  39. data/vendor/cybozulib/test/base/proj/string_operation_test/string_operation_test.vcxproj +1 -1
  40. data/vendor/cybozulib/test/base/proj/string_test/string_test.vcxproj +1 -1
  41. data/vendor/cybozulib/test/base/proj/thread_test/thread_test.vcxproj +1 -1
  42. data/vendor/cybozulib/test/base/proj/time_test/time_test.vcxproj +1 -1
  43. data/vendor/cybozulib/test/base/proj/tls_test/tls_test.vcxproj +1 -1
  44. data/vendor/cybozulib/test/base/proj/zlib_test/zlib_test.vcxproj +1 -1
  45. data/vendor/cybozulib/test/base/sha2_test.cpp +1 -1
  46. data/vendor/cybozulib/test/base/zlib_test.cpp +2 -0
  47. data/vendor/msoffice/Makefile +2 -2
  48. data/vendor/msoffice/bin/msoffice-crypt.exe +0 -0
  49. data/vendor/msoffice/common.mk +11 -6
  50. data/vendor/msoffice/common.props +25 -25
  51. data/vendor/msoffice/debug.props +13 -13
  52. data/vendor/msoffice/include/crypto_util.hpp +454 -450
  53. data/vendor/msoffice/readme.md +2 -0
  54. data/vendor/msoffice/release.props +27 -27
  55. data/vendor/msoffice/test/Makefile +4 -1
  56. data/vendor/msoffice/test/proj/cfb/cfb_test.vcxproj +89 -89
  57. data/vendor/msoffice/test/proj/hash/hash_test.vcxproj +89 -89
  58. data/vendor/msoffice/test_all.py +4 -4
  59. metadata +7 -7
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|Win32">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -1,4 +1,4 @@
1
- ����<?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <ItemGroup Label="ProjectConfigurations">
4
4
  <ProjectConfiguration Include="Debug|x64">
@@ -2,7 +2,7 @@
2
2
  #include <stdlib.h>
3
3
  #include <time.h>
4
4
  #include <vector>
5
- #define CYBOZU_DONT_USE_OPENSSL
5
+ //#define CYBOZU_DONT_USE_OPENSSL
6
6
  #include <cybozu/sha2.hpp>
7
7
  #include <cybozu/test.hpp>
8
8
  #include <cybozu/itoa.hpp>
@@ -184,6 +184,7 @@ void compareMap(const Map& x, const Map& y)
184
184
  }
185
185
  }
186
186
 
187
+ #if 0
187
188
  CYBOZU_TEST_AUTO(serializer_with_zlib)
188
189
  {
189
190
  typedef std::map<int, double> Map;
@@ -252,6 +253,7 @@ CYBOZU_TEST_AUTO(sparse_with_zlib)
252
253
  CYBOZU_TEST_ASSERT(yi == y.end());
253
254
  }
254
255
  }
256
+ #endif
255
257
 
256
258
  CYBOZU_TEST_AUTO(random)
257
259
  {
@@ -9,7 +9,7 @@ all:
9
9
  $(MAKE) $(MSOC_SLIB)
10
10
 
11
11
  test:
12
- python test_all.py
12
+ python3 test_all.py
13
13
  clean:
14
14
  $(MAKE) -C src clean
15
15
  $(MAKE) -C test clean
@@ -25,5 +25,5 @@ $(MSOC_SLIB): src/$(OBJDIR)/msocdll.o
25
25
  $(CXX) -o $@ $< -shared $(LDFLAGS)
26
26
 
27
27
  bin/minisample: src/minisample.c include/msoc.h $(MSOC_LIB)
28
- $(CC) $< -o $@ $(MSOC_LIB) -lstdc++ -lcrypto -Iinclude -Wall -Wextra -lcrypto
28
+ $(CC) $< -o $@ $(MSOC_LIB) -lstdc++ -lcrypto -Iinclude -Wall -Wextra
29
29
 
Binary file
@@ -2,16 +2,21 @@ CP = cp -f
2
2
  AR = ar r
3
3
  MKDIR=mkdir -p
4
4
  RM=rm -fr
5
- CFLAGS_OPT = -Ofast -fomit-frame-pointer -DNDEBUG -march=native -msse4
5
+ CFLAGS_OPT = -O2 -DNDEBUG
6
6
  #CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith #-Wswitch-enum -Wstrict-aliasing=2
7
7
  CFLAGS_WARN=-Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith #-Wswitch-enum -Wstrict-aliasing=2
8
- CFLAGS = -g -D_FILE_OFFSET_BITS=64 -msse2 -fno-operator-names
8
+ CFLAGS = -g -D_FILE_OFFSET_BITS=64
9
9
  CFLAGS+=$(CFLAGS_WARN)
10
- LDFLAGS = -lcrypto -lssl
10
+ ifeq ($(OLD_OPENSSL),1)
11
+ CFLAGS+=-DCYBOZU_USE_OPENSSL_NEW_HASH=0
12
+ endif
13
+
14
+ LDFLAGS = -lcrypto
11
15
  UNAME_S=$(shell uname -s)
12
16
  ifeq ($(UNAME_S),Darwin)
13
- CFLAGS+=-I/usr/local/opt/openssl/include
14
- LDFLAGS+=-L/usr/local/opt/openssl/lib
17
+ EXT_DIR?=/opt/homebrew/
18
+ CFLAGS+=-I$(EXT_DIR)/include
19
+ LDFLAGS+=-L$(EXT_DIR)/lib
15
20
  LIB_SUF=dylib
16
21
  else
17
22
  LIB_SUF=so
@@ -32,7 +37,7 @@ else
32
37
  endif
33
38
 
34
39
  TOPDIR:=$(realpath $(dir $(lastword $(MAKEFILE_LIST))))/
35
- CFLAGS+= -I$(TOPDIR)include -I$(TOPDIR)../cybozulib/include -I$(TOPDIR)../mie/include
40
+ CFLAGS+= -I$(TOPDIR)include -I$(TOPDIR)../cybozulib/include
36
41
  LDFLAGS+= -L$(TOPDIR)lib -lcrypto -lpthread
37
42
  ifneq ($(UNAME_S),Darwin)
38
43
  LDFLAGS+=-lrt
@@ -1,26 +1,26 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
- <ImportGroup Label="PropertySheets" />
4
- <PropertyGroup Label="UserMacros" />
5
- <PropertyGroup>
6
- <OutDir>$(SolutionDir)bin\</OutDir>
7
- </PropertyGroup>
8
- <ItemDefinitionGroup>
9
- <ClCompile>
10
- <AdditionalIncludeDirectories>$(SolutionDir)../xbyak;$(SolutionDir)../cybozulib/include;$(SolutionDir)../cybozulib_ext/openssl/include;$(SolutionDir)../cybozulib_ext/mpir/include;$(SolutionDir)include</AdditionalIncludeDirectories>
11
- </ClCompile>
12
- </ItemDefinitionGroup>
13
- <ItemDefinitionGroup>
14
- <ClCompile>
15
- <WarningLevel>Level4</WarningLevel>
16
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
17
- <PrecompiledHeaderFile />
18
- <PrecompiledHeaderOutputFile />
19
- <PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);NOMINMAX</PreprocessorDefinitions>
20
- </ClCompile>
21
- <Link>
22
- <AdditionalLibraryDirectories>$(SolutionDir)../cybozulib_ext/mpir/lib;$(SolutionDir)../cybozulib_ext/openssl/lib</AdditionalLibraryDirectories>
23
- </Link>
24
- </ItemDefinitionGroup>
25
- <ItemGroup />
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ImportGroup Label="PropertySheets" />
4
+ <PropertyGroup Label="UserMacros" />
5
+ <PropertyGroup>
6
+ <OutDir>$(SolutionDir)bin\</OutDir>
7
+ </PropertyGroup>
8
+ <ItemDefinitionGroup>
9
+ <ClCompile>
10
+ <AdditionalIncludeDirectories>$(SolutionDir)../xbyak;$(SolutionDir)../cybozulib/include;$(SolutionDir)../cybozulib_ext/openssl/include;$(SolutionDir)../cybozulib_ext/mpir/include;$(SolutionDir)include</AdditionalIncludeDirectories>
11
+ </ClCompile>
12
+ </ItemDefinitionGroup>
13
+ <ItemDefinitionGroup>
14
+ <ClCompile>
15
+ <WarningLevel>Level4</WarningLevel>
16
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
17
+ <PrecompiledHeaderFile />
18
+ <PrecompiledHeaderOutputFile />
19
+ <PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);NOMINMAX</PreprocessorDefinitions>
20
+ </ClCompile>
21
+ <Link>
22
+ <AdditionalLibraryDirectories>$(SolutionDir)../cybozulib_ext/mpir/lib;$(SolutionDir)../cybozulib_ext/openssl/lib</AdditionalLibraryDirectories>
23
+ </Link>
24
+ </ItemDefinitionGroup>
25
+ <ItemGroup />
26
26
  </Project>
@@ -1,14 +1,14 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
- <ImportGroup Label="PropertySheets" />
4
- <PropertyGroup Label="UserMacros" />
5
- <PropertyGroup>
6
- <TargetName>$(ProjectName)d</TargetName>
7
- </PropertyGroup>
8
- <ItemDefinitionGroup>
9
- <ClCompile>
10
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
11
- </ClCompile>
12
- </ItemDefinitionGroup>
13
- <ItemGroup />
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ImportGroup Label="PropertySheets" />
4
+ <PropertyGroup Label="UserMacros" />
5
+ <PropertyGroup>
6
+ <TargetName>$(ProjectName)d</TargetName>
7
+ </PropertyGroup>
8
+ <ItemDefinitionGroup>
9
+ <ClCompile>
10
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
11
+ </ClCompile>
12
+ </ItemDefinitionGroup>
13
+ <ItemGroup />
14
14
  </Project>