Search Results

Search found 2 results on 1 pages for 'luiss'.

Page 1/1 | 1 

  • How to cycle through matrix blocks?

    - by luiss
    I have some matrix which I want to cycle through blocks, the matrix could be of many different sizes, but I can know the size, is there a way to fast cycle through blocks? i.e: to fast output the indexes of the blocks, suppose a matrix of 4*4 I should have: Block1: (0,0),(0,1)(1,0)(1,1) Block2: (0,2),(0,3)(1,2)(1,3) Block3: (2,0),(2,1)(3,0)(3,1) Block4: (2,2),(2,3)(3,2)(3,3) Where the indexes are (row,col). For blocks I mean a submatrix of size sqrt(matrixSize)* sqrt(matrixSize) where matrix is a matrix of matrixSize*matrixSize. For example a matrix of 4*4 has 4 blocks of 2*2, a 9*9 has 9 blocks of 3*3... I'm workdeing in C, but I think that the pseudocode is useful also, I only need the loop on the indexes... Thanks

    Read the article

  • EMSA_PSS_ENCODE with libssl

    - by luiss
    Hi I'm trying to use libssl to get some EMSA_PSS_ENCRODING through the function RSA_padding_add_PKCS1_type1 in libssl, but I can't find nor docs nor solutions, so this is the example code I've written: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <openssl/rsa.h> #include <openssl/err.h> FILE *error_file; int main() { int lSize; const unsigned char *string1= (unsigned char *)"The pen is on the table"; unsigned char *stringa=NULL; int num = 64; if ((stringa = (unsigned char *)OPENSSL_malloc(num)) == NULL) fprintf(stderr,"OPENSSL_malloc error\n"); fprintf(stdout,"string1 len is %u\n",lSize); if(RSA_padding_add_PKCS1_type_1(stringa,num,string1,lSize) != 1) fprintf(stderr,"Error: RSA_PADDING error\n"); error_file = fopen("libssl.log", "w"); ERR_print_errors_fp(error_file); fclose(error_file); fprintf(stdout,(char *)stringa); fprintf(stdout,"\n"); } The problem is that I get no output in stringa, I think the function RSA_padding_add.. should be initialized, but I can't find how to do it in the few doc at the openssl site. Thanks

    Read the article

1