mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-07 19:00:50 +02:00
Fixes for spelling errors.
This commit is contained in:
+3
-3
@@ -316,7 +316,7 @@ Release 4.8.0 of wolfSSL embedded TLS has bug fixes and new features including:
|
||||
* Added wolfSSL_CTX_get_TicketEncCtx getter function to return the ticket encryption ctx value
|
||||
* Added wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex APIs to accept an Aes object to use for the AES operations
|
||||
* Added implementation of AES-GCM streaming (--enable-aesgcm-stream)
|
||||
* Added deterministic generation of k with ECC following RFC6979 when the macro WOLFSL_ECDSA_DETERMINISTIC_K is defined and wc_ecc_set_deterministic function is called
|
||||
* Added deterministic generation of k with ECC following RFC6979 when the macro WOLFSSL_ECDSA_DETERMINISTIC_K is defined and wc_ecc_set_deterministic function is called
|
||||
* Implemented wc_DsaParamsDecode and wc_DsaKeyToParamsDer
|
||||
* Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
|
||||
* Added crypto callback support for Ed/Curve25519 and SHA2-512/384
|
||||
@@ -2112,9 +2112,9 @@ More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html
|
||||
|
||||
- No filesystem build fixes for various configurations
|
||||
- Certificate generation now supports several extensions including KeyUsage,
|
||||
SKID, AKID, and Ceritifcate Policies
|
||||
SKID, AKID, and Certificate Policies
|
||||
- CRLs can be loaded from buffers as well as files now
|
||||
- SHA-512 Ceritifcate Signing generation
|
||||
- SHA-512 Certificate Signing generation
|
||||
- Fixes for sniffer reassembly processing
|
||||
|
||||
See INSTALL file for build instructions.
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
recommend using the CMake GUI in concert with Visual Studio, as described
|
||||
in these steps.
|
||||
2) Open CMake.
|
||||
3) Where is the soure code: <root directory of wolfssl containing
|
||||
3) Where is the source code: <root directory of wolfssl containing
|
||||
CMakeLists.txt>
|
||||
4) Where to build the binaries: <build directory, e.g. wolfssl/build>
|
||||
5) Hit Configure. CMake runs the code in CMakeLists.txt and builds up an
|
||||
|
||||
+5
-5
@@ -329,7 +329,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
* key-log-callback to pass the string for TLS1.3.
|
||||
* The user's key-logging callback has been set via
|
||||
* wolfSSL_CTX_set_keylog_callback function. The logging string format is:
|
||||
* "<Lable> <hex-encoded client random> <hex-encoded secret>"
|
||||
* "<Label> <hex-encoded client random> <hex-encoded secret>"
|
||||
*
|
||||
* parameter
|
||||
* - ssl: WOLFSSL object
|
||||
@@ -9644,7 +9644,7 @@ static int BuildFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
|
||||
|
||||
/* Does this cipher suite (first, second) have the requirement
|
||||
an ephemeral key exchange will still require the key for signing
|
||||
the key exchange so ECHDE_RSA requires an rsa key thus rsa_kea */
|
||||
the key exchange so ECDHE_RSA requires an rsa key thus rsa_kea */
|
||||
static int CipherRequires(byte first, byte second, int requirement)
|
||||
{
|
||||
|
||||
@@ -11533,7 +11533,7 @@ int LoadCertByIssuer(WOLFSSL_X509_STORE* store, X509_NAME* issuer, int type)
|
||||
return MEMORY_E;
|
||||
}
|
||||
|
||||
/* set as FAILURE, if successfuly loading cert of CRL, this becomes */
|
||||
/* set as FAILURE, if successfully loading cert of CRL, this becomes */
|
||||
/* WOLFSSL_SUCCESS */
|
||||
ret = WOLFSSL_FAILURE;
|
||||
|
||||
@@ -13646,7 +13646,7 @@ static int SanityCheckMsgReceived(WOLFSSL* ssl, byte type)
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
case certificate_status:
|
||||
if (ssl->msgsReceived.got_certificate_status) {
|
||||
WOLFSSL_MSG("Duplicate CertificateSatatus received");
|
||||
WOLFSSL_MSG("Duplicate CertificateStatus received");
|
||||
return DUPLICATE_MSG_E;
|
||||
}
|
||||
ssl->msgsReceived.got_certificate_status = 1;
|
||||
@@ -14344,7 +14344,7 @@ static int DoHandShakeMsg(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
#endif
|
||||
{
|
||||
/* for async this copy was already done, do not replace, since
|
||||
* conents may have been changed for inline operations */
|
||||
* contents may have been changed for inline operations */
|
||||
XMEMCPY(ssl->arrays->pendingMsg + ssl->arrays->pendingMsgOffset,
|
||||
input + *inOutIdx, inputLength);
|
||||
}
|
||||
|
||||
+1
-1
@@ -2228,7 +2228,7 @@ static int SetKeys(Ciphers* enc, Ciphers* dec, Keys* keys, CipherSpecs* specs,
|
||||
|
||||
|
||||
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && !defined(NO_CHAPOL_AEAD)
|
||||
/* Check that the max implicit iv size is suffecient */
|
||||
/* Check that the max implicit iv size is sufficient */
|
||||
#if (AEAD_MAX_IMP_SZ < 12) /* CHACHA20_IMP_IV_SZ */
|
||||
#error AEAD_MAX_IMP_SZ is too small for ChaCha20
|
||||
#endif
|
||||
|
||||
@@ -9860,7 +9860,7 @@ WOLFSSL_X509_EXTENSION* wolfSSL_X509_set_ext(WOLFSSL_X509* x509, int loc)
|
||||
* @param buf Output buffer. If this contains a pointer then it is free'd
|
||||
* with the DYNAMIC_TYPE_X509_EXT hint.
|
||||
* @param len Output length
|
||||
* @return WOLFSSL_SUCCESS on sucess and WOLFSSL_FAILURE on error
|
||||
* @return WOLFSSL_SUCCESS on success and WOLFSSL_FAILURE on error
|
||||
*/
|
||||
static int asn1_string_copy_to_buffer(WOLFSSL_ASN1_STRING* str, byte** buf,
|
||||
word32* len, void* heap) {
|
||||
@@ -12751,7 +12751,7 @@ static WC_INLINE int RestoreCertRow(WOLFSSL_CERT_MANAGER* cm, byte* current,
|
||||
XMEMCPY(&signer->keyOID, current + idx, sizeof(signer->keyOID));
|
||||
idx += (int)sizeof(signer->keyOID);
|
||||
|
||||
/* pulicKey */
|
||||
/* publicKey */
|
||||
if (start + minSz + signer->pubKeySize > end) {
|
||||
WOLFSSL_MSG("Would overread restore buffer");
|
||||
FreeSigner(signer, cm->heap);
|
||||
@@ -13124,7 +13124,7 @@ static int wolfSSL_remove_ciphers(char* list, int sz, const char* toRemove)
|
||||
* @param onlytlsv13suites flag whether correcting w/ TLS13 suites
|
||||
* or w/o TLS13 suties
|
||||
* @param list suites list that user wants to update
|
||||
* @return suites list on successs, otherwise NULL
|
||||
* @return suites list on success, otherwise NULL
|
||||
*/
|
||||
static char* buildEnabledCipherList(WOLFSSL_CTX* ctx, Suites* suites,
|
||||
int tls13Only, const char* list)
|
||||
@@ -13284,7 +13284,7 @@ static int CheckcipherList(const char* list)
|
||||
} while (next++); /* ++ needed to skip ':' */
|
||||
|
||||
if (findTLSv13Suites == 0 && findbeforeSuites == 1) {
|
||||
return 1;/* only before TLSv13 sutes */
|
||||
return 1;/* only before TLSv13 suites */
|
||||
}
|
||||
else if (findTLSv13Suites == 1 && findbeforeSuites == 0) {
|
||||
return 2;/* only TLSv13 suties */
|
||||
@@ -13382,7 +13382,7 @@ static int wolfSSL_parse_cipher_list(WOLFSSL_CTX* ctx, Suites* suites,
|
||||
}
|
||||
else if (listattribute == 2) {
|
||||
/* list has only TLSv13 suites. Only update TLv13 suites
|
||||
* simulate set_ciphersuites() comatibility layer API
|
||||
* simulate set_ciphersuites() compatibility layer API
|
||||
*/
|
||||
tls13Only = 0;
|
||||
}
|
||||
@@ -13506,7 +13506,7 @@ int wolfSSL_export_keying_material(WOLFSSL *ssl,
|
||||
if (ssl->options.saveArrays == 0 || ssl->arrays == NULL) {
|
||||
WOLFSSL_MSG("To export keying material wolfSSL needs to keep handshake "
|
||||
"data. Call wolfSSL_KeepArrays before attempting to "
|
||||
"export keyig material.");
|
||||
"export keyid material.");
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
|
||||
@@ -44132,7 +44132,7 @@ err:
|
||||
* @param x509 Output
|
||||
* @param crl Output
|
||||
* @param x_pkey Output
|
||||
* @return WOLFSSL_SUCCESSS on success and WOLFSSL_FAILURE otherwise
|
||||
* @return WOLFSSL_SUCCESS on success and WOLFSSL_FAILURE otherwise
|
||||
*/
|
||||
static int wolfSSL_PEM_X509_X509_CRL_X509_PKEY_read_bio(
|
||||
WOLFSSL_BIO* bio, wc_pem_password_cb* cb, WOLFSSL_X509** x509,
|
||||
|
||||
@@ -1088,7 +1088,7 @@ static int Hmac_UpdateFinal(Hmac* hmac, byte* digest, const byte* in,
|
||||
macSz = BLAKE2B_256;
|
||||
padSz = 0;
|
||||
break;
|
||||
#endif /* HAVE_BLAK2 */
|
||||
#endif /* HAVE_BLAKE2 */
|
||||
|
||||
default:
|
||||
return BAD_FUNC_ARG;
|
||||
@@ -6815,7 +6815,7 @@ static int TLSX_KeyShare_GenOqsKey(WOLFSSL *ssl, KeyShareEntry* kse)
|
||||
static int TLSX_KeyShare_GenKey(WOLFSSL *ssl, KeyShareEntry *kse)
|
||||
{
|
||||
int ret;
|
||||
/* Named FFHE groups have a bit set to identify them. */
|
||||
/* Named FFDHE groups have a bit set to identify them. */
|
||||
if (kse->group >= MIN_FFHDE_GROUP && kse->group <= MAX_FFHDE_GROUP)
|
||||
ret = TLSX_KeyShare_GenDhKey(ssl, kse);
|
||||
else if (kse->group == WOLFSSL_ECC_X25519)
|
||||
@@ -11812,7 +11812,7 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
|
||||
#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_EITHER_SIDE)
|
||||
#ifndef NO_OLD_TLS
|
||||
#ifdef WOLFSSL_ALLOW_TLSV10
|
||||
/* Gets a WOLFSL_METHOD type that is not set as client or server
|
||||
/* Gets a WOLFSSL_METHOD type that is not set as client or server
|
||||
*
|
||||
* Returns a pointer to a WOLFSSL_METHOD struct
|
||||
*/
|
||||
@@ -11837,7 +11837,7 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
|
||||
}
|
||||
#endif /* WOLFSSL_ALLOW_TLSV10 */
|
||||
|
||||
/* Gets a WOLFSL_METHOD type that is not set as client or server
|
||||
/* Gets a WOLFSSL_METHOD type that is not set as client or server
|
||||
*
|
||||
* Returns a pointer to a WOLFSSL_METHOD struct
|
||||
*/
|
||||
@@ -11862,7 +11862,7 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
|
||||
#endif /* !NO_OLD_TLS */
|
||||
|
||||
#ifndef WOLFSSL_NO_TLS12
|
||||
/* Gets a WOLFSL_METHOD type that is not set as client or server
|
||||
/* Gets a WOLFSSL_METHOD type that is not set as client or server
|
||||
*
|
||||
* Returns a pointer to a WOLFSSL_METHOD struct
|
||||
*/
|
||||
@@ -11887,7 +11887,7 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
|
||||
#endif /* !WOLFSSL_NO_TLS12 */
|
||||
|
||||
#ifdef WOLFSSL_TLS13
|
||||
/* Gets a WOLFSL_METHOD type that is not set as client or server
|
||||
/* Gets a WOLFSSL_METHOD type that is not set as client or server
|
||||
*
|
||||
* Returns a pointer to a WOLFSSL_METHOD struct
|
||||
*/
|
||||
|
||||
+4
-4
@@ -1090,7 +1090,7 @@ static const byte writeIVLabel[WRITE_IV_LABEL_SZ+1] = "iv";
|
||||
/* Derive the keys and IVs for TLS v1.3.
|
||||
*
|
||||
* ssl The SSL/TLS object.
|
||||
* sercret early_data_key when deriving the key and IV for encrypting early
|
||||
* secret early_data_key when deriving the key and IV for encrypting early
|
||||
* data application data and end_of_early_data messages.
|
||||
* handshake_key when deriving keys and IVs for encrypting handshake
|
||||
* messages.
|
||||
@@ -2669,7 +2669,7 @@ static byte helloRetryRequestRandom[] = {
|
||||
/**
|
||||
* convert mac algorithm to WOLFSSL_EVP_MD
|
||||
* @param mac_alg mac algorithm
|
||||
* @return const WOLFSSL_EVP_MD on sucessful, otherwise NULL
|
||||
* @return const WOLFSSL_EVP_MD on successful, otherwise NULL
|
||||
*/
|
||||
static const WOLFSSL_EVP_MD* ssl_handshake_md(const byte mac_alg)
|
||||
{
|
||||
@@ -4303,7 +4303,7 @@ static int CheckCookie(WOLFSSL* ssl, byte* cookie, byte cookieSz)
|
||||
|
||||
/* Length of the KeyShare Extension */
|
||||
#define HRR_KEY_SHARE_SZ (OPAQUE16_LEN + OPAQUE16_LEN + OPAQUE16_LEN)
|
||||
/* Length of the Supported Vresions Extension */
|
||||
/* Length of the Supported Versions Extension */
|
||||
#define HRR_VERSIONS_SZ (OPAQUE16_LEN + OPAQUE16_LEN + OPAQUE16_LEN)
|
||||
/* Length of the Cookie Extension excluding cookie data */
|
||||
#define HRR_COOKIE_HDR_SZ (OPAQUE16_LEN + OPAQUE16_LEN + OPAQUE16_LEN)
|
||||
@@ -7858,7 +7858,7 @@ static int SanityCheckTls13MsgReceived(WOLFSSL* ssl, byte type)
|
||||
SERVER_ENCRYPTED_EXTENSIONS_COMPLETE &&
|
||||
ssl->arrays != NULL &&
|
||||
ssl->arrays->psk_keySz != 0) {
|
||||
WOLFSSL_MSG("CertificateRequset received while using PSK");
|
||||
WOLFSSL_MSG("CertificateRequest received while using PSK");
|
||||
return SANITY_MSG_E;
|
||||
}
|
||||
#endif
|
||||
|
||||
+23
-23
@@ -991,7 +991,7 @@ static int GetOID(const byte* input, word32* inOutIdx, word32* oid,
|
||||
* @param [in] input BER encoded data.
|
||||
* @param [in] idx Index of BIT_STRING data.
|
||||
* @param [in] length Length of input data.
|
||||
* @param [in] positve Indicates number must be positive.
|
||||
* @param [in] positive Indicates number must be positive.
|
||||
* @return 0 on success.
|
||||
* @return ASN_PARSE_E when 0 is not required but seen.
|
||||
* @return ASN_EXPECT_0_E when 0 is required and not seen.
|
||||
@@ -1998,7 +1998,7 @@ static int GetASN_BitString_Int16Bit(ASNGetData* dataASN, word16* val)
|
||||
}
|
||||
#endif /* CRLDP_VALIDATE_DATA */
|
||||
|
||||
#endif /* WOFLSSL_ASN_TEMPLATE */
|
||||
#endif /* WOLFSSL_ASN_TEMPLATE */
|
||||
|
||||
|
||||
/* Decode the BER/DER length field.
|
||||
@@ -2047,7 +2047,7 @@ int GetLength_ex(const byte* input, word32* inOutIdx, int* len, word32 maxIdx,
|
||||
/* Ensure zero return length on error. */
|
||||
*len = 0;
|
||||
|
||||
/* Check there is at least on byte avaialble containing length information.
|
||||
/* Check there is at least on byte available containing length information.
|
||||
*/
|
||||
if ((idx + 1) > maxIdx) {
|
||||
WOLFSSL_MSG("GetLength - bad index on input");
|
||||
@@ -7572,7 +7572,7 @@ int EncryptContent(byte* input, word32 inputSz, byte* out, word32* outSz,
|
||||
if ((ret == 0) && (saltSz > MAX_SALT_SIZE)) {
|
||||
ret = ASN_PARSE_E;
|
||||
}
|
||||
/* Get algorithm parameters for algorithm identifer. */
|
||||
/* Get algorithm parameters for algorithm identifier. */
|
||||
if ((ret == 0) && CheckAlgo(vPKCS, vAlgo, &id, &version, &blockSz) < 0) {
|
||||
ret = ASN_INPUT_E;
|
||||
}
|
||||
@@ -9854,7 +9854,7 @@ static int StoreEccKey(DecodedCert* cert, const byte* source, word32* srcIdx,
|
||||
}
|
||||
if (ret == 0) {
|
||||
#endif
|
||||
/* Store publc key data length. */
|
||||
/* Store public key data length. */
|
||||
cert->pubKeySize = pubKeyLen;
|
||||
/* Must allocated space for key.
|
||||
* Don't memcpy into constant pointer so use temp. */
|
||||
@@ -10270,9 +10270,9 @@ static int GetHashId(const byte* id, int length, byte* hash)
|
||||
#define ASN_UID 0x101
|
||||
/* Id for domain component. */
|
||||
#define ASN_DC 0x102
|
||||
/* Id for juristiction country. */
|
||||
/* Id for jurisdiction country. */
|
||||
#define ASN_JURIS_C 0x203
|
||||
/* Id for juristiction state. */
|
||||
/* Id for jurisdiction state. */
|
||||
#define ASN_JURIS_ST 0x203
|
||||
|
||||
/* Set the string for a name component into the subject name. */
|
||||
@@ -10682,7 +10682,7 @@ static int SetSubject(DecodedCert* cert, int id, byte* str, word32 strLen,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get a RelativeDistignuishedName from the encoding and put in certificate.
|
||||
/* Get a RelativeDistinguishedName from the encoding and put in certificate.
|
||||
*
|
||||
* @param [in, out] cert Certificate object.
|
||||
* @param [in, out] full Full name string. ([/<type>=<value>]*)
|
||||
@@ -10794,7 +10794,7 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
||||
}
|
||||
if (ret == 0) {
|
||||
/* Check there is space for this in the full name string and
|
||||
* terminating NUL characher. */
|
||||
* terminating NUL character. */
|
||||
if ((typeStrLen + strLen) < (word32)(ASN_NAME_MAX - *idx))
|
||||
{
|
||||
/* Add RDN to full string. */
|
||||
@@ -10818,9 +10818,9 @@ static int GetRDN(DecodedCert* cert, char* full, word32* idx, int* nid,
|
||||
* @param [in, out] cert Decoded certificate object.
|
||||
* @param [out] full Buffer to hold full name as a string.
|
||||
* @param [out] hash Buffer to hold hash of name.
|
||||
* @param [in] nameType IUSSUER or SUBJECT.
|
||||
* @param [in] nameType ISSUER or SUBJECT.
|
||||
* @param [in] input Buffer holding certificate name.
|
||||
* @param [in, out] inOutIdx On in, start of certifica namtey.
|
||||
* @param [in, out] inOutIdx On in, start of certificate name.
|
||||
* On out, start of ASN.1 item after cert name.
|
||||
* @param [in] maxIdx Index of next item after certificate name.
|
||||
* @return 0 on success.
|
||||
@@ -11406,7 +11406,7 @@ static int GetCertName(DecodedCert* cert, char* full, byte* hash, int nameType,
|
||||
#endif /* WOLFSSL_X509_NAME_AVAILABLE */
|
||||
|
||||
if (ret == 0) {
|
||||
/* Expecing a SEQUENCE using up all data. */
|
||||
/* Expecting a SEQUENCE using up all data. */
|
||||
ret = GetASN_Sequence(input, &srcIdx, &len, maxIdx, 1);
|
||||
}
|
||||
if (ret == 0) {
|
||||
@@ -12009,7 +12009,7 @@ int wc_GetTime(void* timePtr, word32 timeSize)
|
||||
|
||||
#ifdef WOLFSSL_ASN_TEMPLATE
|
||||
/* TODO: use a CHOICE instead of two items? */
|
||||
/* ASN.1 template for a date - either UTC or Generatlized Time. */
|
||||
/* ASN.1 template for a date - either UTC or Generalized Time. */
|
||||
static const ASNItem dateASN[] = {
|
||||
/* 0 */ { 0, ASN_UTC_TIME, 0, 0, 2 },
|
||||
/* 1 */ { 0, ASN_GENERALIZED_TIME, 0, 0, 2 },
|
||||
@@ -12231,7 +12231,7 @@ static int DecodeCertInternal(DecodedCert* cert, int verify, int* criticalExt,
|
||||
int stopAfterPubKey);
|
||||
#endif
|
||||
|
||||
/* Parse the ceritifcate up to the X.509 public key.
|
||||
/* Parse the certificate up to the X.509 public key.
|
||||
*
|
||||
* If cert data is invalid then badDate get set to error value.
|
||||
*
|
||||
@@ -12301,7 +12301,7 @@ int wc_GetPubX509(DecodedCert* cert, int verify, int* badDate)
|
||||
#endif /* WOLFSSL_ASN_TEMPLATE */
|
||||
}
|
||||
|
||||
/* Parse the ceritifcate up to and including X.509 public key.
|
||||
/* Parse the certificate up to and including X.509 public key.
|
||||
*
|
||||
* @param [in, out] cert Decoded certificate object.
|
||||
* @param [in] verify Whether to verify dates.
|
||||
@@ -14001,7 +14001,7 @@ static int DecodeGeneralName(const byte* input, word32* inOutIdx, byte tag,
|
||||
int strLen;
|
||||
word32 idxDir = idx;
|
||||
|
||||
/* Expecing a SEQUENCE using up all data. */
|
||||
/* Expecting a SEQUENCE using up all data. */
|
||||
if (GetASN_Sequence(input, &idxDir, &strLen, idx + len, 1) < 0) {
|
||||
WOLFSSL_MSG("\tfail: seq length");
|
||||
return ASN_PARSE_E;
|
||||
@@ -14115,7 +14115,7 @@ static const ASNItem altNameASN[] = {
|
||||
{ 0, ASN_CONTEXT_SPECIFIC | 0, 0, 1, 0 }
|
||||
};
|
||||
|
||||
/* Numbe of items in ASN.1 template for GeneralName. */
|
||||
/* Number of items in ASN.1 template for GeneralName. */
|
||||
#define altNameASN_Length (sizeof(altNameASN) / sizeof(ASNItem))
|
||||
#endif /* WOLFSSL_ASN_TEMPLATE */
|
||||
|
||||
@@ -14413,7 +14413,7 @@ static int DecodeAltNames(const byte* input, int sz, DecodedCert* cert)
|
||||
return ASN_PARSE_E;
|
||||
}
|
||||
|
||||
/* Certiciates issued with this OID in the subject alt name are for
|
||||
/* Certificates issued with this OID in the subject alt name are for
|
||||
* verifying signatures created on a module.
|
||||
* RFC 4108 Section 5. */
|
||||
if (cert->hwType != NULL) {
|
||||
@@ -14568,7 +14568,7 @@ static const ASNItem basicConsASN[] = {
|
||||
* @return ASN_PARSE_E when CA boolean is present and false (default is false).
|
||||
* @return ASN_PARSE_E when CA boolean is not present unless
|
||||
* WOLFSSL_X509_BASICCONS_INT is defined. Only a CA extension.
|
||||
* @return ASN_PARSE_E when path legth more than 7 bits.
|
||||
* @return ASN_PARSE_E when path length more than 7 bits.
|
||||
* @return ASN_PARSE_E when BER encoded data does not match ASN.1 items or
|
||||
* is invalid.
|
||||
* @return BUFFER_E when data in buffer is too small.
|
||||
@@ -14874,7 +14874,7 @@ static int DecodeCrlDist(const byte* input, int sz, DecodedCert* cert)
|
||||
if (ret == 0) {
|
||||
/* Get the GeneralName choice */
|
||||
GetASN_Choice(&dataASN[4], generalNameChoice);
|
||||
/* Parse CRL distribtion point. */
|
||||
/* Parse CRL distribution point. */
|
||||
ret = GetASN_Items(crlDistASN, dataASN, crlDistASN_Length, 0, input,
|
||||
&idx, sz);
|
||||
}
|
||||
@@ -15360,7 +15360,7 @@ static int DecodeExtKeyUsage(const byte* input, int sz, DecodedCert* cert)
|
||||
|
||||
if (ret == 0) {
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
/* Keep reference for WOFLSSL_X509. */
|
||||
/* Keep reference for WOLFSSL_X509. */
|
||||
cert->extExtKeyUsageSrc = input + idx;
|
||||
cert->extExtKeyUsageSz = length;
|
||||
#endif
|
||||
@@ -15407,7 +15407,7 @@ static int DecodeExtKeyUsage(const byte* input, int sz, DecodedCert* cert)
|
||||
}
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
/* Keep count for WOFLSSL_X509. */
|
||||
/* Keep count for WOLFSSL_X509. */
|
||||
cert->extExtKeyUsageCount++;
|
||||
#endif
|
||||
}
|
||||
@@ -16058,7 +16058,7 @@ exit:
|
||||
* CRL Distribution Points - CRL_DIST_OID
|
||||
* Authority Information Access - AUTH_INFO_OID
|
||||
* Subject Alternative Name - ALT_NAMES_OID
|
||||
* Authority Key Identifer - AUTH_KEY_OID
|
||||
* Authority Key Identifier - AUTH_KEY_OID
|
||||
* Subject Key Identifier - SUBJ_KEY_OID
|
||||
* Certificate Policies - CERT_POLICY_OID (conditional parsing)
|
||||
* Key Usage - KEY_USAGE_OID
|
||||
|
||||
@@ -472,7 +472,7 @@ int wc_MakeEccsiKey(EccsiKey* key, WC_RNG* rng)
|
||||
* Encode a point into a buffer.
|
||||
*
|
||||
* X and y ordinate of point concatenated. Each number is zero padded tosize.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] point ECC point to encode.
|
||||
* @param [in] size Size of prime in bytes - maximum ordinate length.
|
||||
@@ -810,7 +810,7 @@ int wc_ImportEccsiPrivateKey(EccsiKey* key, const byte* data, word32 sz)
|
||||
*
|
||||
* X and y ordinate of public key concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key ECCSI key.
|
||||
* @param [out] data Buffer to hold the encoded public key.
|
||||
@@ -1108,7 +1108,7 @@ int wc_DecodeEccsiSsk(const EccsiKey* key, const byte* data, word32 sz,
|
||||
*
|
||||
* X and y ordinate of public key concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key ECCSI key.
|
||||
* @param [in] pvt Public Validation Token (PVT) as an ECC point.
|
||||
@@ -1198,7 +1198,7 @@ int wc_DecodeEccsiPair(const EccsiKey* key, const byte* data, word32 sz,
|
||||
*
|
||||
* X and y ordinate of public key concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key ECCSI key.
|
||||
* @param [in] data Buffer holding PVT data.
|
||||
@@ -1234,7 +1234,7 @@ int wc_DecodeEccsiPvt(const EccsiKey* key, const byte* data, word32 sz,
|
||||
*
|
||||
* X and y ordinate of public key concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key ECCSI key.
|
||||
* @param [in] sig Buffer holding signature data.
|
||||
@@ -1271,7 +1271,7 @@ int wc_DecodeEccsiPvtFromSig(const EccsiKey* key, const byte* sig, word32 sz,
|
||||
*
|
||||
* X and y ordinate of public key concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key ECCSI key.
|
||||
* @param [in] data Encoded public key as an array of bytes.
|
||||
@@ -2079,7 +2079,7 @@ static int eccsi_calc_y(EccsiKey* key, ecc_point* pvt, mp_digit mp,
|
||||
|
||||
err = mp_read_unsigned_bin(hs, key->idHash, key->idHashSz);
|
||||
#ifndef WOLFSSL_HAVE_SP_ECC
|
||||
/* Need KPAK in montogmery form. */
|
||||
/* Need KPAK in montgomery form. */
|
||||
if (err == 0) {
|
||||
err = eccsi_kpak_to_mont(key);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void fe448_invert(word8* r, const word8* a)
|
||||
}
|
||||
|
||||
/* Scalar multiply the point by a number. r = n.a
|
||||
* Uses Montogmery ladder and only requires the x-ordinate.
|
||||
* Uses Montgomery ladder and only requires the x-ordinate.
|
||||
*
|
||||
* r [in] Field element to hold result.
|
||||
* n [in] Scalar as an array of bytes.
|
||||
@@ -1111,7 +1111,7 @@ void fe448_invert(sword64* r, const sword64* a)
|
||||
}
|
||||
|
||||
/* Scalar multiply the point by a number. r = n.a
|
||||
* Uses Montogmery ladder and only requires the x-ordinate.
|
||||
* Uses Montgomery ladder and only requires the x-ordinate.
|
||||
*
|
||||
* r [in] Field element to hold result.
|
||||
* n [in] Scalar as an array of bytes.
|
||||
@@ -2200,7 +2200,7 @@ void fe448_invert(sword32* r, const sword32* a)
|
||||
}
|
||||
|
||||
/* Scalar multiply the point by a number. r = n.a
|
||||
* Uses Montogmery ladder and only requires the x-ordinate.
|
||||
* Uses Montgomery ladder and only requires the x-ordinate.
|
||||
*
|
||||
* r [in] Field element to hold result.
|
||||
* n [in] Scalar as an array of bytes.
|
||||
|
||||
@@ -2808,7 +2808,7 @@ int wc_PKCS7_SetDetached(PKCS7* pkcs7, word16 flag)
|
||||
|
||||
/* By default, SignedData bundles have the following signed attributes attached:
|
||||
* contentType (1.2.840.113549.1.9.3)
|
||||
* signgingTime (1.2.840.113549.1.9.5)
|
||||
* signingTime (1.2.840.113549.1.9.5)
|
||||
* messageDigest (1.2.840.113549.1.9.4)
|
||||
*
|
||||
* Calling this API before wc_PKCS7_EncodeSignedData() will disable the
|
||||
@@ -4058,7 +4058,7 @@ static int wc_PKCS7_SetPublicKeyOID(PKCS7* pkcs7, int sigOID)
|
||||
** Sequence
|
||||
****** Object ID
|
||||
****** Set
|
||||
********** {PritnableString, UTCTime, OCTET STRING ...}
|
||||
********** {PrintableString, UTCTime, OCTET STRING ...}
|
||||
*
|
||||
* pkcs7 the PKCS7 structure to put the parsed attributes into
|
||||
* in buffer holding all attributes
|
||||
@@ -6220,7 +6220,7 @@ int wc_PKCS7_AddRecipient_KARI(PKCS7* pkcs7, const byte* cert, word32 certSz,
|
||||
kari->senderKeyExportSz, origPubKeySeq);
|
||||
totalSz += origPubKeySeqSz;
|
||||
|
||||
/* outer OriginatorIdentiferOrKey IMPLICIT [0] */
|
||||
/* outer OriginatorIdentifierOrKey IMPLICIT [0] */
|
||||
origIdOrKeySeqSz = SetImplicit(ASN_SEQUENCE, 0,
|
||||
origPubKeySeqSz + origAlgIdSz +
|
||||
origPubKeyStrSz + kari->senderKeyExportSz,
|
||||
@@ -8514,7 +8514,7 @@ static int wc_PKCS7_DecryptKtri(PKCS7* pkcs7, byte* in, word32 inSz,
|
||||
* issuerAndSerialNumber IssuerAndSerialNumber,
|
||||
* subjectKeyIdentifier [0] SubjectKeyIdentifier }
|
||||
*
|
||||
* The choice of subjectKeyIdentifer (where version was 2) is
|
||||
* The choice of subjectKeyIdentifier (where version was 2) is
|
||||
* context specific with tag number 0 within the class.
|
||||
*/
|
||||
|
||||
@@ -9045,7 +9045,7 @@ static int wc_PKCS7_KariGetRecipientEncryptedKeys(WC_PKCS7_KARI* kari,
|
||||
return ASN_PARSE_E;
|
||||
|
||||
/* KeyAgreeRecipientIdentifier is CHOICE of IssuerAndSerialNumber
|
||||
* or [0] IMMPLICIT RecipientKeyIdentifier */
|
||||
* or [0] IMPLICIT RecipientKeyIdentifier */
|
||||
localIdx = *idx;
|
||||
if (GetASNTag(pkiMsg, &localIdx, &tag, pkiMsgSz) < 0)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
@@ -391,7 +391,7 @@ static int sakke_mulmod_base_add(SakkeKey* key, const mp_int* n, ecc_point* a,
|
||||
mp_digit mp = 0;
|
||||
SakkeKeyParams* params = &key->params;
|
||||
|
||||
/* Scalar multiply base by n - leaves ordinates in Montogmert form. */
|
||||
/* Scalar multiply base by n - leaves ordinates in Montgomery form. */
|
||||
err = wc_ecc_mulmod(n, params->base, res, ¶ms->a, ¶ms->prime, 0);
|
||||
if (err == 0) {
|
||||
err = mp_montgomery_setup(¶ms->prime, &mp);
|
||||
@@ -791,7 +791,7 @@ static int sakke_z_from_mont(SakkeKey* key)
|
||||
* Encode a point into a buffer.
|
||||
*
|
||||
* X and y ordinate of point concatenated. Each number is zero padded tosize.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] point ECC point to encode.
|
||||
* @param [in] size Size of prime in bytes - maximum ordinate length.
|
||||
@@ -897,7 +897,7 @@ static int sakke_decode_point(ecc_point* point, word32 size, const byte* data,
|
||||
*
|
||||
* X and y ordinate of public key concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key SAKKE key.
|
||||
* @param [out] data Buffer to hold encoded data.
|
||||
@@ -994,7 +994,7 @@ int wc_MakeSakkeRsk(SakkeKey* key, const byte* id, word16 idSz, ecc_point* rsk)
|
||||
*
|
||||
* X and y ordinate of RSK point concatenated. Each number is zero padded to
|
||||
* key size.
|
||||
* Descriptor byte (0x04) is prepeneded when not raw.
|
||||
* Descriptor byte (0x04) is prepended when not raw.
|
||||
*
|
||||
* @param [in] key SAKKE key.
|
||||
* @param [in] rsk ECC point that is the Receiver Secret Key (RSK).
|
||||
@@ -1208,7 +1208,7 @@ static int sakke_point_to_mont(ecc_point* p, mp_int* prime, mp_int* mu, int set)
|
||||
int err = 0;
|
||||
|
||||
if (!set) {
|
||||
/* Calculate multiplier that converts to Montgmery form. */
|
||||
/* Calculate multiplier that converts to Montgomery form. */
|
||||
err = mp_montgomery_calc_normalization(mu, prime);
|
||||
}
|
||||
if (err == 0) {
|
||||
@@ -2252,7 +2252,7 @@ static int sakke_pairing(SakkeKey* key, ecc_point* p, ecc_point* q, mp_int* r,
|
||||
* @param [in] key SAKKE key.
|
||||
* @param [in] rsk Receiver Secret Key (RSK) as an ECC point.
|
||||
* @param [in] table Pre-computation table. May be NULL.
|
||||
* @param [in] len Size of pre-compuration table in bytes.
|
||||
* @param [in] len Size of pre-computation table in bytes.
|
||||
* @return 0 on success.
|
||||
* @return BAD_FUNC_ARG when key or rsk is NULL.
|
||||
* @return MEMORY_E when dynamic memory allocation fails.
|
||||
@@ -6314,7 +6314,7 @@ int wc_GetSakkePointI(SakkeKey* key, byte* data, word32* sz)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the elliptic curve point I - a partial calucation for point R - and the
|
||||
* Set the elliptic curve point I - a partial calculation for point R - and the
|
||||
* identity that it belongs to.
|
||||
*
|
||||
* RFC 6508, Section 6.2.1, Step 3.\n
|
||||
|
||||
+88
-88
@@ -3897,14 +3897,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
sp_2048_cond_sub_32(a - 32, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -3916,9 +3916,9 @@ static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -6006,14 +6006,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_64(sp_digit* a, const sp_digit* m,
|
||||
sp_2048_cond_sub_64(a - 64, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -6025,9 +6025,9 @@ static void sp_2048_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -14518,14 +14518,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_48(sp_digit* a, const sp_digit* m,
|
||||
sp_3072_cond_sub_48(a - 48, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -14537,9 +14537,9 @@ static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -17363,14 +17363,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_96(sp_digit* a, const sp_digit* m,
|
||||
sp_3072_cond_sub_96(a - 96, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_96(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -17382,9 +17382,9 @@ static void sp_3072_mont_mul_96(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_96(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -25362,14 +25362,14 @@ SP_NOINLINE static void sp_4096_mont_reduce_128(sp_digit* a, const sp_digit* m,
|
||||
sp_4096_cond_sub_128(a - 128, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_128(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -25381,9 +25381,9 @@ static void sp_4096_mont_mul_128(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_128(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -29704,12 +29704,12 @@ static const sp_digit p256_mod[8] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0x00000000,0x00000000,0x00000000,
|
||||
0x00000001,0xffffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[8] = {
|
||||
0x00000001,0x00000000,0x00000000,0xffffffff,0xffffffff,0xffffffff,
|
||||
0xfffffffe,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -29725,14 +29725,14 @@ static const sp_digit p256_order2[8] = {
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[8] = {
|
||||
0x039cdaaf,0x0c46353d,0x58e8617b,0x43190552,0x00000000,0x00000000,
|
||||
0xffffffff,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0xee00bc4f;
|
||||
#endif
|
||||
/* The base point of curve P256. */
|
||||
@@ -30896,7 +30896,7 @@ static sp_digit sp_256_sub_8(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -31323,14 +31323,14 @@ static int sp_256_point_to_ecc_point_8(const sp_point_256* p, ecc_point* pm)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_mul_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -31985,9 +31985,9 @@ SP_NOINLINE static void sp_256_mont_mul_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Square the Montgomery form number mod the modulus (prime). (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_sqr_8(sp_digit* r, const sp_digit* a, const sp_digit* m,
|
||||
sp_digit mp)
|
||||
@@ -32502,10 +32502,10 @@ SP_NOINLINE static void sp_256_mont_sqr_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_8(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -32979,8 +32979,8 @@ static void sp_256_map_8(sp_point_256* r, const sp_point_256* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_add_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -33050,7 +33050,7 @@ static void sp_256_mont_add_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_dbl_8(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -33103,7 +33103,7 @@ static void sp_256_mont_dbl_8(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_tpl_8(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -33200,8 +33200,8 @@ static void sp_256_mont_tpl_8(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_sub_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -35172,7 +35172,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -36721,7 +36721,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -39212,12 +39212,12 @@ static const sp_digit p384_mod[12] = {
|
||||
0xffffffff,0x00000000,0x00000000,0xffffffff,0xfffffffe,0xffffffff,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[12] = {
|
||||
0x00000001,0xffffffff,0xffffffff,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -39233,14 +39233,14 @@ static const sp_digit p384_order2[12] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[12] = {
|
||||
0x333ad68d,0x1313e695,0xb74f5885,0xa7e5f24d,0x0bc8d220,0x389cb27e,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0xe88fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
@@ -41329,7 +41329,7 @@ static sp_digit sp_384_sub_12(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -41873,14 +41873,14 @@ SP_NOINLINE static void sp_384_mont_reduce_12(sp_digit* a, const sp_digit* m,
|
||||
sp_384_cond_sub_12(a - 12, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_12(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -41892,9 +41892,9 @@ static void sp_384_mont_mul_12(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_12(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -41907,10 +41907,10 @@ static void sp_384_mont_sqr_12(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_12(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -42250,8 +42250,8 @@ static void sp_384_map_12(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_add_12(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -42266,7 +42266,7 @@ static void sp_384_mont_add_12(sp_digit* r, const sp_digit* a, const sp_digit* b
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_dbl_12(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -42280,7 +42280,7 @@ static void sp_384_mont_dbl_12(sp_digit* r, const sp_digit* a, const sp_digit* m
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_tpl_12(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -42402,8 +42402,8 @@ static sp_digit sp_384_cond_add_12(sp_digit* r, const sp_digit* a, const sp_digi
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_sub_12(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -44377,7 +44377,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -45926,7 +45926,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -52048,7 +52048,7 @@ static const sp_digit p1024_mod[32] = {
|
||||
0xb3e01a2e,0xbe9ae358,0x9cb48261,0x416c0ce1,0xdad0657a,0x65c61198,
|
||||
0x0a563fda,0x997abb1f
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[32] = {
|
||||
0x0157a015,0x99927f85,0x53853178,0x7f3a20ef,0x767a824f,0x031c17dc,
|
||||
0xa968e0e0,0x606b2950,0xe3c3f655,0x5830c3ad,0xce7ad57d,0x49500b57,
|
||||
@@ -52057,7 +52057,7 @@ static const sp_digit p1024_norm_mod[32] = {
|
||||
0x4c1fe5d1,0x41651ca7,0x634b7d9e,0xbe93f31e,0x252f9a85,0x9a39ee67,
|
||||
0xf5a9c025,0x668544e0
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x7c8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -53234,7 +53234,7 @@ static WC_INLINE int sp_1024_mod_32(sp_digit* r, const sp_digit* a, const sp_dig
|
||||
return sp_1024_div_32(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -53828,14 +53828,14 @@ SP_NOINLINE static void sp_1024_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
sp_1024_cond_sub_32(a - 32, a, m, ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -53847,9 +53847,9 @@ static void sp_1024_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -53968,8 +53968,8 @@ static void sp_1024_map_32(sp_point_1024* r, const sp_point_1024* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_add_32(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -54138,7 +54138,7 @@ static void sp_1024_mont_add_32(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_dbl_32(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -54290,7 +54290,7 @@ static void sp_1024_mont_dbl_32(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_tpl_32(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -54597,8 +54597,8 @@ static void sp_1024_mont_tpl_32(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_sub_32(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -60547,7 +60547,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
+92
-92
@@ -2637,14 +2637,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_16(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -2656,9 +2656,9 @@ static void sp_2048_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -3981,14 +3981,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -4000,9 +4000,9 @@ static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -10056,14 +10056,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_24(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_24(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -10075,9 +10075,9 @@ static void sp_3072_mont_mul_24(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_24(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -11768,14 +11768,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_48(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -11787,9 +11787,9 @@ static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -16740,14 +16740,14 @@ SP_NOINLINE static void sp_4096_mont_reduce_64(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -16759,9 +16759,9 @@ static void sp_4096_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -19430,12 +19430,12 @@ static const sp_digit p256_mod[4] = {
|
||||
0xffffffffffffffffL,0x00000000ffffffffL,0x0000000000000000L,
|
||||
0xffffffff00000001L
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[4] = {
|
||||
0x0000000000000001L,0xffffffff00000000L,0xffffffffffffffffL,
|
||||
0x00000000fffffffeL
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x0000000000000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -19451,14 +19451,14 @@ static const sp_digit p256_order2[4] = {
|
||||
0xffffffff00000000L
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[4] = {
|
||||
0x0c46353d039cdaafL,0x4319055258e8617bL,0x0000000000000000L,
|
||||
0x00000000ffffffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0xccd1c8aaee00bc4fL;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
@@ -19798,7 +19798,7 @@ static sp_digit sp_256_sub_4(sp_digit* r, const sp_digit* a,
|
||||
return (sp_digit)r;
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -20091,14 +20091,14 @@ static void sp_256_cond_copy_4(sp_digit* r, const sp_digit* a, sp_digit m)
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_mul_4(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -20285,9 +20285,9 @@ SP_NOINLINE static void sp_256_mont_mul_4(sp_digit* r, const sp_digit* a, const
|
||||
/* Square the Montgomery form number mod the modulus (prime). (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_sqr_4(sp_digit* r, const sp_digit* a, const sp_digit* m,
|
||||
sp_digit mp)
|
||||
@@ -20438,10 +20438,10 @@ SP_NOINLINE static void sp_256_mont_sqr_4(sp_digit* r, const sp_digit* a, const
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_4(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -20850,8 +20850,8 @@ static void sp_256_map_4(sp_point_256* r, const sp_point_256* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_add_4(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -20885,7 +20885,7 @@ static void sp_256_mont_add_4(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_dbl_4(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -20918,7 +20918,7 @@ static void sp_256_mont_dbl_4(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_tpl_4(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -20964,8 +20964,8 @@ static void sp_256_mont_tpl_4(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_sub_4(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -21231,8 +21231,8 @@ static void sp_256_proj_point_dbl_4(sp_point_256* r, const sp_point_256* p, sp_d
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_sub_dbl_4(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -21278,8 +21278,8 @@ static void sp_256_mont_sub_dbl_4(sp_digit* r, const sp_digit* a, const sp_digit
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_dbl_sub_4(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -23082,7 +23082,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -37065,7 +37065,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -39393,12 +39393,12 @@ static const sp_digit p384_mod[6] = {
|
||||
0x00000000ffffffffL,0xffffffff00000000L,0xfffffffffffffffeL,
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[6] = {
|
||||
0xffffffff00000001L,0x00000000ffffffffL,0x0000000000000001L,
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x0000000100000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -39414,14 +39414,14 @@ static const sp_digit p384_order2[6] = {
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[6] = {
|
||||
0x1313e695333ad68dL,0xa7e5f24db74f5885L,0x389cb27e0bc8d220L,
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x6ed46089e88fdc45L;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
@@ -40045,7 +40045,7 @@ static sp_digit sp_384_sub_6(sp_digit* r, const sp_digit* a,
|
||||
return (sp_digit)r;
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -40499,14 +40499,14 @@ SP_NOINLINE static void sp_384_mont_reduce_6(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_6(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -40518,9 +40518,9 @@ static void sp_384_mont_mul_6(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_6(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -40533,10 +40533,10 @@ static void sp_384_mont_sqr_6(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_6(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -40824,8 +40824,8 @@ static void sp_384_map_6(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_add_6(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -40840,7 +40840,7 @@ static void sp_384_mont_add_6(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_dbl_6(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -40854,7 +40854,7 @@ static void sp_384_mont_dbl_6(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_tpl_6(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -40937,8 +40937,8 @@ static sp_digit sp_384_cond_add_6(sp_digit* r, const sp_digit* a, const sp_digit
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_sub_6(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -42979,7 +42979,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -62784,7 +62784,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -66189,7 +66189,7 @@ static const sp_digit p1024_mod[16] = {
|
||||
0xbe9ae358b3e01a2eL,0x416c0ce19cb48261L,0x65c61198dad0657aL,
|
||||
0x997abb1f0a563fdaL
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[16] = {
|
||||
0x99927f850157a015L,0x7f3a20ef53853178L,0x031c17dc767a824fL,
|
||||
0x606b2950a968e0e0L,0x5830c3ade3c3f655L,0x49500b57ce7ad57dL,
|
||||
@@ -66198,7 +66198,7 @@ static const sp_digit p1024_norm_mod[16] = {
|
||||
0x41651ca74c1fe5d1L,0xbe93f31e634b7d9eL,0x9a39ee67252f9a85L,
|
||||
0x668544e0f5a9c025L
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x290420077c8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -66908,7 +66908,7 @@ static WC_INLINE int sp_1024_mod_16(sp_digit* r, const sp_digit* a, const sp_dig
|
||||
return sp_1024_div_16(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -67500,14 +67500,14 @@ SP_NOINLINE static void sp_1024_mont_reduce_16(sp_digit* a, const sp_digit* m,
|
||||
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -67519,9 +67519,9 @@ static void sp_1024_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -67640,8 +67640,8 @@ static void sp_1024_map_16(sp_point_1024* r, const sp_point_1024* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_add_16(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -67742,7 +67742,7 @@ static void sp_1024_mont_add_16(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_dbl_16(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -67834,7 +67834,7 @@ static void sp_1024_mont_dbl_16(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_tpl_16(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -67995,8 +67995,8 @@ static void sp_1024_mont_tpl_16(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_sub_16(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -73266,7 +73266,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
+88
-88
@@ -22895,14 +22895,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -22914,9 +22914,9 @@ static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -25777,14 +25777,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_64(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -25796,9 +25796,9 @@ static void sp_2048_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -73895,14 +73895,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_48(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -73914,9 +73914,9 @@ static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -77331,14 +77331,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_96(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_96(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -77350,9 +77350,9 @@ static void sp_3072_mont_mul_96(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_96(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -89402,14 +89402,14 @@ SP_NOINLINE static void sp_4096_mont_reduce_128(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_128(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -89421,9 +89421,9 @@ static void sp_4096_mont_mul_128(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_128(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -95549,12 +95549,12 @@ static const sp_digit p256_mod[8] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0x00000000,0x00000000,0x00000000,
|
||||
0x00000001,0xffffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[8] = {
|
||||
0x00000001,0x00000000,0x00000000,0xffffffff,0xffffffff,0xffffffff,
|
||||
0xfffffffe,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -95570,14 +95570,14 @@ static const sp_digit p256_order2[8] = {
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[8] = {
|
||||
0x039cdaaf,0x0c46353d,0x58e8617b,0x43190552,0x00000000,0x00000000,
|
||||
0xffffffff,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0xee00bc4f;
|
||||
#endif
|
||||
/* The base point of curve P256. */
|
||||
@@ -96607,7 +96607,7 @@ SP_NOINLINE static sp_digit sp_256_sub_8(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -97911,14 +97911,14 @@ SP_NOINLINE static void sp_256_mont_reduce_order_8(sp_digit* a,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_mul_8(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -97930,9 +97930,9 @@ static void sp_256_mont_mul_8(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_8(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -97945,10 +97945,10 @@ static void sp_256_mont_sqr_8(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_8(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -98199,8 +98199,8 @@ static void sp_256_map_8(sp_point_256* r, const sp_point_256* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_add_8(sp_digit* r, const sp_digit* a,
|
||||
@@ -98385,7 +98385,7 @@ SP_NOINLINE static void sp_256_mont_add_8(sp_digit* r, const sp_digit* a,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_dbl_8(sp_digit* r, const sp_digit* a,
|
||||
@@ -98562,7 +98562,7 @@ SP_NOINLINE static void sp_256_mont_dbl_8(sp_digit* r, const sp_digit* a,
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_tpl_8(sp_digit* r, const sp_digit* a,
|
||||
@@ -98895,8 +98895,8 @@ SP_NOINLINE static void sp_256_mont_tpl_8(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_sub_8(sp_digit* r, const sp_digit* a,
|
||||
@@ -101178,7 +101178,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -102727,7 +102727,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -106836,12 +106836,12 @@ static const sp_digit p384_mod[12] = {
|
||||
0xffffffff,0x00000000,0x00000000,0xffffffff,0xfffffffe,0xffffffff,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[12] = {
|
||||
0x00000001,0xffffffff,0xffffffff,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -106857,14 +106857,14 @@ static const sp_digit p384_order2[12] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[12] = {
|
||||
0x333ad68d,0x1313e695,0xb74f5885,0xa7e5f24d,0x0bc8d220,0x389cb27e,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0xe88fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
@@ -107965,7 +107965,7 @@ SP_NOINLINE static sp_digit sp_384_sub_12(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -109050,14 +109050,14 @@ SP_NOINLINE static void sp_384_mont_reduce_12(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_12(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -109069,9 +109069,9 @@ static void sp_384_mont_mul_12(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_12(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -109084,10 +109084,10 @@ static void sp_384_mont_sqr_12(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_12(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -109354,8 +109354,8 @@ static void sp_384_map_12(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_add_12(sp_digit* r, const sp_digit* a,
|
||||
@@ -109370,7 +109370,7 @@ SP_NOINLINE static void sp_384_mont_add_12(sp_digit* r, const sp_digit* a,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_dbl_12(sp_digit* r, const sp_digit* a,
|
||||
@@ -109385,7 +109385,7 @@ SP_NOINLINE static void sp_384_mont_dbl_12(sp_digit* r, const sp_digit* a,
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_tpl_12(sp_digit* r, const sp_digit* a,
|
||||
@@ -109471,8 +109471,8 @@ SP_NOINLINE static sp_digit sp_384_cond_add_12(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_sub_12(sp_digit* r, const sp_digit* a,
|
||||
@@ -111621,7 +111621,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -113170,7 +113170,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -182255,7 +182255,7 @@ static const sp_digit p1024_mod[32] = {
|
||||
0xb3e01a2e,0xbe9ae358,0x9cb48261,0x416c0ce1,0xdad0657a,0x65c61198,
|
||||
0x0a563fda,0x997abb1f
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[32] = {
|
||||
0x0157a015,0x99927f85,0x53853178,0x7f3a20ef,0x767a824f,0x031c17dc,
|
||||
0xa968e0e0,0x606b2950,0xe3c3f655,0x5830c3ad,0xce7ad57d,0x49500b57,
|
||||
@@ -182264,7 +182264,7 @@ static const sp_digit p1024_norm_mod[32] = {
|
||||
0x4c1fe5d1,0x41651ca7,0x634b7d9e,0xbe93f31e,0x252f9a85,0x9a39ee67,
|
||||
0xf5a9c025,0x668544e0
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x7c8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -183419,7 +183419,7 @@ static WC_INLINE int sp_1024_mod_32(sp_digit* r, const sp_digit* a, const sp_dig
|
||||
return sp_1024_div_32(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -184772,14 +184772,14 @@ SP_NOINLINE static void sp_1024_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -184791,9 +184791,9 @@ static void sp_1024_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -184912,8 +184912,8 @@ static void sp_1024_map_32(sp_point_1024* r, const sp_point_1024* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_add_32(sp_digit* r, const sp_digit* a,
|
||||
@@ -185822,7 +185822,7 @@ SP_NOINLINE static void sp_1024_mont_add_32(sp_digit* r, const sp_digit* a,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_dbl_32(sp_digit* r, const sp_digit* a,
|
||||
@@ -186699,7 +186699,7 @@ SP_NOINLINE static void sp_1024_mont_dbl_32(sp_digit* r, const sp_digit* a,
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_tpl_32(sp_digit* r, const sp_digit* a,
|
||||
@@ -188469,8 +188469,8 @@ SP_NOINLINE static void sp_1024_mont_tpl_32(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_sub_32(sp_digit* r, const sp_digit* a,
|
||||
@@ -196196,7 +196196,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
+118
-118
@@ -1738,14 +1738,14 @@ static void sp_2048_mont_reduce_36(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_2048_norm_36(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_36(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -1757,9 +1757,9 @@ static void sp_2048_mont_mul_36(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_36(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -2790,14 +2790,14 @@ static void sp_2048_mont_reduce_72(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_2048_norm_72(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_72(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -2809,9 +2809,9 @@ static void sp_2048_mont_mul_72(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_72(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -5452,14 +5452,14 @@ SP_NOINLINE static void sp_3072_mul_53(sp_digit* r, const sp_digit* a,
|
||||
r[0] = (sp_digit)c;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_53(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -5535,9 +5535,9 @@ SP_NOINLINE static void sp_3072_sqr_53(sp_digit* r, const sp_digit* a)
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_53(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -6390,14 +6390,14 @@ static void sp_3072_mont_reduce_106(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_3072_norm_106(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_106(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -6409,9 +6409,9 @@ static void sp_3072_mont_mul_106(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_106(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -9569,14 +9569,14 @@ static void sp_3072_mont_reduce_56(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_3072_norm_56(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_56(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -9588,9 +9588,9 @@ static void sp_3072_mont_mul_56(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_56(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -10489,14 +10489,14 @@ static void sp_3072_mont_reduce_112(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_3072_norm_112(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_112(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -10508,9 +10508,9 @@ static void sp_3072_mont_mul_112(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_112(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -13132,14 +13132,14 @@ SP_NOINLINE static void sp_4096_mul_71(sp_digit* r, const sp_digit* a,
|
||||
r[0] = (sp_digit)c;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_71(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -13215,9 +13215,9 @@ SP_NOINLINE static void sp_4096_sqr_71(sp_digit* r, const sp_digit* a)
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_71(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -14071,14 +14071,14 @@ static void sp_4096_mont_reduce_142(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_4096_norm_142(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_142(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -14090,9 +14090,9 @@ static void sp_4096_mont_mul_142(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_142(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -17132,14 +17132,14 @@ static void sp_4096_mont_reduce_81(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_4096_norm_81(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_81(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -17151,9 +17151,9 @@ static void sp_4096_mont_mul_81(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_81(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -18014,14 +18014,14 @@ static void sp_4096_mont_reduce_162(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_4096_norm_162(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_162(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -18033,9 +18033,9 @@ static void sp_4096_mont_mul_162(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_162(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -20007,12 +20007,12 @@ static const sp_digit p256_mod[9] = {
|
||||
0x1fffffff,0x1fffffff,0x1fffffff,0x000001ff,0x00000000,0x00000000,
|
||||
0x00040000,0x1fe00000,0x00ffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[9] = {
|
||||
0x00000001,0x00000000,0x00000000,0x1ffffe00,0x1fffffff,0x1fffffff,
|
||||
0x1ffbffff,0x001fffff,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x0000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -20028,14 +20028,14 @@ static const sp_digit p256_order2[9] = {
|
||||
0x0003ffff,0x1fe00000,0x00ffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[9] = {
|
||||
0x039cdaaf,0x0231a9e8,0x1a185ec3,0x120aa4b1,0x00000431,0x00000000,
|
||||
0x1ffc0000,0x001fffff,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0xe00bc4f;
|
||||
#endif
|
||||
/* The base point of curve P256. */
|
||||
@@ -20863,14 +20863,14 @@ static void sp_256_mont_reduce_9(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_256_norm_9(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_mul_9(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -20882,9 +20882,9 @@ static void sp_256_mont_mul_9(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_9(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -20897,10 +20897,10 @@ static void sp_256_mont_sqr_9(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_9(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -21035,8 +21035,8 @@ static void sp_256_map_9(sp_point_256* r, const sp_point_256* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_add_9(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -21052,7 +21052,7 @@ static void sp_256_mont_add_9(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_dbl_9(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -21067,7 +21067,7 @@ static void sp_256_mont_dbl_9(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_tpl_9(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -21117,8 +21117,8 @@ static void sp_256_cond_add_9(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_sub_9(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -21676,7 +21676,7 @@ static void sp_256_proj_point_add_9(sp_point_256* r,
|
||||
}
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -23186,7 +23186,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -24644,7 +24644,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -26858,13 +26858,13 @@ static const sp_digit p384_mod[15] = {
|
||||
0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff,
|
||||
0x00fffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[15] = {
|
||||
0x0000001,0x3ffffc0,0x3ffffff,0x003ffff,0x1000000,0x0000000,0x0000000,
|
||||
0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,
|
||||
0x0000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -26882,7 +26882,7 @@ static const sp_digit p384_order2[15] = {
|
||||
0x00fffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[15] = {
|
||||
0x33ad68d,0x0f9a54c,0x1885131,0x136dd3d,0x0a7e5f2,0x2f23488,0x1cb27e0,
|
||||
0x00000e2,0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,0x0000000,
|
||||
@@ -26890,7 +26890,7 @@ static const sp_digit p384_norm_order[15] = {
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x8fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
@@ -27984,14 +27984,14 @@ static void sp_384_mont_reduce_15(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_384_norm_15(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_15(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -28003,9 +28003,9 @@ static void sp_384_mont_mul_15(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_15(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -28018,10 +28018,10 @@ static void sp_384_mont_sqr_15(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_15(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -28172,8 +28172,8 @@ static void sp_384_map_15(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_add_15(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -28189,7 +28189,7 @@ static void sp_384_mont_add_15(sp_digit* r, const sp_digit* a, const sp_digit* b
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_dbl_15(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -28204,7 +28204,7 @@ static void sp_384_mont_dbl_15(sp_digit* r, const sp_digit* a, const sp_digit* m
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_tpl_15(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -28260,8 +28260,8 @@ static void sp_384_cond_add_15(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_sub_15(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -28827,7 +28827,7 @@ static void sp_384_proj_point_add_15(sp_point_384* r,
|
||||
}
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -30453,7 +30453,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -32423,7 +32423,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -35185,7 +35185,7 @@ static const sp_digit p1024_mod[42] = {
|
||||
0x1c0f1b2,0x1593f17,0x0bbd02a,0x167c034,0x09ae358,0x04130df,0x138672d,
|
||||
0x1482d81,0x1ad0657,0x0308cc6,0x0ff6997,0x03e14ac,0x0997abb,0x0000000
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[42] = {
|
||||
0x157a015,0x13fc280,0x05e2664,0x1ea70a6,0x1f3a20e,0x1d4127b,0x05f71d9,
|
||||
0x1c00638,0x0a968e0,0x03594a8,0x0fd9558,0x075bc78,0x1d5830c,0x073d6ab,
|
||||
@@ -35194,7 +35194,7 @@ static const sp_digit p1024_norm_mod[42] = {
|
||||
0x03f0e4d,0x0a6c0e8,0x1442fd5,0x0983fcb,0x1651ca7,0x1becf20,0x0c798d2,
|
||||
0x0b7d27e,0x052f9a8,0x1cf7339,0x1009668,0x1c1eb53,0x0668544,0x0000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -35671,7 +35671,7 @@ static int sp_1024_mod_42(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
return sp_1024_div_42(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -36196,14 +36196,14 @@ static void sp_1024_mont_reduce_42(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_1024_norm_42(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_42(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -36215,9 +36215,9 @@ static void sp_1024_mont_mul_42(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_42(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -36330,8 +36330,8 @@ static void sp_1024_map_42(sp_point_1024* r, const sp_point_1024* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_add_42(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -36347,7 +36347,7 @@ static void sp_1024_mont_add_42(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_dbl_42(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -36362,7 +36362,7 @@ static void sp_1024_mont_dbl_42(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_tpl_42(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -36382,8 +36382,8 @@ static void sp_1024_mont_tpl_42(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_sub_42(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -42242,7 +42242,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
+130
-130
@@ -655,14 +655,14 @@ SP_NOINLINE static void sp_2048_mul_17(sp_digit* r, const sp_digit* a,
|
||||
r[0] = (sp_digit)c;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_17(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -738,9 +738,9 @@ SP_NOINLINE static void sp_2048_sqr_17(sp_digit* r, const sp_digit* a)
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_17(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -1707,14 +1707,14 @@ static void sp_2048_mont_reduce_34(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_2048_norm_34(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_34(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -1726,9 +1726,9 @@ static void sp_2048_mont_mul_34(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_34(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -4527,14 +4527,14 @@ static void sp_2048_mont_reduce_18(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_2048_norm_18(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_18(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -4546,9 +4546,9 @@ static void sp_2048_mont_mul_18(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_18(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -5410,14 +5410,14 @@ static void sp_2048_mont_reduce_36(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_2048_norm_36(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_36(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -5429,9 +5429,9 @@ static void sp_2048_mont_mul_36(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_36(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -7821,14 +7821,14 @@ SP_NOINLINE static void sp_3072_mul_26(sp_digit* r, const sp_digit* a,
|
||||
r[0] = (sp_digit)c;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_26(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -7881,9 +7881,9 @@ SP_NOINLINE static void sp_3072_sqr_26(sp_digit* r, const sp_digit* a)
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_26(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -8768,14 +8768,14 @@ static void sp_3072_mont_reduce_52(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_3072_norm_52(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_52(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -8787,9 +8787,9 @@ static void sp_3072_mont_mul_52(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_52(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -11633,14 +11633,14 @@ static void sp_3072_mont_reduce_27(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_3072_norm_27(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_27(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -11652,9 +11652,9 @@ static void sp_3072_mont_mul_27(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_27(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -12528,14 +12528,14 @@ static void sp_3072_mont_reduce_54(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_3072_norm_54(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_54(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -12547,9 +12547,9 @@ static void sp_3072_mont_mul_54(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_54(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -14985,14 +14985,14 @@ SP_NOINLINE static void sp_4096_mul_35(sp_digit* r, const sp_digit* a,
|
||||
r[0] = (sp_digit)c;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_35(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -15045,9 +15045,9 @@ SP_NOINLINE static void sp_4096_sqr_35(sp_digit* r, const sp_digit* a)
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_35(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -15887,14 +15887,14 @@ static void sp_4096_mont_reduce_70(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_4096_norm_70(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_70(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -15906,9 +15906,9 @@ static void sp_4096_mont_mul_70(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_70(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -18759,14 +18759,14 @@ static void sp_4096_mont_reduce_39(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_4096_norm_39(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_39(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -18778,9 +18778,9 @@ static void sp_4096_mont_mul_39(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_39(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -19631,14 +19631,14 @@ static void sp_4096_mont_reduce_78(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_4096_norm_78(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_78(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -19650,9 +19650,9 @@ static void sp_4096_mont_mul_78(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_78(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -21458,12 +21458,12 @@ static const sp_digit p256_mod[5] = {
|
||||
0xfffffffffffffL,0x00fffffffffffL,0x0000000000000L,0x0001000000000L,
|
||||
0x0ffffffff0000L
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[5] = {
|
||||
0x0000000000001L,0xff00000000000L,0xfffffffffffffL,0xfffefffffffffL,
|
||||
0x000000000ffffL
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x0000000000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -21479,14 +21479,14 @@ static const sp_digit p256_order2[5] = {
|
||||
0x0ffffffff0000L
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[5] = {
|
||||
0x6353d039cdaafL,0x5258e8617b0c4L,0x0000000431905L,0xffff000000000L,
|
||||
0x000000000ffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0x1c8aaee00bc4fL;
|
||||
#endif
|
||||
/* The base point of curve P256. */
|
||||
@@ -22153,14 +22153,14 @@ static void sp_256_mont_reduce_5(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_256_norm_5(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_mul_5(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -22172,9 +22172,9 @@ static void sp_256_mont_mul_5(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_5(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -22187,10 +22187,10 @@ static void sp_256_mont_sqr_5(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_5(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -22325,8 +22325,8 @@ static void sp_256_map_5(sp_point_256* r, const sp_point_256* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_add_5(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -22342,7 +22342,7 @@ static void sp_256_mont_add_5(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_dbl_5(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -22357,7 +22357,7 @@ static void sp_256_mont_dbl_5(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_tpl_5(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -22403,8 +22403,8 @@ static void sp_256_cond_add_5(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_sub_5(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -22957,7 +22957,7 @@ static void sp_256_proj_point_add_5(sp_point_256* r,
|
||||
}
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -24404,7 +24404,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -25862,7 +25862,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -28053,12 +28053,12 @@ static const sp_digit p384_mod[7] = {
|
||||
0x000000ffffffffL,0x7ffe0000000000L,0x7ffffffffbffffL,0x7fffffffffffffL,
|
||||
0x7fffffffffffffL,0x7fffffffffffffL,0x3fffffffffffffL
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[7] = {
|
||||
0x7fffff00000001L,0x0001ffffffffffL,0x00000000040000L,0x00000000000000L,
|
||||
0x00000000000000L,0x00000000000000L,0x00000000000000L
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x0000100000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -28074,14 +28074,14 @@ static const sp_digit p384_order2[7] = {
|
||||
0x7fffffffffffffL,0x7fffffffffffffL,0x3fffffffffffffL
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[7] = {
|
||||
0x13e695333ad68dL,0x649b6e9eb10a26L,0x782f2348829f97L,0x00000001c4e593L,
|
||||
0x00000000000000L,0x00000000000000L,0x00000000000000L
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x546089e88fdc45L;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
@@ -28806,14 +28806,14 @@ static void sp_384_mont_reduce_7(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_384_norm_7(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_7(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -28825,9 +28825,9 @@ static void sp_384_mont_mul_7(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_7(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -28840,10 +28840,10 @@ static void sp_384_mont_sqr_7(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_7(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -28994,8 +28994,8 @@ static void sp_384_map_7(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_add_7(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -29011,7 +29011,7 @@ static void sp_384_mont_add_7(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_dbl_7(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -29026,7 +29026,7 @@ static void sp_384_mont_dbl_7(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_tpl_7(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -29074,8 +29074,8 @@ static void sp_384_cond_add_7(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_sub_7(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -29631,7 +29631,7 @@ static void sp_384_proj_point_add_7(sp_point_384* r,
|
||||
}
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -31134,7 +31134,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -33102,7 +33102,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -35694,7 +35694,7 @@ static const sp_digit p1024_mod[18] = {
|
||||
0x07e2fc0f1b22873L,0x19f00d177a05559L,0x0d20986fa6b8d62L,0x0caf482d819c339L,
|
||||
0x1da65c61198dad0L,0x04cbd5d8f852b1fL
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[18] = {
|
||||
0x1927f850157a015L,0x11077a9c298bc4cL,0x1f71d9ea093dfceL,0x0152d1c1c006382L,
|
||||
0x03c3f655606b295L,0x1d6abeac1861d6fL,0x18c7925402d5f39L,0x0575daa7465352fL,
|
||||
@@ -35702,7 +35702,7 @@ static const sp_digit p1024_norm_mod[18] = {
|
||||
0x181d03f0e4dd78cL,0x060ff2e885faaa6L,0x12df6790594729dL,0x1350b7d27e63cc6L,
|
||||
0x0259a39ee67252fL,0x03342a2707ad4e0L
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x10420077c8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -36205,7 +36205,7 @@ static int sp_1024_mod_18(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
return sp_1024_div_18(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -36702,14 +36702,14 @@ static void sp_1024_mont_reduce_18(sp_digit* a, const sp_digit* m, sp_digit mp)
|
||||
sp_1024_norm_18(a);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_18(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -36721,9 +36721,9 @@ static void sp_1024_mont_mul_18(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_18(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -36836,8 +36836,8 @@ static void sp_1024_map_18(sp_point_1024* r, const sp_point_1024* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_add_18(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -36853,7 +36853,7 @@ static void sp_1024_mont_add_18(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_dbl_18(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -36868,7 +36868,7 @@ static void sp_1024_mont_dbl_18(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_tpl_18(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -36888,8 +36888,8 @@ static void sp_1024_mont_tpl_18(sp_digit* r, const sp_digit* a, const sp_digit*
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_1024_mont_sub_18(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -42154,7 +42154,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
+88
-88
@@ -2953,14 +2953,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
sp_2048_cond_sub_32(a - 32, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -2972,9 +2972,9 @@ static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -3636,14 +3636,14 @@ SP_NOINLINE static void sp_2048_mont_reduce_64(sp_digit* a, const sp_digit* m,
|
||||
sp_2048_cond_sub_64(a - 64, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -3655,9 +3655,9 @@ static void sp_2048_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -8172,14 +8172,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_48(sp_digit* a, const sp_digit* m,
|
||||
sp_3072_cond_sub_48(a - 48, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -8191,9 +8191,9 @@ static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -8856,14 +8856,14 @@ SP_NOINLINE static void sp_3072_mont_reduce_96(sp_digit* a, const sp_digit* m,
|
||||
sp_3072_cond_sub_96(a - 96, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_96(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -8875,9 +8875,9 @@ static void sp_3072_mont_mul_96(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_96(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -12638,14 +12638,14 @@ SP_NOINLINE static void sp_4096_mont_reduce_128(sp_digit* a, const sp_digit* m,
|
||||
sp_4096_cond_sub_128(a - 128, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_128(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -12657,9 +12657,9 @@ static void sp_4096_mont_mul_128(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_128(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -15265,12 +15265,12 @@ static const sp_digit p256_mod[8] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0x00000000,0x00000000,0x00000000,
|
||||
0x00000001,0xffffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[8] = {
|
||||
0x00000001,0x00000000,0x00000000,0xffffffff,0xffffffff,0xffffffff,
|
||||
0xfffffffe,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -15286,14 +15286,14 @@ static const sp_digit p256_order2[8] = {
|
||||
0x00000000,0xffffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[8] = {
|
||||
0x039cdaaf,0x0c46353d,0x58e8617b,0x43190552,0x00000000,0x00000000,
|
||||
0xffffffff,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0xee00bc4f;
|
||||
#endif
|
||||
/* The base point of curve P256. */
|
||||
@@ -16370,7 +16370,7 @@ SP_NOINLINE static sp_digit sp_256_sub_8(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -16797,14 +16797,14 @@ static int sp_256_point_to_ecc_point_8(const sp_point_256* p, ecc_point* pm)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_mul_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -17459,9 +17459,9 @@ SP_NOINLINE static void sp_256_mont_mul_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Square the Montgomery form number mod the modulus (prime). (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_sqr_8(sp_digit* r, const sp_digit* a, const sp_digit* m,
|
||||
sp_digit mp)
|
||||
@@ -17976,10 +17976,10 @@ SP_NOINLINE static void sp_256_mont_sqr_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_8(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -18434,8 +18434,8 @@ static void sp_256_map_8(sp_point_256* r, const sp_point_256* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_add_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -18505,7 +18505,7 @@ SP_NOINLINE static void sp_256_mont_add_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_dbl_8(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -18558,7 +18558,7 @@ SP_NOINLINE static void sp_256_mont_dbl_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_tpl_8(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -18643,8 +18643,8 @@ SP_NOINLINE static void sp_256_mont_tpl_8(sp_digit* r, const sp_digit* a, const
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_256_mont_sub_8(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -20631,7 +20631,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -22180,7 +22180,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -24590,12 +24590,12 @@ static const sp_digit p384_mod[12] = {
|
||||
0xffffffff,0x00000000,0x00000000,0xffffffff,0xfffffffe,0xffffffff,
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[12] = {
|
||||
0x00000001,0xffffffff,0xffffffff,0x00000000,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x00000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -24611,14 +24611,14 @@ static const sp_digit p384_order2[12] = {
|
||||
0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[12] = {
|
||||
0x333ad68d,0x1313e695,0xb74f5885,0xa7e5f24d,0x0bc8d220,0x389cb27e,
|
||||
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0xe88fdc45;
|
||||
#endif
|
||||
/* The base point of curve P384. */
|
||||
@@ -25073,7 +25073,7 @@ SP_NOINLINE static sp_digit sp_384_sub_12(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -25512,14 +25512,14 @@ SP_NOINLINE static void sp_384_mont_reduce_12(sp_digit* a, const sp_digit* m,
|
||||
sp_384_cond_sub_12(a - 12, a, m, (sp_digit)0 - ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_12(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -25531,9 +25531,9 @@ static void sp_384_mont_mul_12(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_12(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -25546,10 +25546,10 @@ static void sp_384_mont_sqr_12(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_12(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -25753,8 +25753,8 @@ static void sp_384_map_12(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_add_12(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -25769,7 +25769,7 @@ SP_NOINLINE static void sp_384_mont_add_12(sp_digit* r, const sp_digit* a, const
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_dbl_12(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -25783,7 +25783,7 @@ SP_NOINLINE static void sp_384_mont_dbl_12(sp_digit* r, const sp_digit* a, const
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_tpl_12(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -25840,8 +25840,8 @@ SP_NOINLINE static sp_digit sp_384_cond_add_12(sp_digit* r, const sp_digit* a, c
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_384_mont_sub_12(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -27815,7 +27815,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -29364,7 +29364,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -32634,7 +32634,7 @@ static const sp_digit p1024_mod[32] = {
|
||||
0xb3e01a2e,0xbe9ae358,0x9cb48261,0x416c0ce1,0xdad0657a,0x65c61198,
|
||||
0x0a563fda,0x997abb1f
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[32] = {
|
||||
0x0157a015,0x99927f85,0x53853178,0x7f3a20ef,0x767a824f,0x031c17dc,
|
||||
0xa968e0e0,0x606b2950,0xe3c3f655,0x5830c3ad,0xce7ad57d,0x49500b57,
|
||||
@@ -32643,7 +32643,7 @@ static const sp_digit p1024_norm_mod[32] = {
|
||||
0x4c1fe5d1,0x41651ca7,0x634b7d9e,0xbe93f31e,0x252f9a85,0x9a39ee67,
|
||||
0xf5a9c025,0x668544e0
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x7c8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -33058,7 +33058,7 @@ static WC_INLINE int sp_1024_mod_32(sp_digit* r, const sp_digit* a, const sp_dig
|
||||
return sp_1024_div_32(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -33432,14 +33432,14 @@ SP_NOINLINE static void sp_1024_mont_reduce_32(sp_digit* a, const sp_digit* m,
|
||||
sp_1024_cond_sub_32(a - 32, a, m, ca);
|
||||
}
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -33451,9 +33451,9 @@ static void sp_1024_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -33572,8 +33572,8 @@ static void sp_1024_map_32(sp_point_1024* r, const sp_point_1024* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_add_32(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -33742,7 +33742,7 @@ SP_NOINLINE static void sp_1024_mont_add_32(sp_digit* r, const sp_digit* a, cons
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_dbl_32(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -33894,7 +33894,7 @@ SP_NOINLINE static void sp_1024_mont_dbl_32(sp_digit* r, const sp_digit* a, cons
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_tpl_32(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -34201,8 +34201,8 @@ SP_NOINLINE static void sp_1024_mont_tpl_32(sp_digit* r, const sp_digit* a, cons
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
SP_NOINLINE static void sp_1024_mont_sub_32(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -39983,7 +39983,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
+19
-19
@@ -66,13 +66,13 @@ static const sp_digit p256_mod[10] __attribute__((aligned(128))) = {
|
||||
0x0000400,0x3ff0000,0x03fffff
|
||||
};
|
||||
#ifndef WOLFSSL_SP_SMALL
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[10] __attribute__((aligned(128))) = {
|
||||
0x0000001,0x0000000,0x0000000,0x3fc0000,0x3ffffff,0x3ffffff,0x3ffffff,
|
||||
0x3fffbff,0x000ffff,0x0000000
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod __attribute__((aligned(128))) = 0x000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -83,14 +83,14 @@ static const sp_digit p256_order[10] __attribute__((aligned(128))) = {
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[10] __attribute__((aligned(128))) = {
|
||||
0x39cdaaf,0x18d4f40,0x217b0c4,0x14963a1,0x0431905,0x0000000,0x0000000,
|
||||
0x3fffc00,0x000ffff,0x0000000
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order __attribute__((aligned(128))) = 0x200bc4f;
|
||||
#endif
|
||||
/* The base point of curve P256. */
|
||||
@@ -168,7 +168,7 @@ static void sp_ecc_point_free(sp_point* p, int clear, void* heap)
|
||||
(void)heap;
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -1173,14 +1173,14 @@ SP_NOINLINE static void sp_256_mul_10(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_mul_10(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -1279,9 +1279,9 @@ SP_NOINLINE static void sp_256_sqr_10(sp_digit* r, const sp_digit* a)
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_10(sp_digit* r, const sp_digit* a, const sp_digit* m,
|
||||
sp_digit mp)
|
||||
@@ -1294,10 +1294,10 @@ static void sp_256_mont_sqr_10(sp_digit* r, const sp_digit* a, const sp_digit* m
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_10(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -1510,8 +1510,8 @@ SP_NOINLINE static int sp_256_add_10(sp_digit* r, const sp_digit* a,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_add_10(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -1528,7 +1528,7 @@ static void sp_256_mont_add_10(sp_digit* r, const sp_digit* a, const sp_digit* b
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_dbl_10(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -1544,7 +1544,7 @@ static void sp_256_mont_dbl_10(sp_digit* r, const sp_digit* a, const sp_digit* m
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_tpl_10(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -1667,8 +1667,8 @@ static void sp_256_cond_add_10(sp_digit* r, const sp_digit* a,
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_256_mont_sub_10(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
|
||||
@@ -3089,7 +3089,7 @@ int sp_cmp_d(sp_int* a, sp_int_digit d)
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_SP_ADD_D) || (defined(WOLFSSL_SP_INT_NEGATIVE) && \
|
||||
defined(WOFLSSL_SP_SUB_D)) || defined(WOLFSSL_SP_READ_RADIX_10)
|
||||
defined(WOLFSSL_SP_SUB_D)) || defined(WOLFSSL_SP_READ_RADIX_10)
|
||||
/* Add a one digit number to the multi-precision number.
|
||||
*
|
||||
* @param [in] a SP integer be added to.
|
||||
@@ -3136,7 +3136,7 @@ static int _sp_add_d(sp_int* a, sp_int_digit d, sp_int* r)
|
||||
|
||||
return err;
|
||||
}
|
||||
#endif /* WOLFSSL_SP_ADD_D || (WOLFSSL_SP_INT_NEGATIVE && WOFLSSL_SP_SUB_D) ||
|
||||
#endif /* WOLFSSL_SP_ADD_D || (WOLFSSL_SP_INT_NEGATIVE && WOLFSSL_SP_SUB_D) ||
|
||||
* defined(WOLFSSL_SP_READ_RADIX_10) */
|
||||
|
||||
#if (defined(WOLFSSL_SP_INT_NEGATIVE) && defined(WOLFSSL_SP_ADD_D)) || \
|
||||
@@ -8053,7 +8053,7 @@ int sp_invmod(sp_int* a, sp_int* m, sp_int* r)
|
||||
*
|
||||
* Modulus (m) must be a prime and greater than 2.
|
||||
*
|
||||
* @param [in] a SP integer, Montogmery form, to find inverse of.
|
||||
* @param [in] a SP integer, Montgomery form, to find inverse of.
|
||||
* @param [in] m SP integer this is the modulus.
|
||||
* @param [out] r SP integer to hold result.
|
||||
* @param [in] mp SP integer digit that is the bottom digit of inv(-m).
|
||||
@@ -11886,7 +11886,7 @@ int sp_sqrmod(sp_int* a, sp_int* m, sp_int* r)
|
||||
#endif /* !WOLFSSL_RSA_VERIFY_ONLY */
|
||||
|
||||
/**********************
|
||||
* Montogmery functions
|
||||
* Montgomery functions
|
||||
**********************/
|
||||
|
||||
#if defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_HAVE_SP_DH) || \
|
||||
|
||||
+117
-117
@@ -268,14 +268,14 @@ static void sp_2048_mont_norm_16(sp_digit* r, const sp_digit* m)
|
||||
|
||||
extern sp_digit sp_2048_cond_sub_16(sp_digit* r, const sp_digit* a, const sp_digit* b, sp_digit m);
|
||||
extern void sp_2048_mont_reduce_16(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -287,9 +287,9 @@ static void sp_2048_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -630,14 +630,14 @@ static int sp_2048_mod_exp_16(sp_digit* r, const sp_digit* a, const sp_digit* e,
|
||||
|
||||
extern void sp_2048_mont_reduce_avx2_16(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_avx2_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -651,9 +651,9 @@ static void sp_2048_mont_mul_avx2_16(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_avx2_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -863,14 +863,14 @@ static void sp_2048_mont_norm_32(sp_digit* r, const sp_digit* m)
|
||||
#endif /* (WOLFSSL_HAVE_SP_RSA & !WOLFSSL_RSA_PUBLIC_ONLY) | WOLFSSL_HAVE_SP_DH */
|
||||
extern sp_digit sp_2048_cond_sub_32(sp_digit* r, const sp_digit* a, const sp_digit* b, sp_digit m);
|
||||
extern void sp_2048_mont_reduce_32(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -882,9 +882,9 @@ static void sp_2048_mont_mul_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -1292,14 +1292,14 @@ static int sp_2048_mod_exp_32(sp_digit* r, const sp_digit* a, const sp_digit* e,
|
||||
#endif /* (WOLFSSL_HAVE_SP_RSA && !WOLFSSL_RSA_PUBLIC_ONLY) || WOLFSSL_HAVE_SP_DH */
|
||||
extern void sp_2048_mont_reduce_avx2_32(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_mul_avx2_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -1313,9 +1313,9 @@ static void sp_2048_mont_mul_avx2_32(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_2048_mont_sqr_avx2_32(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -2733,14 +2733,14 @@ static void sp_3072_mont_norm_24(sp_digit* r, const sp_digit* m)
|
||||
|
||||
extern sp_digit sp_3072_cond_sub_24(sp_digit* r, const sp_digit* a, const sp_digit* b, sp_digit m);
|
||||
extern void sp_3072_mont_reduce_24(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_24(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -2752,9 +2752,9 @@ static void sp_3072_mont_mul_24(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_24(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -3095,14 +3095,14 @@ static int sp_3072_mod_exp_24(sp_digit* r, const sp_digit* a, const sp_digit* e,
|
||||
|
||||
extern void sp_3072_mont_reduce_avx2_24(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_avx2_24(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -3116,9 +3116,9 @@ static void sp_3072_mont_mul_avx2_24(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_avx2_24(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -3328,14 +3328,14 @@ static void sp_3072_mont_norm_48(sp_digit* r, const sp_digit* m)
|
||||
#endif /* (WOLFSSL_HAVE_SP_RSA & !WOLFSSL_RSA_PUBLIC_ONLY) | WOLFSSL_HAVE_SP_DH */
|
||||
extern sp_digit sp_3072_cond_sub_48(sp_digit* r, const sp_digit* a, const sp_digit* b, sp_digit m);
|
||||
extern void sp_3072_mont_reduce_48(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -3347,9 +3347,9 @@ static void sp_3072_mont_mul_48(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -3757,14 +3757,14 @@ static int sp_3072_mod_exp_48(sp_digit* r, const sp_digit* a, const sp_digit* e,
|
||||
#endif /* (WOLFSSL_HAVE_SP_RSA && !WOLFSSL_RSA_PUBLIC_ONLY) || WOLFSSL_HAVE_SP_DH */
|
||||
extern void sp_3072_mont_reduce_avx2_48(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_mul_avx2_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -3778,9 +3778,9 @@ static void sp_3072_mont_mul_avx2_48(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_3072_mont_sqr_avx2_48(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -5180,14 +5180,14 @@ static void sp_4096_mont_norm_64(sp_digit* r, const sp_digit* m)
|
||||
#endif /* (WOLFSSL_HAVE_SP_RSA & !WOLFSSL_RSA_PUBLIC_ONLY) | WOLFSSL_HAVE_SP_DH */
|
||||
extern sp_digit sp_4096_cond_sub_64(sp_digit* r, const sp_digit* a, const sp_digit* b, sp_digit m);
|
||||
extern void sp_4096_mont_reduce_64(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -5199,9 +5199,9 @@ static void sp_4096_mont_mul_64(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -5609,14 +5609,14 @@ static int sp_4096_mod_exp_64(sp_digit* r, const sp_digit* a, const sp_digit* e,
|
||||
#endif /* (WOLFSSL_HAVE_SP_RSA && !WOLFSSL_RSA_PUBLIC_ONLY) || WOLFSSL_HAVE_SP_DH */
|
||||
extern void sp_4096_mont_reduce_avx2_64(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_mul_avx2_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -5630,9 +5630,9 @@ static void sp_4096_mont_mul_avx2_64(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_4096_mont_sqr_avx2_64(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -6767,12 +6767,12 @@ static const sp_digit p256_mod[4] = {
|
||||
0xffffffffffffffffL,0x00000000ffffffffL,0x0000000000000000L,
|
||||
0xffffffff00000001L
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P256. */
|
||||
/* The Montgomery normalizer for modulus of the curve P256. */
|
||||
static const sp_digit p256_norm_mod[4] = {
|
||||
0x0000000000000001L,0xffffffff00000000L,0xffffffffffffffffL,
|
||||
0x00000000fffffffeL
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P256. */
|
||||
/* The Montgomery multiplier for modulus of the curve P256. */
|
||||
static const sp_digit p256_mp_mod = 0x0000000000000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -6788,14 +6788,14 @@ static const sp_digit p256_order2[4] = {
|
||||
0xffffffff00000000L
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P256. */
|
||||
/* The Montgomery normalizer for order of the curve P256. */
|
||||
static const sp_digit p256_norm_order[4] = {
|
||||
0x0c46353d039cdaafL,0x4319055258e8617bL,0x0000000000000000L,
|
||||
0x00000000ffffffffL
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P256. */
|
||||
/* The Montgomery multiplier for order of the curve P256. */
|
||||
static const sp_digit p256_mp_order = 0xccd1c8aaee00bc4fL;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
@@ -6834,7 +6834,7 @@ extern void sp_256_mul_4(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
extern void sp_256_sqr_4(sp_digit* r, const sp_digit* a);
|
||||
extern sp_digit sp_256_add_4(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
extern sp_digit sp_256_sub_4(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -7102,10 +7102,10 @@ extern void sp_256_mont_sqr_4(sp_digit* r, const sp_digit* a, const sp_digit* m,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_4(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -8225,10 +8225,10 @@ extern void sp_256_mont_sqr_avx2_4(sp_digit* r, const sp_digit* a, const sp_digi
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_256_mont_sqr_n_avx2_4(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -10149,7 +10149,7 @@ int sp_ecc_mulmod_256(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -22975,7 +22975,7 @@ int sp_ecc_mulmod_base_256(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -25338,12 +25338,12 @@ static const sp_digit p384_mod[6] = {
|
||||
0x00000000ffffffffL,0xffffffff00000000L,0xfffffffffffffffeL,
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P384. */
|
||||
/* The Montgomery normalizer for modulus of the curve P384. */
|
||||
static const sp_digit p384_norm_mod[6] = {
|
||||
0xffffffff00000001L,0x00000000ffffffffL,0x0000000000000001L,
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P384. */
|
||||
/* The Montgomery multiplier for modulus of the curve P384. */
|
||||
static sp_digit p384_mp_mod = 0x0000000100000001;
|
||||
#if defined(WOLFSSL_VALIDATE_ECC_KEYGEN) || defined(HAVE_ECC_SIGN) || \
|
||||
defined(HAVE_ECC_VERIFY)
|
||||
@@ -25359,14 +25359,14 @@ static const sp_digit p384_order2[6] = {
|
||||
0xffffffffffffffffL,0xffffffffffffffffL,0xffffffffffffffffL
|
||||
};
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery normalizer for order of the curve P384. */
|
||||
/* The Montgomery normalizer for order of the curve P384. */
|
||||
static const sp_digit p384_norm_order[6] = {
|
||||
0x1313e695333ad68dL,0xa7e5f24db74f5885L,0x389cb27e0bc8d220L,
|
||||
0x0000000000000000L,0x0000000000000000L,0x0000000000000000L
|
||||
};
|
||||
#endif
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
/* The Montogmery multiplier for order of the curve P384. */
|
||||
/* The Montgomery multiplier for order of the curve P384. */
|
||||
static sp_digit p384_mp_order = 0x6ed46089e88fdc45L;
|
||||
#endif
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
@@ -25408,7 +25408,7 @@ extern void sp_384_mul_6(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
extern void sp_384_sqr_6(sp_digit* r, const sp_digit* a);
|
||||
extern sp_digit sp_384_add_6(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
extern sp_digit sp_384_sub_6(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -25715,14 +25715,14 @@ extern void sp_384_cond_copy_6(sp_digit* r, const sp_digit* a, sp_digit m);
|
||||
extern sp_digit sp_384_cond_sub_6(sp_digit* r, const sp_digit* a, const sp_digit* b, sp_digit m);
|
||||
extern void sp_384_mont_reduce_6(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
extern void sp_384_mont_reduce_order_6(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_6(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -25734,9 +25734,9 @@ static void sp_384_mont_mul_6(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_6(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -25749,10 +25749,10 @@ static void sp_384_mont_sqr_6(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_6(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -25910,8 +25910,8 @@ static void sp_384_map_6(sp_point_384* r, const sp_point_384* p,
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_add_6(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -25929,7 +25929,7 @@ extern sp_digit sp_384_dbl_6(sp_digit* r, const sp_digit* a);
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_dbl_6(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -25945,7 +25945,7 @@ static void sp_384_mont_dbl_6(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_tpl_6(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
@@ -25964,8 +25964,8 @@ extern sp_digit sp_384_cond_add_6(sp_digit* r, const sp_digit* a, const sp_digit
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
static void sp_384_mont_sub_6(sp_digit* r, const sp_digit* a, const sp_digit* b,
|
||||
@@ -26950,14 +26950,14 @@ static int sp_384_ecc_mulmod_win_add_sub_6(sp_point_384* r, const sp_point_384*
|
||||
extern void sp_384_mul_avx2_6(sp_digit* r, const sp_digit* a, const sp_digit* b);
|
||||
#define sp_384_mont_reduce_avx2_6 sp_384_mont_reduce_6
|
||||
extern void sp_384_mont_reduce_order_avx2_6(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_mul_avx2_6(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -26972,9 +26972,9 @@ extern void sp_384_sqr_avx2_6(sp_digit* r, const sp_digit* a);
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_avx2_6(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -26988,10 +26988,10 @@ static void sp_384_mont_sqr_avx2_6(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number a number of times. (r = a ^ n mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* n Number of times to square.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_384_mont_sqr_n_avx2_6(sp_digit* r, const sp_digit* a, int n,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -28925,7 +28925,7 @@ int sp_ecc_mulmod_384(const mp_int* km, const ecc_point* gm, ecc_point* r,
|
||||
* km Scalar to multiply by.
|
||||
* p Point to multiply.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -47565,7 +47565,7 @@ int sp_ecc_mulmod_base_384(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
@@ -49998,7 +49998,7 @@ static const sp_digit p1024_mod[16] = {
|
||||
0xbe9ae358b3e01a2eL,0x416c0ce19cb48261L,0x65c61198dad0657aL,
|
||||
0x997abb1f0a563fdaL
|
||||
};
|
||||
/* The Montogmery normalizer for modulus of the curve P1024. */
|
||||
/* The Montgomery normalizer for modulus of the curve P1024. */
|
||||
static const sp_digit p1024_norm_mod[16] = {
|
||||
0x99927f850157a015L,0x7f3a20ef53853178L,0x031c17dc767a824fL,
|
||||
0x606b2950a968e0e0L,0x5830c3ade3c3f655L,0x49500b57ce7ad57dL,
|
||||
@@ -50007,7 +50007,7 @@ static const sp_digit p1024_norm_mod[16] = {
|
||||
0x41651ca74c1fe5d1L,0xbe93f31e634b7d9eL,0x9a39ee67252f9a85L,
|
||||
0x668544e0f5a9c025L
|
||||
};
|
||||
/* The Montogmery multiplier for modulus of the curve P1024. */
|
||||
/* The Montgomery multiplier for modulus of the curve P1024. */
|
||||
static sp_digit p1024_mp_mod = 0x290420077c8f2f3d;
|
||||
#if defined(WOLFSSL_SP_SMALL) || defined(HAVE_ECC_CHECK_KEY)
|
||||
/* The order of the curve P1024. */
|
||||
@@ -50222,7 +50222,7 @@ static WC_INLINE int sp_1024_mod_16(sp_digit* r, const sp_digit* a,
|
||||
return sp_1024_div_16(a, m, NULL, r);
|
||||
}
|
||||
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -50236,7 +50236,7 @@ static int sp_1024_mod_mul_norm_16(sp_digit* r, const sp_digit* a, const sp_digi
|
||||
}
|
||||
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply a number by Montogmery normalizer mod modulus (prime).
|
||||
/* Multiply a number by Montgomery normalizer mod modulus (prime).
|
||||
*
|
||||
* r The resulting Montgomery form number.
|
||||
* a The number to convert.
|
||||
@@ -50505,14 +50505,14 @@ static int sp_1024_point_to_ecc_point_16(const sp_point_1024* p, ecc_point* pm)
|
||||
|
||||
extern void sp_1024_cond_copy_16(sp_digit* r, const sp_digit* a, sp_digit m);
|
||||
extern void sp_1024_mont_reduce_16(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -50524,9 +50524,9 @@ static void sp_1024_mont_mul_16(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -51629,14 +51629,14 @@ static int sp_1024_ecc_mulmod_win_add_sub_16(sp_point_1024* r, const sp_point_10
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
extern void sp_1024_mont_reduce_avx2_16(sp_digit* a, const sp_digit* m, sp_digit mp);
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_mul_avx2_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* b, const sp_digit* m, sp_digit mp)
|
||||
@@ -51650,9 +51650,9 @@ static void sp_1024_mont_mul_avx2_16(sp_digit* r, const sp_digit* a,
|
||||
/* Square the Montgomery form number. (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
static void sp_1024_mont_sqr_avx2_16(sp_digit* r, const sp_digit* a,
|
||||
const sp_digit* m, sp_digit mp)
|
||||
@@ -56933,7 +56933,7 @@ int sp_ecc_mulmod_base_1024(const mp_int* km, ecc_point* r, int map, void* heap)
|
||||
*
|
||||
* km Scalar to multiply by.
|
||||
* am Point to add to scalar mulitply result.
|
||||
* inMont Point to add is in montogmery form.
|
||||
* inMont Point to add is in montgomery form.
|
||||
* r Resulting point.
|
||||
* map Indicates whether to convert result to affine.
|
||||
* heap Heap to use for allocation.
|
||||
|
||||
@@ -39026,14 +39026,14 @@ _sp_256_cond_copy_4:
|
||||
#ifndef __APPLE__
|
||||
.size sp_256_cond_copy_4,.-sp_256_cond_copy_4
|
||||
#endif /* __APPLE__ */
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -39234,9 +39234,9 @@ _sp_256_mont_mul_4:
|
||||
/* Square the Montgomery form number mod the modulus (prime). (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -39637,8 +39637,8 @@ L_mont_loop_4:
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -39689,7 +39689,7 @@ _sp_256_mont_add_4:
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of doubling.
|
||||
* a Number to double in Montogmery form.
|
||||
* a Number to double in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -39740,7 +39740,7 @@ _sp_256_mont_dbl_4:
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of Tripling.
|
||||
* a Number to triple in Montogmery form.
|
||||
* a Number to triple in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -39812,8 +39812,8 @@ _sp_256_mont_tpl_4:
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of subtration.
|
||||
* a Number to subtract from in Montogmery form.
|
||||
* b Number to subtract with in Montogmery form.
|
||||
* a Number to subtract from in Montgomery form.
|
||||
* b Number to subtract with in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -40033,14 +40033,14 @@ L_256_get_point_33_avx2_4_start:
|
||||
#endif /* HAVE_INTEL_AVX2 */
|
||||
#endif /* !WC_NO_CACHE_RESISTANT */
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -40223,9 +40223,9 @@ _sp_256_mont_mul_avx2_4:
|
||||
/* Square the Montgomery form number mod the modulus (prime). (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
* mp Montogmery mulitplier.
|
||||
* mp Montgomery mulitplier.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -41424,12 +41424,12 @@ _div_256_word_asm_4:
|
||||
#endif /* __APPLE__ */
|
||||
#endif /* _WIN64 */
|
||||
#ifdef HAVE_INTEL_AVX2
|
||||
/* Multiply two Montogmery form numbers mod the modulus (prime).
|
||||
/* Multiply two Montgomery form numbers mod the modulus (prime).
|
||||
* (r = a * b mod m)
|
||||
*
|
||||
* r Result of multiplication.
|
||||
* a First number to multiply in Montogmery form.
|
||||
* b Second number to multiply in Montogmery form.
|
||||
* a First number to multiply in Montgomery form.
|
||||
* b Second number to multiply in Montgomery form.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -41658,7 +41658,7 @@ _sp_256_mont_mul_order_avx2_4:
|
||||
/* Square the Montgomery form number mod the modulus (prime). (r = a * a mod m)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -44409,7 +44409,7 @@ L_mont_loop_order_avx2_6:
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
*
|
||||
* r Result of squaring.
|
||||
* a Number to square in Montogmery form.
|
||||
* a Number to square in Montgomery form.
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
.text
|
||||
@@ -52230,8 +52230,8 @@ L_1024_mont_loop_16:
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -52405,7 +52405,7 @@ _sp_1024_mont_add_16:
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a Number to souble in Montogmery form.
|
||||
* a Number to souble in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -52579,7 +52579,7 @@ _sp_1024_mont_dbl_16:
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a Number to souble in Montogmery form.
|
||||
* a Number to souble in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -52903,8 +52903,8 @@ _sp_1024_mont_tpl_16:
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -53646,8 +53646,8 @@ L_1024_mont_loop_avx2_16:
|
||||
/* Add two Montgomery form numbers (r = a + b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -53805,7 +53805,7 @@ _sp_1024_mont_add_avx2_16:
|
||||
/* Double a Montgomery form number (r = a + a % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a Number to souble in Montogmery form.
|
||||
* a Number to souble in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -53963,7 +53963,7 @@ _sp_1024_mont_dbl_avx2_16:
|
||||
/* Triple a Montgomery form number (r = a + a + a % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a Number to souble in Montogmery form.
|
||||
* a Number to souble in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
@@ -54255,8 +54255,8 @@ _sp_1024_mont_tpl_avx2_16:
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
*
|
||||
* r Result of addition.
|
||||
* a First number to add in Montogmery form.
|
||||
* b Second number to add in Montogmery form.
|
||||
* a First number to add in Montgomery form.
|
||||
* b Second number to add in Montgomery form.
|
||||
* m Modulus (prime).
|
||||
*/
|
||||
#ifndef __APPLE__
|
||||
|
||||
@@ -28786,12 +28786,12 @@ static int eccsi_sign_verify_test(EccsiKey* priv, EccsiKey* pub, WC_RNG* rng,
|
||||
if (!verified)
|
||||
return -10166;
|
||||
|
||||
/* Check that the KPAK is converted from montogmery form. */
|
||||
/* Check that the KPAK is converted from montgomery form. */
|
||||
ret = eccsi_imp_exp_key_test(priv);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
/* Check that KPAK can converted to Montogmery form again. */
|
||||
/* Check that KPAK can converted to Montgomery form again. */
|
||||
ret = wc_VerifyEccsiHash(priv, WC_HASH_TYPE_SHA256, msg, msgSz, sig, sigSz,
|
||||
&verified);
|
||||
if (ret != 0)
|
||||
@@ -28799,7 +28799,7 @@ static int eccsi_sign_verify_test(EccsiKey* priv, EccsiKey* pub, WC_RNG* rng,
|
||||
if (!verified)
|
||||
return -10168;
|
||||
|
||||
/* Check that the KPAK is converted from montogmery form. */
|
||||
/* Check that the KPAK is converted from montgomery form. */
|
||||
ret = wc_ValidateEccsiPair(pub, WC_HASH_TYPE_SHA256, id, idSz, ssk, pvt,
|
||||
&valid);
|
||||
if (ret != 0)
|
||||
@@ -28807,7 +28807,7 @@ static int eccsi_sign_verify_test(EccsiKey* priv, EccsiKey* pub, WC_RNG* rng,
|
||||
if (!valid)
|
||||
return -10170;
|
||||
|
||||
/* Check that KPAK can converted to Montogmery form again. */
|
||||
/* Check that KPAK can converted to Montgomery form again. */
|
||||
ret = wc_VerifyEccsiHash(priv, WC_HASH_TYPE_SHA256, msg, msgSz, sig, sigSz,
|
||||
&verified);
|
||||
if (ret != 0)
|
||||
@@ -28815,7 +28815,7 @@ static int eccsi_sign_verify_test(EccsiKey* priv, EccsiKey* pub, WC_RNG* rng,
|
||||
if (!verified)
|
||||
return -10172;
|
||||
|
||||
/* Check that the KPAK is converted from montogmery form. */
|
||||
/* Check that the KPAK is converted from montgomery form. */
|
||||
ret = eccsi_imp_exp_pubkey_test(priv, pub);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
+6
-6
@@ -850,7 +850,7 @@
|
||||
(defined(NO_DH) || !defined(HAVE_ANON)) && \
|
||||
defined(NO_RSA) && !defined(HAVE_ECC) && \
|
||||
!defined(HAVE_ED25519) && !defined(HAVE_ED448)
|
||||
#error "No cipher suites avaialble with this build"
|
||||
#error "No cipher suites available with this build"
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_MULTICAST
|
||||
@@ -1104,7 +1104,7 @@ enum {
|
||||
TLS_AES_128_CCM_SHA256 = 0x04,
|
||||
TLS_AES_128_CCM_8_SHA256 = 0x05,
|
||||
|
||||
/* TLS v1.3 Integity only cipher suites - 0xC0 (ECC) first byte */
|
||||
/* TLS v1.3 Integrity only cipher suites - 0xC0 (ECC) first byte */
|
||||
TLS_SHA256_SHA256 = 0xB4,
|
||||
TLS_SHA384_SHA384 = 0xB5,
|
||||
|
||||
@@ -1182,7 +1182,7 @@ enum {
|
||||
#ifndef MAX_PSK_ID_LEN
|
||||
/* max psk identity/hint supported */
|
||||
#if defined(WOLFSSL_TLS13)
|
||||
/* OpenSSL has a 1472 byte sessiont ticket */
|
||||
/* OpenSSL has a 1472 byte session ticket */
|
||||
#define MAX_PSK_ID_LEN 1536
|
||||
#else
|
||||
#define MAX_PSK_ID_LEN 128
|
||||
@@ -1444,7 +1444,7 @@ enum Misc {
|
||||
EVP_SALT_SIZE = 8, /* evp salt size 64 bits */
|
||||
|
||||
#ifndef ECDHE_SIZE /* allow this to be overridden at compile-time */
|
||||
ECDHE_SIZE = 32, /* ECHDE server size defaults to 256 bit */
|
||||
ECDHE_SIZE = 32, /* ECDHE server size defaults to 256 bit */
|
||||
#endif
|
||||
MAX_EXPORT_ECC_SZ = 256, /* Export ANS X9.62 max future size */
|
||||
MAX_CURVE_NAME_SZ = 16, /* Maximum size of curve name string */
|
||||
@@ -3167,7 +3167,7 @@ enum SigAlgRsaPss {
|
||||
};
|
||||
|
||||
|
||||
/* Supprted ECC Curve Types */
|
||||
/* Supported ECC Curve Types */
|
||||
enum EccCurves {
|
||||
named_curve = 3
|
||||
};
|
||||
@@ -3647,7 +3647,7 @@ typedef struct Options {
|
||||
#endif
|
||||
word16 keepResources:1; /* Keep resources after handshake */
|
||||
word16 useClientOrder:1; /* Use client's cipher order */
|
||||
word16 mutualAuth:1; /* Mutual authentication is rquired */
|
||||
word16 mutualAuth:1; /* Mutual authentication is required */
|
||||
#if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH)
|
||||
word16 postHandshakeAuth:1;/* Client send post_handshake_auth
|
||||
* extension */
|
||||
|
||||
@@ -103,7 +103,7 @@ typedef struct EccsiKey {
|
||||
#endif
|
||||
/** Heap hint for dynamic memory allocation. */
|
||||
void* heap;
|
||||
/** Bit indicates KPAK (public key) is in montogmery form. */
|
||||
/** Bit indicates KPAK (public key) is in montgomery form. */
|
||||
word16 kpakMont:1;
|
||||
} EccsiKey;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user