Skip to content

Commit 158897e

Browse files
andrea-caforionasahlpa
authored andcommitted
[doc/rsa] Add missing API functions to the cryptolib documentation
- otcrypto_rsa_encrypt - otcrypto_rsa_decrypt - otcrypto_rsa_keypair_from_cofactor Signed-off-by: Andrea Caforio <[email protected]>
1 parent e383c23 commit 158897e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

doc/security/cryptolib/cryptolib_api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ Always ensure that you fully understand the security implications of the padding
296296
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_private_key_from_exponents }}
297297
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_sign }}
298298
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_verify }}
299+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_encrypt }}
300+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_decrypt }}
301+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_keypair_from_cofactor }}
299302

300303
### RSA Asynchronous API
301304

@@ -305,6 +308,12 @@ Always ensure that you fully understand the security implications of the padding
305308
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_sign_async_finalize }}
306309
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_verify_async_start }}
307310
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_verify_async_finalize }}
311+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_encrypt_async_start }}
312+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_encrypt_async_finalize }}
313+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_decrypt_async_start }}
314+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_decrypt_async_finalize }}
315+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_keypair_from_cofactor_async_start }}
316+
{{#header-snippet sw/device/lib/crypto/include/rsa.h otcrypto_rsa_keypair_from_cofactor_async_finalize }}
308317

309318
## Elliptic curve cryptography
310319

doc/security/cryptolib/security.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ The following software-based countermeasures are implemented:
6666
### RSA
6767
Modular exponentiation is the core operation for both RSA encryption/sign and key generation.
6868
It is implemented as a constant-time Montgomery Ladder with Boolean-masked exponents and blinded base points as detailed in the following works:
69+
6970
- https://eprint.iacr.org/2018/1226.pdf
7071
- https://dl.acm.org/doi/10.1145/1873548.1873556
72+
7173
The combination of both countermeasures results in an exponentiation that is resistant against vertical and horizontal power analysis.
72-
This hardened exponentiation is reused in the primality check routine of the key generation algorithm.
74+
This hardened exponentiation is reused in the primality check routine of the key generation algorithm rendering it equally hardened.
75+
The key generation hardening only applies to [otcrypto_rsa_keygen](https://github.com/lowRISC/opentitan/tree/master/sw/device/lib/crypto/include/rsa.h#L100) and not [otcrypto_rsa_keypair_from_cofactor](https://github.com/lowRISC/opentitan/tree/master/sw/device/lib/crypto/include/rsa.h#L155).

0 commit comments

Comments
 (0)