// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (amd64 || arm64 || ppc64 || ppc64le) && !purego

package aes

//go:generate sh -c "go run ./ctr_arm64_gen.go | asmfmt > ctr_arm64.s"

//go:noescape
func ctrBlocks1Asm( int,  *[60]uint32, ,  *[BlockSize]byte, ,  uint64)

//go:noescape
func ctrBlocks2Asm( int,  *[60]uint32, ,  *[2 * BlockSize]byte, ,  uint64)

//go:noescape
func ctrBlocks4Asm( int,  *[60]uint32, ,  *[4 * BlockSize]byte, ,  uint64)

//go:noescape
func ctrBlocks8Asm( int,  *[60]uint32, ,  *[8 * BlockSize]byte, ,  uint64)

func ctrBlocks1( *Block, ,  *[BlockSize]byte, ,  uint64) {
	if !supportsAES {
		ctrBlocks(, [:], [:], , )
	} else {
		ctrBlocks1Asm(.rounds, &.enc, , , , )
	}
}

func ctrBlocks2( *Block, ,  *[2 * BlockSize]byte, ,  uint64) {
	if !supportsAES {
		ctrBlocks(, [:], [:], , )
	} else {
		ctrBlocks2Asm(.rounds, &.enc, , , , )
	}
}

func ctrBlocks4( *Block, ,  *[4 * BlockSize]byte, ,  uint64) {
	if !supportsAES {
		ctrBlocks(, [:], [:], , )
	} else {
		ctrBlocks4Asm(.rounds, &.enc, , , , )
	}
}

func ctrBlocks8( *Block, ,  *[8 * BlockSize]byte, ,  uint64) {
	if !supportsAES {
		ctrBlocks(, [:], [:], , )
	} else {
		ctrBlocks8Asm(.rounds, &.enc, , , , )
	}
}