Commit Graph

17 Commits

Author SHA1 Message Date
Chih-Hung Hsieh 1cd02d3443 Enable clang compilation.
Previous clang/llvm bug was fixed.

BUG: 18790528
Change-Id: Ib12696030d34ebc3c3ef1bca3cad0139d631417e
2015-05-14 10:53:48 -07:00
Chih-Hung Hsieh c83d3a3b65 Disable clang optimization that has segmentation fault.
When compiling for aosp_fugu-userdebug, clang aborted in pass:

  Running pass 'Function Pass Manager' on module 'system/core/libmincrypt/p256_ec.c'.
  Running pass 'X86 DAG->DAG Instruction Selection' on function '@felem_square'

BUG: 18790528
Change-Id: I416c07cae4c1a9743655bc45bd33c10a5cc9b41f
2014-12-17 14:59:53 -08:00
Bernhard Rosenkraenzer 7fb0844174 Remove declaration of unused static variable
The declaration is useless and triggers a warning with clang 3.5 (in
code that's built with -Werror)

Change-Id: I8fc42178df264509dcce6e1f1ba318bf849307e3
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2014-05-12 17:47:39 +02:00
Mark Salyzyn f03f8485e7 libmincrypt: suppress warning messages
- deal with implict declaration issue
- deal with some -Wunused issues

Change-Id: I253f1412a696c4811ade70a931fb1c01b31c62a5
2014-05-07 16:56:21 -07:00
Kenny Root db0850c3b6 Add support for ECDSA P-256 with SHA256
This adds a small EC library that is capable of verifying a signature of
SHA256 with ECDSA on the NIST P-256 curve.

Change-Id: I2a16639c92a77e8e4783c47ffbc56676de56eb59
2013-10-09 17:04:50 -07:00
Doug Zongker 0a862dcd63 mincrypt: merge the two RSA verifiers
The e=3 and e=65537 implementations are nearly identical, refactor
them down into one.

(cherry picked from commit 8fdbf97652)

Change-Id: I9f858204d52a0ae880170d955bf8f29fed57ee94
2013-09-25 09:26:51 -07:00
Doug Zongker 8e5b63d045 mincrypt: support SHA-256 hash algorithm
- adds a library to compute the SHA-256 hash

- updates the RSA verifier to take an argument specifying either SHA-1
  or SHA-256

- updates DumpPublicKey to with new "key" version numbers for
  specifying SHA-256

- adds new argument to adb auth code to maintain existing behavior

(cherry picked from commit 515e1639ef)

Change-Id: Ib35643b3d864742e817ac6e725499b451e45afcf
2013-09-25 09:26:34 -07:00
Doug Zongker ede5cf6533 remove unneeded import
DumpPublicKey doesn't need a base64 encoder for anything; remove the
import to avoid deprecation warnings.

Change-Id: I7e01b9d77bb66bb99cb3357c886cc4e2e63de6ae
2012-09-20 15:55:20 -07:00
Doug Zongker 35d9ad5ae7 support e=65537 for libmincrypt, DumpPublicKey
The output produced by DumpPublicKey now has a version tag on each
line (ie, each key).  The existing keys are retroactively dubbed
"version 1", and we add a version 2 for 2048-bit e=65537 keys.

Change-Id: I204ec615c8f2346670220a1aeb99269e4abd5f81
2012-07-25 13:09:17 -07:00
Doug Zongker 5e12d739c6 make DumpPublicKeys write 32-bit values as unsigned
Write the 32-bit chunks of N and RR as unsigned, so we get:

  {64,0xc926ad21,{1795090719,2141396315,950055447,2581568430,4268923165,...

instead of:

  {64,0xc926ad21,{1795090719,2141396315,950055447,-1713398866,-26044131,...

Change-Id: I575224fd7f7c34e06a1b6ae976eaa0bef41d2942
2010-01-29 10:47:38 -08:00
Doug Zongker 90b06ac786 only use faster SHA-1 code on machines with good libc
Macs don't have byteswap.h or endian.h.  Change conditionals to only
use the faster SHA-1 code on little-endian machines with byteswap.h.
2009-08-21 11:08:25 -07:00
Doug Zongker a6de77de17 add optimized SHA1 algorithm
This optimized implementation of the SHA1 algorithm is about 28%
faster than the old one (on sapphire hardware) but assumes
little-endianness.  Add it, but continue using the old implementation
on big-endian hardware.
2009-08-17 15:38:31 -07:00
Dianne Hackborn 161b03c7ec Automated import from //branches/master/...@140824,140824 2009-03-24 18:36:50 -07:00
The Android Open Source Project dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project 8ac3a13816 auto import from //branches/cupcake/...@127101 2009-01-20 14:04:01 -08:00
The Android Open Source Project 4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00