]> git.cryptolib.org Git - arm-crypto-lib.git/commitdiff
also from the length_B -> length_W migration
authorbg <daniel.otte@rub.de>
Tue, 18 Sep 2012 15:49:27 +0000 (17:49 +0200)
committerbg <daniel.otte@rub.de>
Tue, 18 Sep 2012 15:49:27 +0000 (17:49 +0200)
test_src/main-rsassa_pkcs1v15-test.c

index 178d4644f5cfbafb72f047538ad96e4eb2e0c281..875f0f955ef37f47cfc65fe3f08b5c8e31361044 100644 (file)
@@ -312,7 +312,7 @@ uint8_t read_bigint(bigint_t* a, char* prompt){
                return 1;
        }
        a->wordv = (bigint_word_t*)buffer;
-       a->length_B = (read_length + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
+       a->length_W = (read_length + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
        a->info = 0;
        bigint_changeendianess(a);
        bigint_adjust(a);
@@ -382,9 +382,9 @@ uint8_t read_key_conv(void){
 
 void load_priv_conventional(void){
        priv_key.components = malloc(sizeof(bigint_t));
-       priv_key.components[0].length_B = (sizeof(PRIV_EXPONENT) +
+       priv_key.components[0].length_W = (sizeof(PRIV_EXPONENT) +
                        sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
-       priv_key.components[0].wordv =  malloc(priv_key.components[0].length_B *
+       priv_key.components[0].wordv =  malloc(priv_key.components[0].length_W *
                        sizeof(bigint_word_t));
        if(!priv_key.components[0].wordv){
                cli_putstr("\r\nERROR: OOM!");
@@ -411,8 +411,8 @@ void load_priv_crt_mono(void){
        priv_key.n = 5;
        for(i=0; i<5; ++i){
                v[i].info = 0;
-               v[i].length_B = (sv[i] + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
-               v[i].wordv = calloc(v[i].length_B , sizeof(bigint_word_t));
+               v[i].length_W = (sv[i] + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
+               v[i].wordv = calloc(v[i].length_W , sizeof(bigint_word_t));
                if(!v[i].wordv){
                        cli_putstr("\r\nERROR: OOM!");
                        return;
@@ -424,7 +424,7 @@ void load_priv_crt_mono(void){
 }
 
 uint8_t load_bigint_from_os(bigint_t* a, const void* os, uint16_t length_B){
-       a->length_B = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
+       a->length_W = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
        a->wordv = malloc(BIGINT_CEIL(length_B));
        if(!a->wordv){
                cli_putstr("\r\nOOM!\r\n");
@@ -471,7 +471,7 @@ void quick_test(void){
        }
        msg = malloc(sizeof(MSG));
        memcpy(msg, MSG, sizeof(MSG));
-       sign = malloc(pub_key.modulus.length_B * sizeof(bigint_word_t));
+       sign = malloc(pub_key.modulus.length_W * sizeof(bigint_word_t));
        cli_putstr("\r\nhashing:...");
        sha1(hash, msg, sizeof(MSG) * 8);
        cli_putstr("\r\nsigning: ...");