blob: b15d8a1eaf419c4eeca52bfdb093bb058a1b526d [file] [log] [blame]
Alexandru Gagniuc32abcbd2021-02-19 12:45:11 -06001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (c) 2020, Alexandru Gagniuc <mr.nuke.me@gmail.com>
4 * Copyright (c) 2013, Google Inc.
5 */
6
7#ifndef _FDT_LIBCRYPTO_H
8#define _FDT_LIBCRYPTO_H
9
10#include <openssl/bn.h>
11
12/**
13 * fdt_add_bignum() - Write a libcrypto BIGNUM as an FDT property
14 *
15 * Convert a libcrypto BIGNUM * into a big endian array of integers.
16 *
17 * @blob: FDT blob to modify
18 * @noffset: Offset of the FDT node
19 * @prop_name: What to call the property in the FDT
20 * @num: pointer to a libcrypto big number
21 * @num_bits: How big is 'num' in bits?
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010022 * Return: 0 if all good all working, -ve on horror
Alexandru Gagniuc32abcbd2021-02-19 12:45:11 -060023 */
24int fdt_add_bignum(void *blob, int noffset, const char *prop_name,
25 BIGNUM *num, int num_bits);
26
27#endif /* _FDT_LIBCRYPTO_H */