ectest.c (269682) | ectest.c (273144) |
---|---|
1/* crypto/ec/ectest.c */ 2/* 3 * Originally written by Bodo Moeller for the OpenSSL project. 4 */ 5/* ==================================================================== 6 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 237 unchanged lines hidden (view full) --- 246 /* n2 = order^2 - 1 */ 247 BN_set_negative(n2, 0); 248 if (!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; 249 /* Add P to verify the result. */ 250 if (!EC_POINT_add(group, Q, Q, P, ctx)) ABORT; 251 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; 252 253 /* Exercise EC_POINTs_mul, including corner cases. */ | 1/* crypto/ec/ectest.c */ 2/* 3 * Originally written by Bodo Moeller for the OpenSSL project. 4 */ 5/* ==================================================================== 6 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 237 unchanged lines hidden (view full) --- 246 /* n2 = order^2 - 1 */ 247 BN_set_negative(n2, 0); 248 if (!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; 249 /* Add P to verify the result. */ 250 if (!EC_POINT_add(group, Q, Q, P, ctx)) ABORT; 251 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; 252 253 /* Exercise EC_POINTs_mul, including corner cases. */ |
254 if (EC_POINT_is_at_infinity(group, P)) ABORT; |
|
254 scalars[0] = n1; points[0] = Q; /* => infinity */ 255 scalars[1] = n2; points[1] = P; /* => -P */ 256 scalars[2] = n1; points[2] = Q; /* => infinity */ 257 scalars[3] = n2; points[3] = Q; /* => infinity */ 258 scalars[4] = n1; points[4] = P; /* => P */ 259 scalars[5] = n2; points[5] = Q; /* => infinity */ | 255 scalars[0] = n1; points[0] = Q; /* => infinity */ 256 scalars[1] = n2; points[1] = P; /* => -P */ 257 scalars[2] = n1; points[2] = Q; /* => infinity */ 258 scalars[3] = n2; points[3] = Q; /* => infinity */ 259 scalars[4] = n1; points[4] = P; /* => P */ 260 scalars[5] = n2; points[5] = Q; /* => infinity */ |
260 if (!EC_POINTs_mul(group, Q, NULL, 5, points, scalars, ctx)) ABORT; 261 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | 261 if (!EC_POINTs_mul(group, P, NULL, 6, points, scalars, ctx)) ABORT; 262 if (!EC_POINT_is_at_infinity(group, P)) ABORT; |
262 } 263 fprintf(stdout, "ok\n"); 264 265 EC_POINT_free(P); 266 EC_POINT_free(Q); 267 BN_free(n1); 268 BN_free(n2); 269 BN_free(order); --- 1255 unchanged lines hidden --- | 263 } 264 fprintf(stdout, "ok\n"); 265 266 EC_POINT_free(P); 267 EC_POINT_free(Q); 268 BN_free(n1); 269 BN_free(n2); 270 BN_free(order); --- 1255 unchanged lines hidden --- |