summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2020-04-08 18:09:31 +0200
committerjonsykkel <jonrevold@gmail.com>2020-04-08 18:09:31 +0200
commit8838a7bd931de3cabbf6cd3cea53a4c2f43ff643 (patch)
treef936c4f39f4b72be129da91892d89edec82c0946
parente3f5d68ba2f223101a3253be2953376c346e9a88 (diff)
downloadct_sequence-8838a7bd931de3cabbf6cd3cea53a4c2f43ff643.tar.gz
ok
-rw-r--r--src/a5.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/a5.c b/src/a5.c
index f2743bc..87f4b2e 100644
--- a/src/a5.c
+++ b/src/a5.c
@@ -25,11 +25,9 @@ void a5_init(uint64_t n){
t = 0;
filled = 0;
index_size = (n-1)/8+1;
- lastp_size = n*sizeof(unsigned int);
- index = malloc(index_size);
+ lastp_size = n*sizeof(uint32_t);
+ index = calloc(index_size,1);
lastp = malloc(lastp_size);
-
- memset(index,0x00,index_size);
}
void a5_loop(uint64_t x0,uint64_t x1){
@@ -44,7 +42,7 @@ void a5_loop(uint64_t x0,uint64_t x1){
index_bit = t & 63;
if(t < filled || ((*index_ptr>>index_bit) & 1)){
- next = x-lastp[t];
+ next = x-lastp[t];
}else{
next = 0;
*index_ptr |= 1ULL<<index_bit;