|
|
View previous topic :: View next topic |
Author |
Message |
a Guest
|
Can i use this line in CCS C compiler. |
Posted: Tue Mar 02, 2004 6:53 am |
|
|
Can i use this line in CCS C compiler.
==============================
unsigned char Key_Schedule[16][48];
==============================
This line is must use in DES Algorithm.
Compiler warning
How i use it? Or i Can't. |
|
|
Felix Althaus
Joined: 09 Sep 2003 Posts: 67 Location: Winterthur, Switzerland
|
|
Posted: Tue Mar 02, 2004 7:04 am |
|
|
Hello
I think it should be possible if yo use a PIC which has 16*48 = 768 bytes of ROM empty for the array.
What warning do you get?
Felix |
|
|
Guest
|
a |
Posted: Tue Mar 02, 2004 7:07 am |
|
|
Compiler warning.
Not enough RAM for all variables. |
|
|
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
|
Posted: Tue Mar 02, 2004 7:07 am |
|
|
I don't see why not. Are you claiming that we get an error message ? If so, what ?
Of course, your choice of PIC may be of influence !! You're creating an array that contains 768 bytes of data, and (a) not all PICs have that much RAM and (b) I don't think all PICs support large tables. |
|
|
Ttelmah Guest
|
Re: Can i use this line in CCS C compiler. |
Posted: Tue Mar 02, 2004 11:07 am |
|
|
a wrote: | Can i use this line in CCS C compiler.
==============================
unsigned char Key_Schedule[16][48];
==============================
This line is must use in DES Algorithm.
Compiler warning
How i use it? Or i Can't. |
Only in an 18 family chip.
On all the other chips, the maximum array size is limited by the RAM banksize available.
Best Wishes |
|
|
Guest
|
|
Posted: Tue Mar 02, 2004 1:31 pm |
|
|
Sorry for my fault post. because i rectify this line from
unsigned char Key_Schedule[16][48];
to
unsigned char Key_Schedule[128];
I'am so Sorry For my fault.
Compiler Show :
===============================================
Error[45] C:\Micropro\SourceCode_Picc\DES.c 7 : Subscript out of range
===============================================
And how i solve my problem. Please tell me.
Below is all my sourcecode that i test.
===============================================
#include "C:\Micropro\SourceCode_Picc\DES.h"
#include<string.h>
#define DES_ENCRYPT 1
#define DES_DNCRYPT 0
unsigned char Key_Schedule[16][48]; <--This line i am fault post; Sorry
//static const unsigned char LS[17]={1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1};
//unsigned char PC1[56]={57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4};
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_counters(RTCC_INTERNAL,RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
while(1)
{
delay_ms(100);
}
}
=============================================== |
|
|
Guest
|
a |
Posted: Tue Mar 02, 2004 1:59 pm |
|
|
Now i change from Pic16f877 to Pic18f458 in my sourcecode everything is OK. But if i want use it int Pic16f877. Can i do it . Because i will write this sourcecode in SmartCard (Silvercard -->Pic16f87+24LC64). Thank you for all post . Please tell me if u have any idea. Or Anyone have sourcecode Des Algorithm or other Encryption/Decryption in C language.
I will use Silvercard (Pic16f877+24LC64). |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|