sha256: add an SHA-256 implementation using libgcrypt

Generally, one gets better performance out of cryptographic routines
written in assembly than C, and this is also true for SHA-256.  In
addition, most Linux distributions cannot distribute Git linked against
OpenSSL for licensing reasons.

Most systems with GnuPG will also have libgcrypt, since it is a
dependency of GnuPG.  libgcrypt is also faster than the SHA1DC
implementation for messages of a few KiB and larger.

For comparison, on a Core i7-6600U, this implementation processes 16 KiB
chunks at 355 MiB/s while SHA1DC processes equivalent chunks at 337
MiB/s.

In addition, libgcrypt is licensed under the LGPL 2.1, which is
compatible with the GPL.  Add an implementation of SHA-256 that uses
libgcrypt.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 files changed
tree: 488f25ff856706ec8eaf74ea2bcfafa0252c9061
  1. .github/
  2. block-sha1/
  3. builtin/
  4. ci/
  5. compat/
  6. contrib/
  7. Documentation/
  8. ewah/
  9. git-gui/
  10. gitk-git/
  11. gitweb/
  12. mergetools/
  13. negotiator/
  14. perl/
  15. po/
  16. ppc/
  17. refs/
  18. sha1dc/
  19. sha256/
  20. t/
  21. templates/
  22. vcs-svn/
  23. xdiff/
  24. .clang-format
  25. .gitattributes
  26. .gitignore
  27. .gitmodules
  28. .mailmap
  29. .travis.yml
  30. .tsan-suppressions
  31. abspath.c
  32. aclocal.m4
  33. advice.c
  34. advice.h
  35. alias.c
  36. alias.h
  37. alloc.c
  38. alloc.h
  39. apply.c
  40. apply.h
  41. archive-tar.c
  42. archive-zip.c
  43. archive.c
  44. archive.h
  45. argv-array.c
  46. argv-array.h
  47. attr.c
  48. attr.h
  49. banned.h
  50. base85.c
  51. bisect.c
  52. bisect.h
  53. blame.c
  54. blame.h
  55. blob.c
  56. blob.h
  57. branch.c
  58. branch.h
  59. builtin.h
  60. bulk-checkin.c
  61. bulk-checkin.h
  62. bundle.c
  63. bundle.h
  64. cache-tree.c
  65. cache-tree.h
  66. cache.h
  67. chdir-notify.c
  68. chdir-notify.h
  69. check-builtins.sh
  70. check-racy.c
  71. check_bindir
  72. checkout.c
  73. checkout.h
  74. color.c
  75. color.h
  76. column.c
  77. column.h
  78. combine-diff.c
  79. command-list.txt
  80. commit-graph.c
  81. commit-graph.h
  82. commit-reach.c
  83. commit-reach.h
  84. commit-slab-decl.h
  85. commit-slab-impl.h
  86. commit-slab.h
  87. commit.c
  88. commit.h
  89. common-main.c
  90. config.c
  91. config.h
  92. config.mak.dev
  93. config.mak.in
  94. config.mak.uname
  95. configure.ac
  96. connect.c
  97. connect.h
  98. connected.c
  99. connected.h
  100. convert.c
  101. convert.h
  102. copy.c
  103. COPYING
  104. credential-cache--daemon.c
  105. credential-cache.c
  106. credential-store.c
  107. credential.c
  108. credential.h
  109. csum-file.c
  110. csum-file.h
  111. ctype.c
  112. daemon.c
  113. date.c
  114. decorate.c
  115. decorate.h
  116. delta-islands.c
  117. delta-islands.h
  118. delta.h
  119. detect-compiler
  120. diff-delta.c
  121. diff-lib.c
  122. diff-no-index.c
  123. diff.c
  124. diff.h
  125. diffcore-break.c
  126. diffcore-delta.c
  127. diffcore-order.c
  128. diffcore-pickaxe.c
  129. diffcore-rename.c
  130. diffcore.h
  131. dir-iterator.c
  132. dir-iterator.h
  133. dir.c
  134. dir.h
  135. editor.c
  136. entry.c
  137. environment.c
  138. exec-cmd.c
  139. exec-cmd.h
  140. fast-import.c
  141. fetch-negotiator.c
  142. fetch-negotiator.h
  143. fetch-object.c
  144. fetch-object.h
  145. fetch-pack.c
  146. fetch-pack.h
  147. fmt-merge-msg.h
  148. fsck.c
  149. fsck.h
  150. fsmonitor.c
  151. fsmonitor.h
  152. generate-cmdlist.sh
  153. gettext.c
  154. gettext.h
  155. git-add--interactive.perl
  156. git-archimport.perl
  157. git-bisect.sh
  158. git-compat-util.h
  159. git-cvsexportcommit.perl
  160. git-cvsimport.perl
  161. git-cvsserver.perl
  162. git-difftool--helper.sh
  163. git-filter-branch.sh
  164. git-instaweb.sh
  165. git-merge-octopus.sh
  166. git-merge-one-file.sh
  167. git-merge-resolve.sh
  168. git-mergetool--lib.sh
  169. git-mergetool.sh
  170. git-p4.py
  171. git-parse-remote.sh
  172. git-quiltimport.sh
  173. git-rebase--am.sh
  174. git-rebase--interactive.sh
  175. git-rebase--merge.sh
  176. git-rebase--preserve-merges.sh
  177. git-rebase.sh
  178. git-remote-testgit.sh
  179. git-request-pull.sh
  180. git-send-email.perl
  181. git-sh-i18n.sh
  182. git-sh-setup.sh
  183. git-stash.sh
  184. git-submodule.sh
  185. git-svn.perl
  186. GIT-VERSION-GEN
  187. git-web--browse.sh
  188. git.c
  189. git.rc
  190. gpg-interface.c
  191. gpg-interface.h
  192. graph.c
  193. graph.h
  194. grep.c
  195. grep.h
  196. hash.h
  197. hashmap.c
  198. hashmap.h
  199. help.c
  200. help.h
  201. hex.c
  202. http-backend.c
  203. http-fetch.c
  204. http-push.c
  205. http-walker.c
  206. http.c
  207. http.h
  208. ident.c
  209. imap-send.c
  210. INSTALL
  211. interdiff.c
  212. interdiff.h
  213. iterator.h
  214. json-writer.c
  215. json-writer.h
  216. khash.h
  217. kwset.c
  218. kwset.h
  219. levenshtein.c
  220. levenshtein.h
  221. LGPL-2.1
  222. line-log.c
  223. line-log.h
  224. line-range.c
  225. line-range.h
  226. linear-assignment.c
  227. linear-assignment.h
  228. list-objects-filter-options.c
  229. list-objects-filter-options.h
  230. list-objects-filter.c
  231. list-objects-filter.h
  232. list-objects.c
  233. list-objects.h
  234. list.h
  235. ll-merge.c
  236. ll-merge.h
  237. lockfile.c
  238. lockfile.h
  239. log-tree.c
  240. log-tree.h
  241. ls-refs.c
  242. ls-refs.h
  243. mailinfo.c
  244. mailinfo.h
  245. mailmap.c
  246. mailmap.h
  247. Makefile
  248. match-trees.c
  249. mem-pool.c
  250. mem-pool.h
  251. merge-blobs.c
  252. merge-blobs.h
  253. merge-recursive.c
  254. merge-recursive.h
  255. merge.c
  256. mergesort.c
  257. mergesort.h
  258. midx.c
  259. midx.h
  260. name-hash.c
  261. notes-cache.c
  262. notes-cache.h
  263. notes-merge.c
  264. notes-merge.h
  265. notes-utils.c
  266. notes-utils.h
  267. notes.c
  268. notes.h
  269. object-store.h
  270. object.c
  271. object.h
  272. oidmap.c
  273. oidmap.h
  274. oidset.c
  275. oidset.h
  276. pack-bitmap-write.c
  277. pack-bitmap.c
  278. pack-bitmap.h
  279. pack-check.c
  280. pack-objects.c
  281. pack-objects.h
  282. pack-revindex.c
  283. pack-revindex.h
  284. pack-write.c
  285. pack.h
  286. packfile.c
  287. packfile.h
  288. pager.c
  289. parse-options-cb.c
  290. parse-options.c
  291. parse-options.h
  292. patch-delta.c
  293. patch-ids.c
  294. patch-ids.h
  295. path.c
  296. path.h
  297. pathspec.c
  298. pathspec.h
  299. pkt-line.c
  300. pkt-line.h
  301. preload-index.c
  302. pretty.c
  303. pretty.h
  304. prio-queue.c
  305. prio-queue.h
  306. progress.c
  307. progress.h
  308. prompt.c
  309. prompt.h
  310. protocol.c
  311. protocol.h
  312. quote.c
  313. quote.h
  314. range-diff.c
  315. range-diff.h
  316. reachable.c
  317. reachable.h
  318. read-cache.c
  319. README.md
  320. ref-filter.c
  321. ref-filter.h
  322. reflog-walk.c
  323. reflog-walk.h
  324. refs.c
  325. refs.h
  326. refspec.c
  327. refspec.h
  328. remote-curl.c
  329. remote-testsvn.c
  330. remote.c
  331. remote.h
  332. replace-object.c
  333. replace-object.h
  334. repository.c
  335. repository.h
  336. rerere.c
  337. rerere.h
  338. resolve-undo.c
  339. resolve-undo.h
  340. revision.c
  341. revision.h
  342. run-command.c
  343. run-command.h
  344. send-pack.c
  345. send-pack.h
  346. sequencer.c
  347. sequencer.h
  348. serve.c
  349. serve.h
  350. server-info.c
  351. setup.c
  352. sh-i18n--envsubst.c
  353. sha1-array.c
  354. sha1-array.h
  355. sha1-file.c
  356. sha1-lookup.c
  357. sha1-lookup.h
  358. sha1-name.c
  359. sha1dc_git.c
  360. sha1dc_git.h
  361. shallow.c
  362. shell.c
  363. shortlog.h
  364. sideband.c
  365. sideband.h
  366. sigchain.c
  367. sigchain.h
  368. split-index.c
  369. split-index.h
  370. strbuf.c
  371. strbuf.h
  372. streaming.c
  373. streaming.h
  374. string-list.c
  375. string-list.h
  376. sub-process.c
  377. sub-process.h
  378. submodule-config.c
  379. submodule-config.h
  380. submodule.c
  381. submodule.h
  382. symlinks.c
  383. tag.c
  384. tag.h
  385. tar.h
  386. tempfile.c
  387. tempfile.h
  388. thread-utils.c
  389. thread-utils.h
  390. tmp-objdir.c
  391. tmp-objdir.h
  392. trace.c
  393. trace.h
  394. trailer.c
  395. trailer.h
  396. transport-helper.c
  397. transport-internal.h
  398. transport.c
  399. transport.h
  400. tree-diff.c
  401. tree-walk.c
  402. tree-walk.h
  403. tree.c
  404. tree.h
  405. unicode-width.h
  406. unimplemented.sh
  407. unix-socket.c
  408. unix-socket.h
  409. unpack-trees.c
  410. unpack-trees.h
  411. upload-pack.c
  412. upload-pack.h
  413. url.c
  414. url.h
  415. urlmatch.c
  416. urlmatch.h
  417. usage.c
  418. userdiff.c
  419. userdiff.h
  420. utf8.c
  421. utf8.h
  422. varint.c
  423. varint.h
  424. version.c
  425. version.h
  426. versioncmp.c
  427. walker.c
  428. walker.h
  429. wildmatch.c
  430. wildmatch.h
  431. worktree.c
  432. worktree.h
  433. wrap-for-bin.sh
  434. wrapper.c
  435. write-or-die.c
  436. ws.c
  437. wt-status.c
  438. wt-status.h
  439. xdiff-interface.c
  440. xdiff-interface.h
  441. zlib.c
README.md

Git - fast, scalable, distributed revision control system

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git is an Open Source project covered by the GNU General Public License version 2 (some parts of it are under different licenses, compatible with the GPLv2). It was originally written by Linus Torvalds with help of a group of hackers around the net.

Please read the file INSTALL for installation instructions.

Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools.

See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname>.

CVS users may also want to read Documentation/gitcvs-migration.txt (man gitcvs-migration or git help cvs-migration if git is installed).

The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org (read Documentation/SubmittingPatches for instructions on patch submission). To subscribe to the list, send an email with just “subscribe git” in the body to majordomo@vger.kernel.org. The mailing list archives are available at https://public-inbox.org/git/, http://marc.info/?l=git and other archival sites.

Issues which are security relevant should be disclosed privately to the Git Security mailing list git-security@googlegroups.com.

The maintainer frequently sends the “What's cooking” reports that list the current status of various development topics to the mailing list. The discussion following them give a good reference for project status, development direction and remaining tasks.

The name “git” was given by Linus Torvalds when he wrote the very first version. He described the tool as “the stupid content tracker” and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of “get” may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • “global information tracker”: you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • “goddamn idiotic truckload of sh*t”: when it breaks