-
-void bcal_ofb_encMsg(const void* iv, void* msg, uint32_t msg_len_b, bcal_ofb_ctx_t* ctx){
- uint16_t block_len_b;
- block_len_b = ctx->blocksize_B*8;
- bcal_ofb_loadIV(iv, ctx);
- while(msg_len_b>block_len_b){
- bcal_ofb_encNext(msg, ctx);
- msg_len_b -= block_len_b;
- msg = (uint8_t*)msg + ctx->blocksize_B;
- }
- bcal_cipher_enc(ctx->in_block, &(ctx->cctx));
- ctx->in_block[msg_len_b/8] = 0xff00>>(msg_len_b&7);
- memxor(msg, ctx->in_block, (msg_len_b+7)/8);
+void bcal_ofb_encMsg(const void *iv, void *msg, uint32_t msg_len_b,
+ bcal_ofb_ctx_t *ctx)
+{
+ uint16_t block_len_b;
+ block_len_b = ctx->blocksize_B * 8;
+ bcal_ofb_loadIV(iv, ctx);
+ while (msg_len_b > block_len_b) {
+ bcal_ofb_encNext(msg, ctx);
+ msg_len_b -= block_len_b;
+ msg = (uint8_t*) msg + ctx->blocksize_B;
+ }
+ bcal_cipher_enc(ctx->in_block, &(ctx->cctx));
+ ctx->in_block[msg_len_b / 8] = 0xff00 >> (msg_len_b & 7);
+ memxor(msg, ctx->in_block, (msg_len_b + 7) / 8);