...
1// Copyright 2017 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build gc && !purego
6
7#include "textflag.h"
8
9// func kimd(function code, chain *[200]byte, src []byte)
10TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40
11 MOVD function+0(FP), R0
12 MOVD chain+8(FP), R1
13 LMG src+16(FP), R2, R3 // R2=base, R3=len
14
15continue:
16 WORD $0xB93E0002 // KIMD --, R2
17 BVS continue // continue if interrupted
18 MOVD $0, R0 // reset R0 for pre-go1.8 compilers
19 RET
20
21// func klmd(function code, chain *[200]byte, dst, src []byte)
22TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64
23 // TODO: SHAKE support
24 MOVD function+0(FP), R0
25 MOVD chain+8(FP), R1
26 LMG dst+16(FP), R2, R3 // R2=base, R3=len
27 LMG src+40(FP), R4, R5 // R4=base, R5=len
28
29continue:
30 WORD $0xB93F0024 // KLMD R2, R4
31 BVS continue // continue if interrupted
32 MOVD $0, R0 // reset R0 for pre-go1.8 compilers
33 RET
View as plain text