summaryrefslogtreecommitdiff
path: root/chip/host/dcrypto/app_key.c
blob: 2c993bdbce3096912857993d0d872557956d19ba (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
/* Copyright 2018 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "dcrypto.h"

static int dcrypto_appkey_init_flag_ = -1;

int DCRYPTO_appkey_init(enum dcrypto_appid appid)
{
	if (dcrypto_appkey_init_flag_ != -1)
		return 0;

	dcrypto_appkey_init_flag_ = appid;
	return 1;
}

void DCRYPTO_appkey_finish(void)
{
	dcrypto_appkey_init_flag_ = -1;
}

int DCRYPTO_appkey_derive(enum dcrypto_appid appid, const uint32_t input[8],
			  uint32_t output[8])
{
	/* See README.md for while this is a passthrough. */
	memcpy(output, input, SHA256_DIGEST_SIZE);
	return 1;
}