Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. ; libcrash -- cryptographic hash (and other) functions
  2. ;
  3. ; Copyright (C) <2021> Ivan Baravy
  4. ;
  5. ; SPDX-License-Identifier: GPL-2.0-or-later
  6. ;
  7. ; This program is free software: you can redistribute it and/or modify it under
  8. ; the terms of the GNU General Public License as published by the Free Software
  9. ; Foundation, either version 2 of the License, or (at your option) any later
  10. ; version.
  11. ;
  12. ; This program is distributed in the hope that it will be useful, but WITHOUT
  13. ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. ; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  15. ;
  16. ; You should have received a copy of the GNU General Public License along with
  17. ; this program. If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. CBC128_BLOCK_SIZE = 128/8
  20.  
  21. struct ctx_cbc
  22.         vector rd CBC128_BLOCK_SIZE/4
  23.         block rd CBC128_BLOCK_SIZE/4
  24.         has_data dd ?
  25. ends
  26.  
  27. ; ebx = context
  28. proc cbc.init uses esi edi, _iv
  29.  
  30.         mov     esi, [_iv]
  31.         lea     edi, [ebx+ctx_ctr.block_counter]
  32.         mov     ecx, CTR128_BLOCK_SIZE/4
  33.         rep movsd
  34.         mov     [ebx+ctx_ctr.partial_cnt], 0
  35.         ret
  36. endp
  37.