Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: srtp/crypto/math/datatypes.c

Issue 1098043003: Update libsrtp to 1.5.2 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libsrtp@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « srtp/crypto/include/sha1.h ('k') | srtp/crypto/test/cipher_driver.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * datatypes.c 2 * datatypes.c
3 * 3 *
4 * data types for finite fields and functions for input, output, and 4 * data types for finite fields and functions for input, output, and
5 * manipulation 5 * manipulation
6 * 6 *
7 * David A. McGrew 7 * David A. McGrew
8 * Cisco Systems, Inc. 8 * Cisco Systems, Inc.
9 */ 9 */
10 /* 10 /*
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } while (++s < end); 528 } while (++s < end);
529 529
530 } 530 }
531 531
532 #ifdef TESTAPP_SOURCE 532 #ifdef TESTAPP_SOURCE
533 533
534 static const char b64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 534 static const char b64chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
535 "abcdefghijklmnopqrstuvwxyz0123456789+/"; 535 "abcdefghijklmnopqrstuvwxyz0123456789+/";
536 536
537 static int base64_block_to_octet_triple(char *out, char *in) { 537 static int base64_block_to_octet_triple(char *out, char *in) {
538 unsigned char sextets[4] = {}; 538 unsigned char sextets[4] = {0};
539 int j = 0; 539 int j = 0;
540 int i; 540 int i;
541 541
542 for (i = 0; i < 4; i++) { 542 for (i = 0; i < 4; i++) {
543 char *p = strchr(b64chars, in[i]); 543 char *p = strchr(b64chars, in[i]);
544 if (p != NULL) sextets[i] = p - b64chars; 544 if (p != NULL) sextets[i] = p - b64chars;
545 else j++; 545 else j++;
546 } 546 }
547 547
548 out[0] = (sextets[0]<<2)|(sextets[1]>>4); 548 out[0] = (sextets[0]<<2)|(sextets[1]>>4);
(...skipping 11 matching lines...) Expand all
560 while (i < len && j == 0) { 560 while (i < len && j == 0) {
561 j = base64_block_to_octet_triple(out + k, in + i); 561 j = base64_block_to_octet_triple(out + k, in + i);
562 k += 3; 562 k += 3;
563 i += 4; 563 i += 4;
564 } 564 }
565 *pad = j; 565 *pad = j;
566 return i; 566 return i;
567 } 567 }
568 568
569 #endif 569 #endif
OLDNEW
« no previous file with comments | « srtp/crypto/include/sha1.h ('k') | srtp/crypto/test/cipher_driver.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698