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. CTR128_BLOCK_SIZE = 128/8
  20.  
  21. struct ctx_ctr
  22.         block_counter rd 4
  23.         partial_cnt dd ?
  24. ends
  25.  
  26. ; ebx = context
  27. proc ctr.init uses esi edi, _iv
  28.         mov     esi, [_iv]
  29.         lea     edi, [ebx+ctx_ctr.block_counter]
  30.         mov     ecx, CTR128_BLOCK_SIZE/4
  31.         rep movsd
  32.         mov     [ebx+ctx_ctr.partial_cnt], 0
  33.         ret
  34. endp
  35.