Software APIs
ecc256_modinv_serial.h
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_SCA_OTBN_VERTICAL_ECC256_MODINV_SERIAL_H_
6 #define OPENTITAN_SW_DEVICE_SCA_OTBN_VERTICAL_ECC256_MODINV_SERIAL_H_
7 
8 #include "sw/device/lib/crypto/drivers/otbn.h"
9 
10 /**
11  * App configuration for p256_mod_inv_sca
12  */
13 OTBN_DECLARE_APP_SYMBOLS(p256_mod_inv_sca);
14 
15 OTBN_DECLARE_SYMBOL_ADDR(p256_mod_inv_sca, k0);
16 OTBN_DECLARE_SYMBOL_ADDR(p256_mod_inv_sca, k1);
17 OTBN_DECLARE_SYMBOL_ADDR(p256_mod_inv_sca, kalpha_inv);
18 OTBN_DECLARE_SYMBOL_ADDR(p256_mod_inv_sca, alpha);
19 
20 extern const otbn_app_t kOtbnAppP256ModInv;
21 
22 static const otbn_addr_t kOtbnVarModInvK0;
23 static const otbn_addr_t kOtbnVarModInvK1;
24 static const otbn_addr_t kOtbnVarModInvKAplhaInv;
25 static const otbn_addr_t kOtbnVarModInvAlpha;
26 
27 /**
28  * Computes the modular inverse of a certain input.
29  *
30  * The input must be `kEcc256ModInvInputShareNumWords` words long.
31  *
32  * @param[in] input Input for modular inverse computation.
33  */
34 void ecc256_modinv(const uint8_t *k0_k1, size_t k0_k1_len);
35 
36 #endif // OPENTITAN_SW_DEVICE_SCA_OTBN_VERTICAL_ECC256_MODINV_SERIAL_H_