summaryrefslogtreecommitdiff
path: root/firmware/2lib
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib')
-rw-r--r--firmware/2lib/2rsa.c1
-rw-r--r--firmware/2lib/include/2rsa_private.h21
2 files changed, 22 insertions, 0 deletions
diff --git a/firmware/2lib/2rsa.c b/firmware/2lib/2rsa.c
index 962558df..dcd8bad0 100644
--- a/firmware/2lib/2rsa.c
+++ b/firmware/2lib/2rsa.c
@@ -11,6 +11,7 @@
#include "2common.h"
#include "2rsa.h"
+#include "2rsa_private.h"
#include "2sha.h"
#include "2sysincludes.h"
#include "vboot_test.h"
diff --git a/firmware/2lib/include/2rsa_private.h b/firmware/2lib/include/2rsa_private.h
new file mode 100644
index 00000000..23a2aaca
--- /dev/null
+++ b/firmware/2lib/include/2rsa_private.h
@@ -0,0 +1,21 @@
+/* Copyright 2021 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.
+ *
+ * Internal functions from 2rsa.c that have error conditions we can't trigger
+ * from the public APIs. These include checks for bad algorithms where the
+ * next call level up already checks for bad algorithms, etc.
+ *
+ * These functions aren't in 2rsa.h because they're not part of the public
+ * APIs.
+ */
+
+#ifndef VBOOT_REFERENCE_2RSA_PRIVATE_H_
+#define VBOOT_REFERENCE_2RSA_PRIVATE_H_
+
+struct vb2_public_key;
+int vb2_mont_ge(const struct vb2_public_key *key, uint32_t *a);
+vb2_error_t vb2_check_padding(const uint8_t *sig,
+ const struct vb2_public_key *key);
+
+#endif /* VBOOT_REFERENCE_2RSA_PRIVATE_H_ */