You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 line
1.3 KiB

  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. //+build !gccgo,!appengine
  5. #include "textflag.h"
  6. TEXT ·hasMSA6(SB), NOSPLIT, $16-1
  7. MOVD $0, R0 // KIMD-Query function code
  8. MOVD $tmp-16(SP), R1 // parameter block
  9. XC $16, (R1), (R1) // clear the parameter block
  10. WORD $0xB93E0002 // KIMD --, --
  11. WORD $0x91FC1004 // TM 4(R1), 0xFC (test bits [32-37])
  12. BVS yes
  13. no:
  14. MOVB $0, ret+0(FP)
  15. RET
  16. yes:
  17. MOVB $1, ret+0(FP)
  18. RET
  19. // func kimd(function code, params *[200]byte, src []byte)
  20. TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40
  21. MOVD function+0(FP), R0
  22. MOVD params+8(FP), R1
  23. LMG src+16(FP), R2, R3 // R2=base, R3=len
  24. continue:
  25. WORD $0xB93E0002 // KIMD --, R2
  26. BVS continue // continue if interrupted
  27. MOVD $0, R0 // reset R0 for pre-go1.8 compilers
  28. RET
  29. // func klmd(function code, params *[200]byte, dst, src []byte)
  30. TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64
  31. // TODO: SHAKE support
  32. MOVD function+0(FP), R0
  33. MOVD params+8(FP), R1
  34. LMG dst+16(FP), R2, R3 // R2=base, R3=len
  35. LMG src+40(FP), R4, R5 // R4=base, R5=len
  36. continue:
  37. WORD $0xB93F0024 // KLMD R2, R4
  38. BVS continue // continue if interrupted
  39. MOVD $0, R0 // reset R0 for pre-go1.8 compilers
  40. RET