Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ARM] bignum multiplication improvement #9

Closed
pjbakker opened this issue Nov 15, 2012 · 2 comments
Closed

[ARM] bignum multiplication improvement #9

pjbakker opened this issue Nov 15, 2012 · 2 comments
Labels
component-crypto Crypto primitives and low-level interfaces enhancement historical-reviewed Reviewed & agreed to keep legacy PR/issue

Comments

@pjbakker
Copy link
Contributor

MULADDC_CORE can be improved for ARM.

I am using PolarSSL's rsa.c for 2048-bit key with STM32F103 processor.
It takes 1.78 second to sign in current implementation.
With this change, it takes 1.72 second.

Please see attached patch.
https://gist.github.com/4079268

Tomstdenis:
ARMv4 TDMI and ARMv5 up support much more efficient multiplication. You may want to look into that. From a practical standpoint new devices are V5 or higher anyways so supporting V4 and below is kinda archaic.

We could help you speed up your math lib. We have an ARM A9 to profile on as well.

@clemensg
Copy link

Hi,

would be nice to leverage the NEON instructions like VMUL on Cortex-A8, Cortex A-9 and upwards.
I discovered the following paper: Fast Software Polynomial Multiplication on ARM Processors Using the NEON Engine
Luckily, the preprint is freely available on the authors site: Link to PDF
(Source code: http://conradoplg.cryptoland.net/software/ecc-and-ae-for-arm-neon/)

What do you think about this approach of using the Karatsuba algorithm and implementing it with NEON instructions?

@mpg
Copy link
Contributor

mpg commented Sep 14, 2015

Looks nice, thanks for the links! We'll study that and hopefully integrate something along these lines in a future version. Unfortunately I can't make any promises as to when.

gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Sep 5, 2017
Integrate test suite build with greentea/htrun automated test execution
@RonEld RonEld added the component-crypto Crypto primitives and low-level interfaces label Feb 17, 2019
naynajain referenced this issue in naynajain/mbedtls-1 Jan 6, 2021
PKCS7 Signed Data Verification Pass SHA256 #9 ..................... FAILED
           buflen == datalen
           at line 225, C:/builds/workspace/mbed-tls-pr-head_PR-3431-head/worktrees/tmp6he90804/tests/suites/test_suite_pkcs7.function
         PKCS7 Signed Data Verification Pass SHA256 #9.1 ................... FAILED
           buflen == datalen
           at line 279, C:/builds/workspace/mbed-tls-pr-head_PR-3431-head/worktrees/tmp6he90804/tests/suites/test_suite_pkcs7.function

Seems fread() returns differently on Windows vs Linux.

Reading it in binary mode might fix the problem.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
naynajain referenced this issue in naynajain/mbedtls-1 Jan 6, 2021
PKCS7 Signed Data Verification Pass SHA256 #9 ..................... FAILED
           buflen == datalen
           at line 225, C:/builds/workspace/mbed-tls-pr-head_PR-3431-head/worktrees/tmp6he90804/tests/suites/test_suite_pkcs7.function
         PKCS7 Signed Data Verification Pass SHA256 #9.1 ................... FAILED
           buflen == datalen
           at line 279, C:/builds/workspace/mbed-tls-pr-head_PR-3431-head/worktrees/tmp6he90804/tests/suites/test_suite_pkcs7.function

Seems fread() returns differently on Windows vs Linux.

Reading it in binary mode might fix the problem.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
@tom-daubney-arm tom-daubney-arm added historical-reviewing Currently reviewing (for legacy PR/issues) historical-reviewed Reviewed & agreed to keep legacy PR/issue and removed historical-reviewing Currently reviewing (for legacy PR/issues) labels Oct 20, 2022
beni-sandu added a commit to beni-sandu/mbedtls that referenced this issue Aug 11, 2023
RFC2315, section 9.2:
authenticatedAttributes
       [0] IMPLICIT Attributes OPTIONAL

If authenticated attributes are present, it must contain at minimum two attributes:
	- A PKCS Mbed-TLS#9 content-type attribute having as its value the content type of the
	 ContentInfo value being signed.
	- A PKCS Mbed-TLS#9 message-digest attribute, having as its value the message digest
	of the content.

Section 9.3:
When they are present, the result of the message digesting process is the digest
of the complete DER encoding of the section, and the expected leading tag is
SET OF and not the IMPLICIT [0] tag.

Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-crypto Crypto primitives and low-level interfaces enhancement historical-reviewed Reviewed & agreed to keep legacy PR/issue
Projects
None yet
Development

No branches or pull requests

5 participants