Skip to content
Snippets Groups Projects
Select Git revision
  • 2e24e947de21d0c27db8b67bcf80911a3891ae2e
  • master default protected
  • streebog
  • gost28147
  • master-updates
  • ed448
  • shake256
  • curve448
  • ecc-sqrt
  • gosthash94cp
  • cmac64
  • block16-refactor
  • siv-mode
  • cmac-layout
  • delete-des-compat
  • delete-rsa_blind
  • aes-struct-layout
  • release-3.4-fixes
  • struct-layout
  • attribute-deprecated
  • rename-data-symbols
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
  • nettle_3.5rc1
  • nettle_3.4.1_release_20181204
  • nettle_3.4.1rc1
  • nettle_3.4_release_20171119
  • nettle_3.4rc2
  • nettle_3.4rc1
  • nettle_3.3_release_20161001
  • nettle_3.2_release_20160128
  • nettle_3.1.1_release_20150424
  • nettle_3.1_release_20150407
  • nettle_3.1rc3
  • nettle_3.1rc2
  • nettle_3.1rc1
  • nettle_3.0_release_20140607
  • nettle_2.7.1_release_20130528
  • nettle_2.7_release_20130424
  • nettle_2.6_release_20130116
  • nettle_2.5_release_20120707
41 results

aes-decrypt.c

Blame
  • Forked from Nettle / nettle
    Source project has a limited visibility.
    module.pmod 1.49 KiB
    #pike __REAL_VERSION__
    #pragma strict_types
    
    // This module is to allow the _system module to be called System.
    
    inherit _system;
    
    constant Timer = __builtin.Timer;
    constant Time  = __builtin.Time;
    #if constant(__builtin.TM)
    constant TM    = __builtin.TM;
    #endif
    //! Get the username of the user that started the process.
    //!
    //! @returns
    //!  the username of the user "associated" with the current process, or zero
    //!  if a method to find this information does not exist on the current system.
    //!
    //! @note
    //!  On NT systems, this returns the user the current thread is running as,
    //!  while on Unix-like systems this function returns the user that started
    //!  the process (rather than the effective user)..
    string get_user()
    {
    #if constant(_system.GetUserName)
      return GetUserName();
    #elseif constant(getuid)
      return [string]getpwuid(getuid())[0];
    #else
      return 0;
    #endif
    }
    
    //! Get the full path for the current user's home directory
    //!
    //! @returns
    //! the full path to the current user's home directory, or zero
    //! if the appropriate environment variables have not been set.
    //!
    //! @note
    //! This method uses the standard environment variables for
    //! various systems to determine the home directory.
    string get_home()
    {
      string home = [string]getenv("HOME");
      if(home) return home;
    
    #if __NT__
      string homedrive = [string]getenv("HOMEDRIVE");
      home = [string]getenv("HOMEPATH");
      if(homedrive)
        home = combine_path(homedrive + "\\", (home||"\\"));
      if(home) return home;
    #endif
    
      return 0;      
    }