What does "__fips_constseg" means in openssl -


in openssl c code, (aes_core.c, set_key.c, spr.h , on) there "__fips_constseg".

i don't know "__fips_constseg" means.

what's role of it? assembly code?

the source code below:


#include < openssl/crypto.h >

#include "des_locl.h"

openssl_implement_global(int,des_check_key,0) /* defaults false */

__fips_constseg

static const unsigned char odd_parity[256]={};


from openssl source code:

crypto/crypto.h

#if defined(openssl_fipscanister) # include <openssl/fipssyms.h> #else # define __fips_constseg #endif 

fips/fipssyms.h

#if defined(_msc_ver) # pragma const_seg("fipsro$b") # pragma const_seg() # define __fips_constseg __declspec(allocate("fipsro$b")) #else # define __fips_constseg #endif 

the __fips_constseg constant defined value, if

  • openssl_fipscanister defined and
  • the code compiled using microsoft c compiler (which can detected defined _msc_ver constant).

then, code marked constant placed in constant data segment named fipsro$b (see msdn documentation on allocate specifier details).

if of conditions above not met, __fips_constseg defined nothing , variables marked constant put in data segment located in.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -