-void bcal_stacksize(const bcdesc_t* bcd){
- bcdesc_t bc;
- stack_measuring_ctx_t smctx;
- memcpy_P(&bc, bcd, sizeof(bcdesc_t));
- uint8_t ctx[bc.ctxsize_B];
- uint8_t data[(bc.blocksize_b+7)/8];
- uint16_t keysize = get_keysize(bc.valid_keysize_desc);
- uint8_t key[(keysize+7)/8];
- uint16_t t1 = 0, t2 = 0;
-
- if(bc.type != BCDESC_TYPE_BLOCKCIPHER)
- return;
- printf_P(PSTR("\n === %S stack-usage ===\n"),bc.name);
-
- uart0_flush();
-
- if(bc.init.init1){
- if((bc.flags & BC_INIT_TYPE) == BC_INIT_TYPE_1){
- cli();
- stack_measure_init(&smctx, PATTERN_A);
- bc.init.init1(&ctx, key);
- t1 = stack_measure_final(&smctx);
- stack_measure_init(&smctx, PATTERN_B);
- bc.init.init1(&ctx, key);
- t2 = stack_measure_final(&smctx);
- sei();
- } else {
- cli();
- stack_measure_init(&smctx, PATTERN_A);
- bc.init.init2(&ctx, keysize, key);
- t1 = stack_measure_final(&smctx);
- stack_measure_init(&smctx, PATTERN_B);
- bc.init.init2(&ctx, keysize, key);
+void bcal_stacksize(const bcdesc_t *bcd)
+{
+ bcdesc_t bc;
+ stack_measuring_ctx_t smctx;
+ memcpy_P(&bc, bcd, sizeof(bcdesc_t));
+ uint8_t ctx[bc.ctxsize_B];
+ uint8_t data[(bc.blocksize_b + 7) / 8];
+ uint16_t keysize = get_keysize(bc.valid_keysize_desc);
+ uint8_t key[(keysize + 7) / 8];
+ uint16_t t1 = 0, t2 = 0;
+
+ if (bc.type != BCDESC_TYPE_BLOCKCIPHER)
+ return;
+ printf_P(PSTR("\n === %S stack-usage ===\n"), bc.name);
+
+ uart0_flush();
+
+ if (bc.init.init1) {
+ if ((bc.flags & BC_INIT_TYPE) == BC_INIT_TYPE_1) {
+ cli();
+ stack_measure_init(&smctx, PATTERN_A);
+ bc.init.init1(&ctx, key);
+ t1 = stack_measure_final(&smctx);
+ stack_measure_init(&smctx, PATTERN_B);
+ bc.init.init1(&ctx, key);
+ t2 = stack_measure_final(&smctx);
+ sei();
+ } else {
+ cli();
+ stack_measure_init(&smctx, PATTERN_A);
+ bc.init.init2(&ctx, keysize, key);
+ t1 = stack_measure_final(&smctx);
+ stack_measure_init(&smctx, PATTERN_B);
+ bc.init.init2(&ctx, keysize, key);