diff options
author | Richard Levitte <levitte@openssl.org> | 2011-03-24 22:55:02 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2011-03-24 22:55:02 +0000 |
commit | 399aa6b5ffd37e2601af4524bb71d862cbee4a84 (patch) | |
tree | 4a8007b086c33a2525c237209fbfbd6bb6070b9f /crypto/evp/evp.h | |
parent | 487b023f3d30114cad2118be70a47171ea4d65cd (diff) |
Implement FIPS CMAC.
* fips/cmac/*: Implement the basis for FIPS CMAC, using FIPS HMAC as
an example.
* crypto/cmac/cmac.c: Enable the FIPS API. Change to use M_EVP macros
where possible.
* crypto/evp/evp.h: (some of the macros get added with this change)
* fips/fips.h, fips/utl/fips_enc.c: Add a few needed functions and use
macros to have cmac.c use these functions.
* Makefile.org, fips/Makefile, fips/fips.c: Hook it in.
Diffstat (limited to 'crypto/evp/evp.h')
-rw-r--r-- | crypto/evp/evp.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 240d9d5d69..8e041c56d1 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -458,12 +458,23 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, #define M_EVP_MD_CTX_type(e) M_EVP_MD_type(M_EVP_MD_CTX_md(e)) #define M_EVP_MD_CTX_md(e) ((e)->digest) -#define M_EVP_CIPHER_CTX_iv_length(e) (e->cipher->iv_len) -#define M_EVP_CIPHER_CTX_flags(e) (e->cipher->flags) +#define M_EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) +#define M_EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags) +#define M_EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) +#define M_EVP_CIPHER_CTX_cipher(e) ((e)->cipher) #define M_EVP_CIPHER_CTX_mode(e) (M_EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE) #define M_EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) +#define M_EVP_EncryptInit(ctx,ciph,key,iv) \ + (EVP_CipherInit(ctx,ciph,key,iv,1)) +#define M_EVP_EncryptInit_ex(ctx,ciph,impl,key,iv) \ + (EVP_CipherInit_ex(ctx,ciph,impl,key,iv,1)) +#define M_EVP_DecryptInit(ctx,ciph,key,iv) \ + (EVP_CipherInit(ctx,ciph,key,iv,0)) +#define M_EVP_DecryptInit_ex(ctx,ciph,impl,key,iv) \ + (EVP_CipherInit_ex(ctx,ciph,impl,key,iv,0)) + int EVP_MD_type(const EVP_MD *md); #define EVP_MD_nid(e) EVP_MD_type(e) #define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) @@ -1288,7 +1299,9 @@ void ERR_load_EVP_strings(void); #define EVP_F_EVP_SIGNFINAL 107 #define EVP_F_EVP_VERIFYFINAL 108 #define EVP_F_FIPS_CIPHERINIT 166 +#define EVP_F_FIPS_CIPHER_CTX_COPY 170 #define EVP_F_FIPS_CIPHER_CTX_CTRL 167 +#define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171 #define EVP_F_FIPS_DIGESTINIT 168 #define EVP_F_FIPS_MD_CTX_COPY 169 #define EVP_F_INT_CTX_NEW 157 |