You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: nacl.go
    path of file: ./repos/moby/vendor/github.com/moby/swarmkit/v2/manager/encryption
    
    the code of the file until where you have to start completion: package encryption

import (
	cryptorand "crypto/rand"
	"fmt"
	"io"

	"github.com/moby/swarmkit/v2/api"

	"golang.org/x/crypto/nacl/secretbox"
)

const naclSecretboxKeySize = 32
const naclSecr
    
func (n NACLSecretbox) Encrypt(data []byte) (*api.MaybeEncryptedRecord, error) {
	var nonce [24]byte
	if _, err := io.ReadFull(cryptorand.Reader, nonce[:]); err != nil {
		return nil, err
	}

	// Seal's first argument is an "out", the data that the new encrypted message should be
	// appended to.  Since we don't want to append anything, we pass nil.
	encrypted := secretbox.Seal(nil, data, &nonce, &n.key)
	return &api.MaybeEncryptedRecord{
		Algorithm: n.Algorithm(),
		Data:      encrypted,
		Nonce:     nonce[:],
	}, nil
}