blob: d73098df04aadc55bd882423ece0bf63914bf6d9 [file] [log] [blame]
Daisuke Nojiri8130e502016-09-14 12:55:20 -07001/* Copyright 2016 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6#include <string.h>
7
8#include "2sha.h"
9#include "bdb.h"
10
11int bdb_sha256(void *digest, const void *buf, size_t size)
12{
13 struct vb2_sha256_context ctx;
14
15 vb2_sha256_init(&ctx);
16 vb2_sha256_update(&ctx, buf, size);
17 vb2_sha256_finalize(&ctx, digest);
18
19 return BDB_SUCCESS;
20}