32 size_t cx_pkcs1_get_hash_len(cx_md_t hID);
43 WARN_UNUSED_RESULT cx_err_t cx_pkcs1_emsa_v1o5_encode(cx_md_t hID,
57 bool cx_pkcs1_emsa_v1o5_verify(cx_md_t hID,
76 WARN_UNUSED_RESULT cx_err_t cx_pkcs1_emsa_pss_encode(cx_md_t hID,
93 WARN_UNUSED_RESULT cx_err_t cx_pkcs1_emsa_pss_encode_with_salt_len(cx_md_t hID,
113 bool cx_pkcs1_emsa_pss_verify(cx_md_t hID,
129 bool cx_pkcs1_emsa_pss_verify_with_salt_len(cx_md_t hID,
145 WARN_UNUSED_RESULT cx_err_t cx_pkcs1_eme_v1o5_encode(cx_md_t hID,
159 size_t cx_pkcs1_eme_v1o5_decode(cx_md_t hID,
174 WARN_UNUSED_RESULT cx_err_t
175 cx_pkcs1_eme_oaep_encode(cx_md_t hID,
uint8_t *em,
size_t em_len,
const uint8_t *m,
size_t mLen);
185 WARN_UNUSED_RESULT cx_err_t
186 cx_pkcs1_eme_oaep_decode(cx_md_t hID,
uint8_t *em,
size_t em_len,
uint8_t *m,
size_t *mLen);
189 #define PKCS1_DIGEST_BUFFER_LENGTH 64
194 #if defined(HAVE_SHA256)
198 #if defined(HAVE_SHA512)
202 uint8_t digest[PKCS1_DIGEST_BUFFER_LENGTH];
205 typedef struct cx_pkcs1_s cx_pkcs1_t;
207 #if defined(HAVE_SHA224)
208 #define CX_OID_SHA224_LENGTH 19
209 extern uint8_t const C_cx_oid_sha224[CX_OID_SHA224_LENGTH];
212 #if defined(HAVE_SHA256)
213 #define CX_OID_SHA256_LENGTH 19
214 extern uint8_t const C_cx_oid_sha256[CX_OID_SHA256_LENGTH];
217 #if defined(HAVE_SHA384)
218 #define CX_OID_SHA384_LENGTH 19
219 extern uint8_t const C_cx_oid_sha384[CX_OID_SHA384_LENGTH];
222 #if defined(HAVE_SHA512)
223 #define CX_OID_SHA512_LENGTH 19
224 extern uint8_t const C_cx_oid_sha512[CX_OID_SHA512_LENGTH];
227 #if defined(HAVE_SHA3)
228 #define CX_OID_SHA3_256_LENGTH 19
229 extern uint8_t const C_cx_oid_sha3_256[CX_OID_SHA3_256_LENGTH];
231 #define CX_OID_SHA3_512_LENGTH 19
232 extern uint8_t const C_cx_oid_sha3_512[CX_OID_SHA3_512_LENGTH];
235 WARN_UNUSED_RESULT cx_err_t cx_rsa_get_public_components(
const cx_rsa_public_key_t *key,
238 WARN_UNUSED_RESULT cx_err_t cx_rsa_get_private_components(
const cx_rsa_private_key_t *key,
242 WARN_UNUSED_RESULT cx_err_t cx_rsa_private_key_ctx_size(
const cx_rsa_private_key_t *key,