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

Side by Side Diff: openssl/crypto/ec/ecp_smpl.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « openssl/crypto/ec/ecp_nist.c ('k') | openssl/crypto/ec/ectest.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 /* crypto/ec/ecp_smpl.c */ 1 /* crypto/ec/ecp_smpl.c */
2 /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2 /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. 3 * for the OpenSSL project.
4 * Includes code written by Bodo Moeller for the OpenSSL project. 4 * Includes code written by Bodo Moeller for the OpenSSL project.
5 */ 5 */
6 /* ==================================================================== 6 /* ====================================================================
7 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 7 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); 1399 int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
1400 BN_CTX *new_ctx = NULL; 1400 BN_CTX *new_ctx = NULL;
1401 BIGNUM *tmp1, *tmp2, *Za23, *Zb23; 1401 BIGNUM *tmp1, *tmp2, *Za23, *Zb23;
1402 const BIGNUM *tmp1_, *tmp2_; 1402 const BIGNUM *tmp1_, *tmp2_;
1403 int ret = -1; 1403 int ret = -1;
1404 1404
1405 if (EC_POINT_is_at_infinity(group, a)) 1405 if (EC_POINT_is_at_infinity(group, a))
1406 { 1406 {
1407 return EC_POINT_is_at_infinity(group, b) ? 0 : 1; 1407 return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
1408 } 1408 }
1409
1410 if (EC_POINT_is_at_infinity(group, b))
1411 return 1;
1409 1412
1410 if (a->Z_is_one && b->Z_is_one) 1413 if (a->Z_is_one && b->Z_is_one)
1411 { 1414 {
1412 return ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0 ) ? 0 : 1; 1415 return ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0 ) ? 0 : 1;
1413 } 1416 }
1414 1417
1415 field_mul = group->meth->field_mul; 1418 field_mul = group->meth->field_mul;
1416 field_sqr = group->meth->field_sqr; 1419 field_sqr = group->meth->field_sqr;
1417 1420
1418 if (ctx == NULL) 1421 if (ctx == NULL)
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 int ec_GFp_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, c onst BIGNUM *b, BN_CTX *ctx) 1710 int ec_GFp_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, c onst BIGNUM *b, BN_CTX *ctx)
1708 { 1711 {
1709 return BN_mod_mul(r, a, b, &group->field, ctx); 1712 return BN_mod_mul(r, a, b, &group->field, ctx);
1710 } 1713 }
1711 1714
1712 1715
1713 int ec_GFp_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, B N_CTX *ctx) 1716 int ec_GFp_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, B N_CTX *ctx)
1714 { 1717 {
1715 return BN_mod_sqr(r, a, &group->field, ctx); 1718 return BN_mod_sqr(r, a, &group->field, ctx);
1716 } 1719 }
OLDNEW
« no previous file with comments | « openssl/crypto/ec/ecp_nist.c ('k') | openssl/crypto/ec/ectest.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698