avx2_t1: [CHACHA20_POLY1305] fix AVX-SSE transitions
@@ -927,7 +927,7 @@ partial_block:
no_partial_block:
endbranch64
%ifdef SAFE_DATA
- clear_all_ymms_asm
+ vpxor ymm0, ymm0
; Clear stack frame
%assign i 0
%rep 16
@@ -949,6 +949,12 @@ no_partial_block:
%endif
mov rsp, [rsp + _RSP_SAVE]
+%ifdef SAFE_DATA
+ clear_scratch_ymms_asm
+%else
+ vzeroupper
+%endif
+
exit:
mov rax, job
or dword [rax + _status], IMB_STATUS_COMPLETED_CIPHER
@@ -1378,7 +1384,7 @@ no_partial_block_ks:
mov [ctx + LastBlkCount], blk_cnt
%ifdef SAFE_DATA
- clear_all_ymms_asm
+ vpxor ymm0, ymm0
; Clear stack frame
%assign i 0
%rep 16
@@ -1407,6 +1413,12 @@ no_partial_block_ks:
%endif
mov rsp, [rsp + _RSP_SAVE]
+%ifdef SAFE_DATA
+ clear_scratch_ymms_asm
+%else
+ vzeroupper
+%endif
+
exit_ks:
ret
