Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7189599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:20:11+00:00 2026-05-28T19:20:11+00:00

I have a security library in C and try to import that into my

  • 0

I have a security library in C and try to import that into my Android project using NDK. The library depends on three other libraries: pbc, gmp, and openssl. I’ve built the first two libraries as static libraries and the last one as shared libraries.

I timed the encrypt() and decrypt() functions in my library.

On my laptop, it is:

  • encrypt() 30ms
  • decrypt() 160ms

On my Android device(Droid 2.2.3), it is:

  • encrypt() 190ms
  • decrypt() 1300ms

The time is only for calling those two functions from the C library. The JNI overhead is very small.

Is this expected?

Update:

Both encrypt() and decrypt() do not have any IO operation, mainly float point operation. And I compiled the code for armeabi-v7a.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:20:12+00:00Added an answer on May 28, 2026 at 7:20 pm

    First of all I would say that you are lucky – your port works only 8 times slower than laptop version. It is quite a good result for ARM-based platforms.

    There are several reasons to be slower on ARM:

    • ARM processors simply have less computational power than Intel/AMD desktop CPUs
    • Slower memory and lower bandwidth
    • Different architectural restrictions (for example floating point unit is separated from integer CPU core in ARM)

    You can try the following things to improve the performance of you code:

    • If your phone has modern FPU then you can try to recompile all the libraries with additional compiler flag -mfpu=vfpv3 (or -mfpu=neon). It can slightly improve the speed of floating-point calculations because of doubled number of FPU registers.
    • Try to build your code with newer compiler. Latest Crystax NDK which is modified version of Google NDK includes gcc 4.6 toolchain. Sometimes newer compiler can produce more effective code.
    • Profile your code and optimize bottlenecks. You can use a number of arm specific optimization tricks (here is a bit outdated but good guide) or vertorize code with NEON SIMD.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a security consultant demanding that we implement encrypted connections to mySQL. He
Is there a way to see users that have certain security role assigned? I'm
I am using the AES methods here: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx I want to have a string
I have created a jar file to load a native library ( using System.loadlibrary()
Do Pagemethods and Json have security risks?(I dont use cookies).Forexample i have a pagemethod
I have some security related service running on my machine (start type = automatic)
I have a security number generator device, small enough to go on a key-ring,
Is it possible to have transport security without authentication? I'm well aware of it's
As many of you probably know, online banks nowadays have a security system whereby
We have a high security application and we want to allow users to enter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.