Skip to content

Commit

Permalink
Merge pull request wolfSSL#7750 from space88man/wip-padding-refactor
Browse files Browse the repository at this point in the history
PKCS#11 RSA Padding Offload
  • Loading branch information
SparkiDev authored Jul 24, 2024
2 parents 3a4788b + d2d71c2 commit 324e714
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions wolfssl/wolfcrypt/pkcs11.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,22 @@ extern "C" {
#define CKA_HAS_RESET 0x00000302UL

#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
#define CKM_RSA_PKCS 0x00000001UL
#define CKM_RSA_X_509 0x00000003UL
#define CKM_RSA_PKCS_OAEP 0x00000009UL
#define CKM_RSA_PKCS_PSS 0x0000000DUL
#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
#define CKM_DH_PKCS_DERIVE 0x00000021UL
#define CKM_MD5_HMAC 0x00000211UL
#define CKM_SHA_1 0x00000220UL
#define CKM_SHA_1_HMAC 0x00000221UL
#define CKM_SHA256 0x00000250UL
#define CKM_SHA256_HMAC 0x00000251UL
#define CKM_SHA224 0x00000255UL
#define CKM_SHA224_HMAC 0x00000256UL
#define CKM_SHA384 0x00000260UL
#define CKM_SHA384_HMAC 0x00000261UL
#define CKM_SHA512 0x00000270UL
#define CKM_SHA512_HMAC 0x00000271UL
#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
Expand All @@ -156,12 +164,19 @@ extern "C" {
#define CKM_AES_CBC 0x00001082UL
#define CKM_AES_GCM 0x00001087UL

#define CKG_MGF1_SHA1 0x00000001UL
#define CKG_MGF1_SHA224 0x00000005UL
#define CKG_MGF1_SHA256 0x00000002UL
#define CKG_MGF1_SHA384 0x00000003UL
#define CKG_MGF1_SHA512 0x00000004UL


#define CKR_OK 0x00000000UL
#define CKR_MECHANISM_INVALID 0x00000070UL
#define CKR_SIGNATURE_INVALID 0x000000C0UL

#define CKD_NULL 0x00000001UL

#define CKZ_DATA_SPECIFIED 0x00000001UL

typedef unsigned char CK_BYTE;
typedef CK_BYTE CK_CHAR;
Expand Down Expand Up @@ -339,6 +354,26 @@ typedef struct CK_GCM_PARAMS {
} CK_GCM_PARAMS;
typedef CK_GCM_PARAMS* CK_GCM_PARAMS_PTR;

typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE;

typedef struct CK_RSA_PKCS_PSS_PARAMS {
CK_MECHANISM_TYPE hashAlg;
CK_RSA_PKCS_MGF_TYPE mgf;
CK_ULONG sLen;
} CK_RSA_PKCS_PSS_PARAMS;
typedef CK_RSA_PKCS_PSS_PARAMS *CK_RSA_PKCS_PSS_PARAMS_PTR;

typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE;

typedef struct CK_RSA_PKCS_OAEP_PARAMS {
CK_MECHANISM_TYPE hashAlg;
CK_RSA_PKCS_MGF_TYPE mgf;
CK_RSA_PKCS_OAEP_SOURCE_TYPE source;
CK_VOID_PTR pSourceData;
CK_ULONG ulSourceDataLen;
} CK_RSA_PKCS_OAEP_PARAMS;
typedef CK_RSA_PKCS_OAEP_PARAMS *CK_RSA_PKCS_OAEP_PARAMS_PTR;

/* Function list types. */
typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST;
typedef CK_FUNCTION_LIST* CK_FUNCTION_LIST_PTR;
Expand Down Expand Up @@ -538,4 +573,3 @@ struct CK_FUNCTION_LIST {
#endif

#endif /* _PKCS11_H_ */

0 comments on commit 324e714

Please sign in to comment.