Blame SOURCES/libsodium-1.0.18/test/default/scalarmult7.c

ca16be
ca16be
#define TEST_NAME "scalarmult7"
ca16be
#include "cmptest.h"
ca16be
ca16be
static unsigned char p1[32] = {
ca16be
    0x72, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d,
ca16be
    0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38,
ca16be
    0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0xea
ca16be
};
ca16be
ca16be
static unsigned char p2[32] = {
ca16be
    0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d,
ca16be
    0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38,
ca16be
    0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a
ca16be
};
ca16be
ca16be
static unsigned char scalar[32];
ca16be
static unsigned char out1[32];
ca16be
static unsigned char out2[32];
ca16be
ca16be
int
ca16be
main(void)
ca16be
{
ca16be
    int ret;
ca16be
ca16be
    scalar[0] = 1U;
ca16be
    ret       = crypto_scalarmult_curve25519(out1, scalar, p1);
ca16be
    assert(ret == 0);
ca16be
    ret = crypto_scalarmult_curve25519(out2, scalar, p2);
ca16be
    assert(ret == 0);
ca16be
    printf("%d\n", !!memcmp(out1, out2, 32));
ca16be
ca16be
    return 0;
ca16be
}