Skip to content
New issue

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

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

Already on GitHub? # to your account

SP math: Functions declared but not exported #4179

Closed
guidovranken opened this issue Jul 2, 2021 · 7 comments · Fixed by #5868
Closed

SP math: Functions declared but not exported #4179

guidovranken opened this issue Jul 2, 2021 · 7 comments · Fixed by #5868
Assignees

Comments

@guidovranken
Copy link
Contributor

When I compile wolfCrypt with SP math using these commands: https://github.com/guidovranken/cryptofuzz/blob/master/docs/wolfcrypt.md#sp-math

The following program compiles but fails to link:

#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/ecc.h>

int main(void)
{
    printf("%p, %p\n", ecc_projective_add_point_safe, ecc_map);
    return 0;
}
p.c:6: undefined reference to `ecc_projective_add_point_safe'
p.c:6: undefined reference to `ecc_map'

This suggests that these functions are declared in the header files but not compiled into the library.

@dgarske
Copy link
Contributor

dgarske commented Jul 2, 2021

@guidovranken , if you build with WOLFSSL_PUBLIC_ECC_ADD_DBL defined the ecc_map is made public. I think we should also change ecc_projective_add_point_safe to ECC_API. @JacobBarthelmeh perhaps the release PR put up for the release can add this?

@dgarske
Copy link
Contributor

dgarske commented Dec 8, 2022

@guidovranken going back through old issues. I fixed this in PR #5868
Hopefully you can add some more ECC math tests.
Thanks, David Garske, wolfSSL

@guidovranken
Copy link
Contributor Author

Thanks but I was already testing these functions by compiling with WOLFSSL_PUBLIC_ECC_ADD_DBL.

Off-topic but I'm currently fuzzing these different bignum configurations: https://github.com/guidovranken/cryptofuzz/blob/master/docs/wolfcrypt.md

Anything I should add?

@SparkiDev
Copy link
Contributor

Hi Guido,

I can't see a configuration with --enable-sp-asm.
Could you add a configuration that has --enable-sp --enable-sp-asm --enable-sp-math?

Thanks,
Sean

@SparkiDev SparkiDev reopened this Dec 8, 2022
@dgarske
Copy link
Contributor

dgarske commented Dec 12, 2022

Hi Guido,

I can't see a configuration with --enable-sp-asm. Could you add a configuration that has --enable-sp --enable-sp-asm --enable-sp-math?

Thanks, Sean

@guidovranken , making sure you saw this feedback from Sean? We'd like SP math with assembly also tested. Thanks

@dgarske dgarske closed this as completed Dec 12, 2022
@guidovranken
Copy link
Contributor Author

@dgarske @SparkiDev is there any difference between adding --enable-sp-asm and not? It seems that wolfcrypt/src/sp_x86_64_asm.S is compiled in both cases.

@dgarske
Copy link
Contributor

dgarske commented Dec 12, 2022

@dgarske @SparkiDev is there any difference between adding --enable-sp-asm and not? It seems that wolfcrypt/src/sp_x86_64_asm.S is compiled in both cases.

I depends on the platform. If you are building on Intel host (x86_64, aarch64 and amd64) it does enable SP math assembly WOLFSSL_SP_X86_64_ASM by default. Perhaps it might be worth specifically testing with --disable-sp-asm, so sp_c64.c is used? Are there any other architectures you can support?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants