1198090Srdivacky/* 2198090Srdivacky * Copyright 2009-2021 The OpenSSL Project Authors. All Rights Reserved. 3353358Sdim * 4353358Sdim * Licensed under the Apache License 2.0 (the "License"). You may not use 5353358Sdim * this file except in compliance with the License. You can obtain a copy 6198090Srdivacky * in the file LICENSE in the source distribution or at 7198090Srdivacky * https://www.openssl.org/source/license.html 8198090Srdivacky */ 9198090Srdivacky 10198090Srdivacky#include "internal/cryptlib.h" 11198090Srdivacky#include "crypto/ppc_arch.h" 12218893Sdim#include "ec_local.h" 13198090Srdivacky 14198090Srdivackyvoid ecp_nistz256_mul_mont(unsigned long res[4], const unsigned long a[4], 15198090Srdivacky const unsigned long b[4]); 16198090Srdivacky 17198090Srdivackyvoid ecp_nistz256_to_mont(unsigned long res[4], const unsigned long in[4]); 18321369Sdimvoid ecp_nistz256_to_mont(unsigned long res[4], const unsigned long in[4]) 19321369Sdim{ 20321369Sdim static const unsigned long RR[] = { 0x0000000000000003U, 21321369Sdim 0xfffffffbffffffffU, 22321369Sdim 0xfffffffffffffffeU, 23321369Sdim 0x00000004fffffffdU }; 24321369Sdim 25321369Sdim ecp_nistz256_mul_mont(res, in, RR); 26321369Sdim} 27321369Sdim 28321369Sdimvoid ecp_nistz256_from_mont(unsigned long res[4], const unsigned long in[4]); 29321369Sdimvoid ecp_nistz256_from_mont(unsigned long res[4], const unsigned long in[4]) 30321369Sdim{ 31321369Sdim static const unsigned long one[] = { 1, 0, 0, 0 }; 32321369Sdim 33321369Sdim ecp_nistz256_mul_mont(res, in, one); 34321369Sdim} 35321369Sdim