ok.
I am using openssl 0.9.7b, actually I am adding the mode to test on 3DES and
AES
so I am adding 2 modes, DES-EDE3-HECTR and AES-128-HECTR ( i will exclude
the des files below)

in these files: (3des files not listed)
crypto/evp/c_allc.c,  ssl/ssl_algs.c, apps/progs.pl, crypto/aes/Makefile,
crypto/aes/aes.h
I just add what does CBC do, adding functions, prototypes, filenames,
names...

crypto/aes/aes_ectr.c (3des files not listed)
is my implementation of new mode, but currently I put all code similar to
CBC mode.

in this file crypto/evp/e_aes.c, i add these below IMPLEMENT_BLOCK_CIPHER
function calls:

IMPLEMENT_AES128_HECTR_CIPHER(aes_128, ks, AES, EVP_AES_KEY, NID_aes_128,
32, 16, 32, 256,
0, aes_init_key, NULL, EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)

then in this file crypto/evp/evp_locl.h, I defined
IMPLEMENT_AES128_HECTR_CIPHER just like IMPLEMENT_BLOCK_CIPHER, but just to
add another mode, which all similar parameters,aes_128, ks, AES,
EVP_AES_KEY, NID_aes_128, aes_init_key, ...
except, I change the block size from 16 to 32, and IV from 16 to 32, and
cbit from 128 to 256. I need these in my mode.

and in crypto/objects/objects.txt , I added (actually I don't know what
these files for, just put some possible values there)
rsadsi 3 9 : DES-EDE3-HECTR : des-ede3-hecr
aes 5 : AES-128-HECTR: aes-128-hectr

similarly, in this file crypto/objects/objects.h
#define SN_des_ede3_hectr  "DES-EDE3-HECTR"
#define LN_des_ede3_hectr "des-ede3-hectr"
#define NID_des_ede3_hectr  650
#define OBJ_des_ede3_hectr OBJ_rsadsi, 3L, 9L

and this file crypto/objects/obj_mac.num, i added
des_ede3_hectr 650
aes_128_hectr 651


thanks and regards,
SH Ng


----- Original Message ----- 
From: "Richard Levitte - VMS Whacker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, September 30, 2003 2:34 PM
Subject: Re: aes_init_key


> Show us the code, and we might be able to answer you :-).
>
> In message <[EMAIL PROTECTED]> on Tue, 30 Sep 2003
14:34:27 +0800, "Ng Siak Hooi" <[EMAIL PROTECTED]> said:
>
> shng> I am trying to add new mode to openssl library for AES, an  enhanced
counter
> shng> mode (ECTR)
> shng> I have modified a lot of files, includes:
> shng> apps/progs.pl
> shng> crypto/evp/c_allc.c
> shng> crypto/evp/evp.h
> shng> crypto/evp/e_aes.c
> shng> crypto/aes/aes.h
> shng> crypto/aes/Makefile
> shng> ssl/ssl_algs.c
> shng> crypto/objects/objects.txt
> shng> crypto/objects/objects.h
> shng> crypto/objects/obj_mac.num
> shng>
> shng> added
> shng> crypto/aes/aes_ectr.c
> shng>
> shng> The program compiled OK.
> shng> but where I run with
> shng> ./openssl aes-128-ectr -in test -out test.out
> shng>
> shng> it gave me "Segmentation Fault"
> shng>
> shng> so I tried to figure out what is happening
> shng>
> shng> and found that it looks like doesn't call the
> shng> aes_init_key function. (crypto/evp/e_aes.c)
> shng>
> shng> I put some printf in the aes_init_key function, and it looks no
output.
> shng>
> shng> My question is:
> shng> Are there anythings that I missed to set to make it call
aes_init_key?
> shng>
> shng> thanks and regards,
> shng>
> shng> SH Ng
> shng>
> shng>
______________________________________________________________________
> shng> OpenSSL Project
http://www.openssl.org
> shng> Development Mailing List
[EMAIL PROTECTED]
> shng> Automated List Manager
[EMAIL PROTECTED]
>
>
> __________ NOD32 1.521 (20030928) Information __________
>
> This message was checked by NOD32 Antivirus System.
> http://www.nod32.com
>
>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to