From 577d8d1951cf2f8436274af6328dcd185118955e Mon Sep 17 00:00:00 2001 From: kubodera_yuichi Date: Wed, 23 Dec 2009 02:19:15 +0000 Subject: [PATCH] =?UTF-8?q?cr=5Fenc=5Fid=20:=20AES,=20RSA=E3=81=AE?= =?UTF-8?q?=E3=83=99=E3=83=AA=E3=83=95=E3=82=A1=E3=82=A4=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@43 ff987cc8-cf2f-4642-8568-d52cce064691 --- cr_enc_id.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cr_enc_id.c b/cr_enc_id.c index bb59ca8..8a3fc51 100644 --- a/cr_enc_id.c +++ b/cr_enc_id.c @@ -193,8 +193,7 @@ int crypto_aes_enc_dec( unsigned char *dst_buf, unsigned char *org_buf, u8 bondi { if( org_buf[i] != local_buf_2[i] ) { - printf( "error : aes verify\n" ); - return 0; + return CR_GENID_ERROR_AES_VERIFY; } } @@ -221,13 +220,13 @@ int crypto_aes_enc_dec( unsigned char *dst_buf, unsigned char *org_buf, u8 bondi if ( AES_set_encrypt_key( pAesKey, 128, &aesEncKey ) != 0 ) { printf( "error : AES_set_encrypt_key\n" ); - return 0; + return CR_GENID_ERROR_AES_ENC; } if ( AES_set_decrypt_key( pAesKey, 128, &aesDecKey ) != 0 ) { printf( "error : AES_set_decrypt_key\n" ); - return 0; + return CR_GENID_ERROR_AES_DEC; } memcpy( temp_iv, pIV, 16 ); @@ -241,8 +240,7 @@ int crypto_aes_enc_dec( unsigned char *dst_buf, unsigned char *org_buf, u8 bondi { if( org_buf[i] != local_buf_2[i] ) { - printf( "error : aes verify\n" ); - return 0; + return CR_GENID_ERROR_AES_VERIFY; } } @@ -284,7 +282,7 @@ int crypto_rsa_enc_dec( unsigned char *dst_buf,unsigned char *org_buf, u8 bondin { if( org_buf[i] != local_buf_2[i] ) { - return CR_GENID_ERROR_AES_VERIFY; + return CR_GENID_ERROR_RSA_VERIFY; } }