Advertisement
AnthonyCagliano

Untitled

Mar 27th, 2023
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. ; check MSB of tmp
  2. ld a, (ix - 16)
  3. rla
  4. sbc a, a
  5. and a, 10000011b
  6. push af
  7. ; now double tmp
  8. lea hl, ix - 16 ; tmp in hl
  9. ld b, 16
  10. or a ; reset carry
  11. .loop_mul2:
  12. rl (hl)
  13. inc hl
  14. djnz .loop_mul2
  15.  
  16. ; now xor with polynomial if tmp degree too high
  17. ; method below is constant-time
  18.  
  19. pop af
  20. xor a, (ix - 1)
  21. ld (ix - 1), a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement