tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

curve25519_64.c (789B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #include "ecl-priv.h"
      6 
      7 #if HACL_CAN_COMPILE_INLINE_ASM
      8 #include "../verified/Hacl_Curve25519_64.h"
      9 #else
     10 #include "../verified/Hacl_Curve25519_51.h"
     11 #endif
     12 
     13 SECStatus
     14 ec_Curve25519_mul(uint8_t *mypublic, const uint8_t *secret, const uint8_t *basepoint)
     15 {
     16 // Note: this cast is safe because HaCl* state has a post-condition that only "mypublic" changed.
     17 #if defined HACL_CAN_COMPILE_INLINE_ASM
     18    Hacl_Curve25519_64_ecdh(mypublic, (uint8_t *)secret, (uint8_t *)basepoint);
     19 #else
     20    Hacl_Curve25519_51_ecdh(mypublic, (uint8_t *)secret, (uint8_t *)basepoint);
     21 #endif
     22 
     23    return 0;
     24 }