40 #define _AES_IMPL
41 #include <aes/aes_impl.h>
42
43 extern struct mod_ops mod_cryptoops;
44
45 /*
46 * Module linkage information for the kernel.
47 */
48 static struct modlcrypto modlcrypto = {
49 &mod_cryptoops,
50 "AES Kernel SW Provider"
51 };
52
53 static struct modlinkage modlinkage = {
54 MODREV_1,
55 (void *)&modlcrypto,
56 NULL
57 };
58
59 /*
60 * The following definitions are to keep EXPORT_SRC happy.
61 */
62 #ifndef AES_MIN_KEY_BYTES
63 #define AES_MIN_KEY_BYTES 0
64 #endif
65
66 #ifndef AES_MAX_KEY_BYTES
67 #define AES_MAX_KEY_BYTES 0
68 #endif
69
70 /*
71 * Mechanism info structure passed to KCF during registration.
72 */
73 static crypto_mech_info_t aes_mech_info_tab[] = {
74 /* AES_ECB */
75 {SUN_CKM_AES_ECB, AES_ECB_MECH_INFO_TYPE,
76 CRYPTO_FG_ENCRYPT | CRYPTO_FG_ENCRYPT_ATOMIC |
77 CRYPTO_FG_DECRYPT | CRYPTO_FG_DECRYPT_ATOMIC,
78 AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES},
79 /* AES_CBC */
80 {SUN_CKM_AES_CBC, AES_CBC_MECH_INFO_TYPE,
81 CRYPTO_FG_ENCRYPT | CRYPTO_FG_ENCRYPT_ATOMIC |
82 CRYPTO_FG_DECRYPT | CRYPTO_FG_DECRYPT_ATOMIC,
83 AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES},
84 /* AES_CTR */
85 {SUN_CKM_AES_CTR, AES_CTR_MECH_INFO_TYPE,
86 CRYPTO_FG_ENCRYPT | CRYPTO_FG_ENCRYPT_ATOMIC |
87 CRYPTO_FG_DECRYPT | CRYPTO_FG_DECRYPT_ATOMIC,
88 AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES},
89 /* AES_CCM */
90 {SUN_CKM_AES_CCM, AES_CCM_MECH_INFO_TYPE,
|
40 #define _AES_IMPL
41 #include <aes/aes_impl.h>
42
43 extern struct mod_ops mod_cryptoops;
44
45 /*
46 * Module linkage information for the kernel.
47 */
48 static struct modlcrypto modlcrypto = {
49 &mod_cryptoops,
50 "AES Kernel SW Provider"
51 };
52
53 static struct modlinkage modlinkage = {
54 MODREV_1,
55 (void *)&modlcrypto,
56 NULL
57 };
58
59 /*
60 * Mechanism info structure passed to KCF during registration.
61 */
62 static crypto_mech_info_t aes_mech_info_tab[] = {
63 /* AES_ECB */
64 {SUN_CKM_AES_ECB, AES_ECB_MECH_INFO_TYPE,
65 CRYPTO_FG_ENCRYPT | CRYPTO_FG_ENCRYPT_ATOMIC |
66 CRYPTO_FG_DECRYPT | CRYPTO_FG_DECRYPT_ATOMIC,
67 AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES},
68 /* AES_CBC */
69 {SUN_CKM_AES_CBC, AES_CBC_MECH_INFO_TYPE,
70 CRYPTO_FG_ENCRYPT | CRYPTO_FG_ENCRYPT_ATOMIC |
71 CRYPTO_FG_DECRYPT | CRYPTO_FG_DECRYPT_ATOMIC,
72 AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES},
73 /* AES_CTR */
74 {SUN_CKM_AES_CTR, AES_CTR_MECH_INFO_TYPE,
75 CRYPTO_FG_ENCRYPT | CRYPTO_FG_ENCRYPT_ATOMIC |
76 CRYPTO_FG_DECRYPT | CRYPTO_FG_DECRYPT_ATOMIC,
77 AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES},
78 /* AES_CCM */
79 {SUN_CKM_AES_CCM, AES_CCM_MECH_INFO_TYPE,
|