twrpDigest refactor

This patch is to refactor twrpDigest using polymorphism
and inheritance to use the same call patterns for creating and
reading a digest. Now a library.
Use SHA2 from libcrypto. SHA2 is default if device has libcrypto.

Change string MD5 everywhere to use digest or Digest instead. Updated
string tags to digest. Translation will be required.

Switch out digest code into a driver class from partitionmanager.

SHA2 is better for digest creation due to decreased collision space
compared to MD5 and SHA1.

See https://en.wikipedia.org/wiki/SHA-2

Change-Id: I74b5546789990b12aa4ce2e389d25f80a3fe213f
60 files changed
tree: 33b1ed63aa4e51f6e49fda5bd6ccb204e1e8fdab
  1. adbbu/
  2. applypatch/
  3. attr/
  4. bmlutils/
  5. bootloader_message/
  6. crypto/
  7. dosfstools/
  8. edify/
  9. etc/
  10. exfat/
  11. fb2png/
  12. flashutils/
  13. fonts/
  14. fuse/
  15. gpt/
  16. gui/
  17. htcdumlock/
  18. injecttwrp/
  19. libblkid/
  20. libcrecovery/
  21. libmincrypt/
  22. libpixelflinger/
  23. libtar/
  24. minadbd/
  25. minadbd21/
  26. minui/
  27. minui21/
  28. minuitwrp/
  29. minzip/
  30. mmcutils/
  31. mtdutils/
  32. mtp/
  33. openaes/
  34. orscmd/
  35. otafault/
  36. pigz/
  37. prebuilt/
  38. res/
  39. res-hdpi/
  40. res-mdpi/
  41. res-xhdpi/
  42. res-xxhdpi/
  43. res-xxxhdpi/
  44. scripts/
  45. sepolicy/
  46. simg2img/
  47. tests/
  48. toolbox/
  49. tools/
  50. toybox/
  51. twrpDigest/
  52. twrpTarMain/
  53. uncrypt/
  54. update_verifier/
  55. updater/
  56. verifier24/
  57. .gitignore
  58. adb_install.cpp
  59. adb_install.h
  60. Android.mk
  61. asn1_decoder.cpp
  62. asn1_decoder.h
  63. bootloader.h
  64. CleanSpec.mk
  65. common.h
  66. data.cpp
  67. data.hpp
  68. default_device.cpp
  69. device.cpp
  70. device.h
  71. error_code.h
  72. exclude.cpp
  73. exclude.hpp
  74. find_file.cpp
  75. find_file.hpp
  76. fixContexts.cpp
  77. fixContexts.hpp
  78. fuse.h
  79. fuse_sdcard_provider.cpp
  80. fuse_sdcard_provider.h
  81. fuse_sideload.cpp
  82. fuse_sideload.h
  83. infomanager.cpp
  84. infomanager.hpp
  85. install.cpp
  86. install.h
  87. installcommand.cpp
  88. installcommand.h
  89. interlace-frames.py
  90. legacy_properties.h
  91. legacy_property_service.cpp
  92. legacy_property_service.h
  93. mounts.c
  94. mounts.h
  95. NOTICE
  96. openrecoveryscript.cpp
  97. openrecoveryscript.hpp
  98. partition.cpp
  99. partitionmanager.cpp
  100. partitions.hpp
  101. print_sha1.h
  102. progresstracking.cpp
  103. progresstracking.hpp
  104. README.md
  105. recovery-persist.cpp
  106. recovery-persist.rc
  107. recovery-refresh.cpp
  108. recovery-refresh.rc
  109. recovery.cpp
  110. recovery_ui.h
  111. roots.cpp
  112. roots.h
  113. screen_ui.cpp
  114. screen_ui.h
  115. set_metadata.cpp
  116. set_metadata.h
  117. tarWrite.c
  118. tarWrite.h
  119. tw_atomic.cpp
  120. tw_atomic.hpp
  121. twcommon.h
  122. twinstall.cpp
  123. twinstall.h
  124. twrp-functions.cpp
  125. twrp-functions.hpp
  126. twrp.cpp
  127. twrpDigestDriver.cpp
  128. twrpDigestDriver.hpp
  129. twrpTar.cpp
  130. twrpTar.h
  131. twrpTar.hpp
  132. ui.cpp
  133. ui.h
  134. unique_fd.h
  135. variables.h
  136. verifier.cpp
  137. verifier.h
  138. wear_touch.cpp
  139. wear_touch.h
  140. wear_ui.cpp
  141. wear_ui.h
README.md

Team Win Recovery Project (TWRP)

You can find a compiling guide here.