Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ seed(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

drand48(S)


 seed(S)                        6 January 1993                        seed(S)


 Name

    seed: get_seed, set_seed - obtain or set seed for random number generator

 Syntax


    cc  . . .  -lprot


    #include  <sys/types.h>
    #include  <sys/macro.h>
    #include  <sys/security.h>
    #include  <sys/audit.h>
    #include  <sys/param.h>
    #include  <sys/filsys.h>
    #include  <prot.h>

    long get_seed (prpwd)
    struct pr_passwd *prpwd;

    void set_seed (seed)
    long seed;


 Description

    These routines handle seed management for users of the random number gen-
    erator used in the Authentication subsystem.  They exist to centralize
    control so that multiple seed algorithms can be handled together and so
    that different routines do not all set an initial seed (the randomness
    desired is promoted here).

    The getseed routine uses an automatic seed generation algorithm to
    choose a value to return.  Currently, it does not use the argument prpwd,
    but to be compatible with more secure versions of the system, it should
    pass in the pointer to the user of interest's protected password struc-
    ture.  If no user is relevant to setting the seed, prpwd should be set to
    NULL.

    The setseed routine primes the program's random number generator (using
    drand48(S)) to the seed passed in.  The routine ignores all requests
    except the first one, so that the generator is not reset after its ini-
    tial invocation.

 Return value

    Upon successful completion, the getseed routine  returns an integer
    value calculated by an automatic seed generator.  If an error occurs dur-
    ing seed generation, getseed will return a value of -1.  No return value
    or errors are defined for the setseed routine.

 Notes

    The drand48(S) routines used on an implementation should be tested to
    produce good uniformity, a long period, and a large name space since not
    all ports test for this. Poor performance of these routines translates
    into predictable results in such vital operations as password generation.

 See also

    drand48(S)

 Standards conformance

    The getseed and setseed routines are an extension of AT&T System V pro-
    vided by the Santa Cruz Operation.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026