-void bcal_cfb_b_encNext(void* block, uint8_t offset, bcal_cfb_b_ctx_t* ctx){
- uint8_t tmp[ctx->blocksize_B];
- offset &= 7;
- memcpy(tmp, ctx->in_block, ctx->blocksize_B);
- bcal_cipher_enc(tmp, &(ctx->cctx));
- uint16_t i,j;
- uint8_t a;
- for(i=0; i<ctx->blocksize_B*8-ctx->size_b; ++i){
- a = read_bit(ctx->in_block, i+ctx->size_b);
- write_bit(ctx->in_block, i, a);
- }
- for(j=offset,i=0; i<ctx->size_b; ++i, ++j){
- a = read_bit(tmp, i) ^ read_bit(block, j);
- write_bit(ctx->in_block, ctx->blocksize_B*8-ctx->size_b+i, a);
- write_bit(block, j, a);
- }
+void bcal_cfb_b_encNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx)
+{
+ uint8_t tmp[ctx->blocksize_B];
+ offset &= 7;
+ memcpy(tmp, ctx->in_block, ctx->blocksize_B);
+ bcal_cipher_enc(tmp, &(ctx->cctx));
+ uint16_t i, j;
+ uint8_t a;
+ for (i = 0; i < ctx->blocksize_B * 8 - ctx->size_b; ++i) {
+ a = read_bit(ctx->in_block, i + ctx->size_b);
+ write_bit(ctx->in_block, i, a);
+ }
+ for (j = offset, i = 0; i < ctx->size_b; ++i, ++j) {
+ a = read_bit(tmp, i) ^ read_bit(block, j);
+ write_bit(ctx->in_block, ctx->blocksize_B * 8 - ctx->size_b + i, a);
+ write_bit(block, j, a);
+ }