summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-tegra/crypto.h
blob: 930bc842039169daa20cdbe32017e5b34199a1d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (c) 2011 The Chromium OS Authors.
 * (C) Copyright 2010 - 2011 NVIDIA Corporation <www.nvidia.com>
 */

#ifndef _CRYPTO_H_
#define _CRYPTO_H_

#define TEGRA_AES_SLOT_SBK		0

/**
 * sign_data_block - Sign a block of data
 *
 * @source		Source data
 * @length		Size of source data in bytes
 * @signature		Destination address for signature, AES_KEY_LENGTH bytes
 * Return:		0 on success, negative value on failure
 */
int sign_data_block(u8 *source, unsigned int length, u8 *signature);

/**
 * encrypt_data_block - Encrypt a block of data
 *
 * @source		Source data
 * @dest		Destination data
 * @length		Size of source data in bytes
 * Return:		0 on success, negative value on failure
 */
int encrypt_data_block(u8 *source, u8 *dest, unsigned int length);

/**
 * decrypt_data_block - Decrypt a block of data
 *
 * @source		Source data
 * @dest		Destination data
 * @length		Size of source data in bytes
 * Return:		0 on success, negative value on failure
 */
int decrypt_data_block(u8 *source, u8 *dest, unsigned int length);

#endif /* #ifndef _CRYPTO_H_ */