[BACK]Return to cipher-chachapoly.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/cipher-chachapoly.c between version 1.5 and 1.6

version 1.5, 2014/06/24 01:13:21 version 1.6, 2014/07/03 12:42:16
Line 63 
Line 63 
         chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL);          chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL);
         chacha_encrypt_bytes(&ctx->main_ctx,          chacha_encrypt_bytes(&ctx->main_ctx,
             poly_key, poly_key, sizeof(poly_key));              poly_key, poly_key, sizeof(poly_key));
         /* Set Chacha's block counter to 1 */  
         chacha_ivsetup(&ctx->main_ctx, seqbuf, one);  
   
         /* If decrypting, check tag before anything else */          /* If decrypting, check tag before anything else */
         if (!do_encrypt) {          if (!do_encrypt) {
Line 76 
Line 74 
                         goto out;                          goto out;
                 }                  }
         }          }
   
         /* Crypt additional data */          /* Crypt additional data */
         if (aadlen) {          if (aadlen) {
                 chacha_ivsetup(&ctx->header_ctx, seqbuf, NULL);                  chacha_ivsetup(&ctx->header_ctx, seqbuf, NULL);
                 chacha_encrypt_bytes(&ctx->header_ctx, src, dest, aadlen);                  chacha_encrypt_bytes(&ctx->header_ctx, src, dest, aadlen);
         }          }
   
           /* Set Chacha's block counter to 1 */
           chacha_ivsetup(&ctx->main_ctx, seqbuf, one);
         chacha_encrypt_bytes(&ctx->main_ctx, src + aadlen,          chacha_encrypt_bytes(&ctx->main_ctx, src + aadlen,
             dest + aadlen, len);              dest + aadlen, len);
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6