GithubHelp home page GithubHelp logo

commoncrypto's Introduction

CommonCrypto

Install

To install CommonCrypto library to be used as a swift module in Linux Ubuntu, do the following:

  1. Install required packages:

     $ sudo aptitude install gnustep
     $ sudo aptitude install gnustep-devel
     $ sudo aptitude install clang
    
  2. Edit .bashrc file

     ~$ vim .bashrc 
    

Then Add:

    export GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles

Then:

    ~$ source .bashrc
  1. Build CommonCrypto

     CommonCrypto$ make
    
  2. If you get the following error:

     fatal error: 'TargetConditionals.h' file not found
    

Then do the following:

    /$ sudo find . -name "TargetConditionals.h"

If not found then download swift toolchain from https://swift.org/download/ to Linux find the file from the toolchain

    $ sudo cp /path/to/TargetConditionals.h /usr/include
  1. Repeat step #3

  2. Copy the library to /usr/lib

     CommonCrypto$ sudo cp obj/libCommonCrypto* /usr/lib
    

A note from Niels Grewe

CommonCrypto is Apple's basic cryptography library. It's not per-se relevant for Objective-C code, but it is extensively used in Mac OS X and iOS applications. I speculate that having it around will make porting from Mac OS X to GNUstep easier for some people.

This version of CommonCrypto is derived from the Apple version 36064. It contains several modifications to make it compile and run under GNUstep. This mostly involved setting up a GNUmakefile and moving the Mach-O specific portions of the assembly code over to ELF directives. Presently, it requires clang and GNUstep-Make and has the following limitations:

  • For now, I have hardcoded some platform specific include paths, such as limits.h. You might need to modify them by hand.
  • Always uses the assembly versions of the crypto primitives for AES and SHA1. This means that it will only work on IA-32 and x86-64 platforms.

These problems will probably go away once I add a proper configure script.

CommonCrypto has been released by Apple under a APSL/BSD license. The port is maintained by Niels Grewe [email protected]. Please direct all criticisms, suggestions or bug reports to him.

A note from Amr Aboelela

  1. In this version I did the following in file AESAssembly.h:

     #if 0
     #define	UseAESedp_IntelAssembly
     #else
     #define	UseAESedp_GeneralC
     #endif
    

That will make the code run in C only and not in Assembly as the assembly code didn't run corretly with me in my Linux Ubuntu environment

  1. I have tried IBM BlueCryptor which uses OpenSSL in Linux and CommonCrypto in Mac OS, what I found when I ran my unit testing is that it took 5 seconds in Mac OS, while it would take about 26 seconds in a Linux VM. However, when I tried this version of CommonCrypto in Linux, it used to take roughly the same like in Mac OS.

commoncrypto's People

Contributors

amraboelela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

commoncrypto's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.