bglibs
Macros | Functions
crypto: Cryptographic routines

Macros

#define SURF_OUT_U32   8
 
#define SURF_IN_U32   12
 
#define SURF_SEED_U32   32
 
#define SURF_OUT   32
 
#define SURF_IN   48
 
#define SURF_SEED   128
 

Functions

void surf (uint32 out[8], const uint32 in[12], const uint32 seed[32])
 

Detailed Description

Macro Definition Documentation

◆ SURF_IN

#define SURF_IN   48

The number of bytes used as input by surf

◆ SURF_IN_U32

#define SURF_IN_U32   12

The number of 32-bit words used as input by surf

◆ SURF_OUT

#define SURF_OUT   32

The number of bytes output by surf

◆ SURF_OUT_U32

#define SURF_OUT_U32   8

The number of 32-bit words output by surf

◆ SURF_SEED

#define SURF_SEED   128

The number of bytes used as seed data by surf

◆ SURF_SEED_U32

#define SURF_SEED_U32   32

The number of 32-bit words used as seed data by surf

Referenced by surfrand_init().

Function Documentation

◆ surf()

void surf ( uint32  out[8],
const uint32  in[12],
const uint32  seed[32] 
)

Simple Unpredictable Random Function

This function converts a 384-bit input into a 256-bit output, given a 1024-bit seed k. When k is secret and uniformly selected, surf(k) seems to be indistinguishable from a uniformly selected 384-bit-to-256-bit function.

See http://cr.yp.to/papers/surf.ps This implementation was derived from this paper and from dns_random.c from djbdns-1.05, which was made public domain as per http://cr.yp.to/distributors.html on 2007-12-28.

References obuf_endl(), obuf_putxw(), outbuf, str::s, and surf().

Referenced by surf().