Subversion Repositories Kolibri OS

Rev

Rev 6465 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;    libcrash -- cryptographic hash functions
  2. ;
  3. ;    Copyright (C) 2012-2014,2016,2019 Ivan Baravy (dunkaist)
  4. ;
  5. ;    This program is free software: you can redistribute it and/or modify
  6. ;    it under the terms of the GNU General Public License as published by
  7. ;    the Free Software Foundation, either version 3 of the License, or
  8. ;    (at your option) any later version.
  9. ;
  10. ;    This program is distributed in the hope that it will be useful,
  11. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ;    GNU General Public License for more details.
  14. ;
  15. ;    You should have received a copy of the GNU General Public License
  16. ;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17.  
  18.  
  19. LIBCRASH_CRC32          = 0
  20. LIBCRASH_MD4            = 1
  21. LIBCRASH_MD5            = 2
  22. LIBCRASH_SHA1           = 3
  23. LIBCRASH_SHA224         = 4
  24. LIBCRASH_SHA256         = 5
  25. LIBCRASH_SHA384         = 6
  26. LIBCRASH_SHA512         = 7
  27. LIBCRASH_SHA3_224       = 8
  28. LIBCRASH_SHA3_256       = 9
  29. LIBCRASH_SHA3_384       = 10
  30. LIBCRASH_SHA3_512       = 11
  31. LIBCRASH_LAST           = 11
  32.  
  33.  
  34. struct crash_item
  35.         init    dd ?
  36.         update  dd ?
  37.         final   dd ?
  38.         oneshot dd ?
  39.         len_out dd ?
  40. ends
  41.  
  42. struct crash_ctx
  43.         hash rb 1024    ; context starts with hash data
  44. ends
  45.  
  46.  
  47. CRC32_HASH_SIZE     = 4
  48. CRC32_BLOCK_SIZE    = 1
  49.  
  50. MD4_HASH_SIZE       = 16
  51. MD4_BLOCK_SIZE      = 64
  52.  
  53. MD5_HASH_SIZE       = 16
  54. MD5_BLOCK_SIZE      = 64
  55.  
  56. SHA1_HASH_SIZE      = 20
  57. SHA1_BLOCK_SIZE     = 64
  58.  
  59. SHA224_HASH_SIZE    = 28
  60. SHA224_BLOCK_SIZE   = 64
  61.  
  62. SHA256_HASH_SIZE    = 32
  63. SHA256_BLOCK_SIZE   = 64
  64.  
  65. SHA384_HASH_SIZE    = 48
  66. SHA384_BLOCK_SIZE   = 128
  67.  
  68. SHA512_HASH_SIZE    = 64
  69. SHA512_BLOCK_SIZE   = 128
  70.  
  71. SHA3_224_HASH_SIZE  = 28
  72. SHA3_224_BLOCK_SIZE = 144
  73.  
  74. SHA3_256_HASH_SIZE  = 32
  75. SHA3_256_BLOCK_SIZE = 136
  76.  
  77. SHA3_384_HASH_SIZE  = 48
  78. SHA3_384_BLOCK_SIZE = 104
  79.  
  80. SHA3_512_HASH_SIZE  = 64
  81. SHA3_512_BLOCK_SIZE = 72
  82.