ecp_mont.c (246772) | ecp_mont.c (273144) |
---|---|
1/* crypto/ec/ecp_mont.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 --- 58 unchanged lines hidden (view full) --- 67#include <openssl/fips.h> 68#endif 69 70#include "ec_lcl.h" 71 72 73const EC_METHOD *EC_GFp_mont_method(void) 74 { | 1/* crypto/ec/ecp_mont.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 --- 58 unchanged lines hidden (view full) --- 67#include <openssl/fips.h> 68#endif 69 70#include "ec_lcl.h" 71 72 73const EC_METHOD *EC_GFp_mont_method(void) 74 { |
75#ifdef OPENSSL_FIPS 76 return fips_ec_gfp_mont_method(); 77#else | |
78 static const EC_METHOD ret = { 79 EC_FLAGS_DEFAULT_OCT, 80 NID_X9_62_prime_field, 81 ec_GFp_mont_group_init, 82 ec_GFp_mont_group_finish, 83 ec_GFp_mont_group_clear_finish, 84 ec_GFp_mont_group_copy, 85 ec_GFp_mont_group_set_curve, --- 23 unchanged lines hidden (view full) --- 109 0 /* have_precompute_mult */, 110 ec_GFp_mont_field_mul, 111 ec_GFp_mont_field_sqr, 112 0 /* field_div */, 113 ec_GFp_mont_field_encode, 114 ec_GFp_mont_field_decode, 115 ec_GFp_mont_field_set_to_one }; 116 | 75 static const EC_METHOD ret = { 76 EC_FLAGS_DEFAULT_OCT, 77 NID_X9_62_prime_field, 78 ec_GFp_mont_group_init, 79 ec_GFp_mont_group_finish, 80 ec_GFp_mont_group_clear_finish, 81 ec_GFp_mont_group_copy, 82 ec_GFp_mont_group_set_curve, --- 23 unchanged lines hidden (view full) --- 106 0 /* have_precompute_mult */, 107 ec_GFp_mont_field_mul, 108 ec_GFp_mont_field_sqr, 109 0 /* field_div */, 110 ec_GFp_mont_field_encode, 111 ec_GFp_mont_field_decode, 112 ec_GFp_mont_field_set_to_one }; 113 |
117 return &ret; | 114#ifdef OPENSSL_FIPS 115 if (FIPS_mode()) 116 return fips_ec_gfp_mont_method(); |
118#endif | 117#endif |
118 119 return &ret; |
|
119 } 120 121 122int ec_GFp_mont_group_init(EC_GROUP *group) 123 { 124 int ok; 125 126 ok = ec_GFp_simple_group_init(group); --- 196 unchanged lines hidden --- | 120 } 121 122 123int ec_GFp_mont_group_init(EC_GROUP *group) 124 { 125 int ok; 126 127 ok = ec_GFp_simple_group_init(group); --- 196 unchanged lines hidden --- |