nacl

Check-in [f8157ead2c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:remove rcsid; no longer required
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f8157ead2c0ad069d84e752bf775c5b1d58db99005136e64060c331ba7aea9d4
User & Date: alex 2019-12-10 19:03:46
Context
2019-12-13
14:40
new README check-in: 6154666294 user: alex tags: trunk
2019-12-10
19:03
remove rcsid; no longer required check-in: f8157ead2c user: alex tags: trunk
2019-11-25
09:47
patch to test-suite; update to latest TEA check-in: d0811351e4 user: alex tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/nacl.c.

254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
....
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
....
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
#include "crypto_reference.h"
#include "randombytes.h"

#ifndef FALSE
#define FALSE 0
#define TRUE (!FALSE)
#endif

static char rcs[] = "@(#)nacl.c $Revision: 1.1 $ $Date: 2016/08/11 20:00:56 $ (BSD 3 License) Alexander Schoepe, Bochum, DE";


/*
   nacl::randombytes names
   nacl::randombytes source ?random|urandom|secrandomcopybytes|cryptgenrandom|default?
   nacl::randombytes lengthValue
   nacl::randombytes box ?-nonce?
   nacl::randombytes scalarmult ?-scalar|-group?
................................................................................
 * timing attacks.
 * 
 * C NaCl also provides a similar crypto_verify_32 function.
 */

// Not implemented for calling from Tcl


static int Tnacl_RcsId (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) {
  Tcl_SetObjResult(interp, Tcl_NewStringObj(rcs, -1));
  return TCL_OK;
}


static int Tnacl_Info (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) {
  Tcl_SetObjResult(interp, Tcl_NewStringObj(TWEETNACL_VERSION, -1));
  Tcl_Obj *lObjPtr = Tcl_NewListObj(0, NULL);

  Tcl_ListObjAppendElement(interp, lObjPtr, Tcl_NewStringObj("NaCl", -1));
  Tcl_ListObjAppendElement(interp, lObjPtr, Tcl_NewIntObj(20110221));
................................................................................
  Tcl_CreateObjCommand(interp, "::nacl::auth", Tnacl_Auth, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
  Tcl_CreateObjCommand(interp, "::nacl::onetimeauth", Tnacl_OneTimeAuth, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

  // low-level functions
  Tcl_CreateObjCommand(interp, "::nacl::hash", Tnacl_Hash, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

  // information functions
  Tcl_CreateObjCommand(interp, "::nacl::rcsid", Tnacl_RcsId, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
  Tcl_CreateObjCommand(interp, "::nacl::info", Tnacl_Info, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

  Tcl_PkgProvide(interp, PACKAGE_NAME, PACKAGE_VERSION);
  return TCL_OK;
}

#ifdef _WIN32
DECLSPEC_EXPORT
#endif
int Nacl_SafeInit(Tcl_Interp *interp) {
  return Nacl_Init(interp);
}








<
<
<







 







<
<
<
<
<
<







 







<













254
255
256
257
258
259
260



261
262
263
264
265
266
267
....
2443
2444
2445
2446
2447
2448
2449






2450
2451
2452
2453
2454
2455
2456
....
2570
2571
2572
2573
2574
2575
2576

2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
#include "crypto_reference.h"
#include "randombytes.h"

#ifndef FALSE
#define FALSE 0
#define TRUE (!FALSE)
#endif




/*
   nacl::randombytes names
   nacl::randombytes source ?random|urandom|secrandomcopybytes|cryptgenrandom|default?
   nacl::randombytes lengthValue
   nacl::randombytes box ?-nonce?
   nacl::randombytes scalarmult ?-scalar|-group?
................................................................................
 * timing attacks.
 * 
 * C NaCl also provides a similar crypto_verify_32 function.
 */

// Not implemented for calling from Tcl








static int Tnacl_Info (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) {
  Tcl_SetObjResult(interp, Tcl_NewStringObj(TWEETNACL_VERSION, -1));
  Tcl_Obj *lObjPtr = Tcl_NewListObj(0, NULL);

  Tcl_ListObjAppendElement(interp, lObjPtr, Tcl_NewStringObj("NaCl", -1));
  Tcl_ListObjAppendElement(interp, lObjPtr, Tcl_NewIntObj(20110221));
................................................................................
  Tcl_CreateObjCommand(interp, "::nacl::auth", Tnacl_Auth, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
  Tcl_CreateObjCommand(interp, "::nacl::onetimeauth", Tnacl_OneTimeAuth, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

  // low-level functions
  Tcl_CreateObjCommand(interp, "::nacl::hash", Tnacl_Hash, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

  // information functions

  Tcl_CreateObjCommand(interp, "::nacl::info", Tnacl_Info, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

  Tcl_PkgProvide(interp, PACKAGE_NAME, PACKAGE_VERSION);
  return TCL_OK;
}

#ifdef _WIN32
DECLSPEC_EXPORT
#endif
int Nacl_SafeInit(Tcl_Interp *interp) {
  return Nacl_Init(interp);
}