• PBC Library Manual
  • Preface
  • 1. Installing PBC
  • 2. Quick Start
    • Playing with Pairings
  • 3. PBC Basics
    • Headers and Libraries
    • Types
    • Function Classes
    • Conventions
  • 4. Tutorial
    • BLS Signatures
    • Import/Export
  • 5. Pairing Functions
    • Initializing Pairings
    • Applying Pairings
    • Other Pairing Functions
    • Element Functions
    • Initializing Elements
    • Assigning Elements
    • Converting Elements
    • Element Arithmetic
    • Exponentiating Elements
    • Comparing Elements
    • I/O of Elements
    • Random Elements
    • Element Import/Export
  • 6. Param Functions
    • Type A
    • Type A1
    • Type D
    • Type E
    • Type F
    • Type G
  • 7. Randomness Functions
  • 8. Custom Allocation
  • 9. Bundled Programs
    • Pairing-Based Calculator
    • Parameter Generation
    • Example Cryptosystems
    • Benchmarks
  • 10. PBC Internals
    • Design
    • Internal Randomness
    • Type A Internals
    • Type D Internals
    • Type E Internals
    • Type F Internals
    • Source Code
    • Religious Stances
  • 11. Security Issues
    • Truncated Hashes
    • Zeroed Memory
    • PRNG Determinism
  • A. Contributors
  • PBC Library Manual
  • Preface
  • 1. Installing PBC
  • 2. Quick Start
    • Playing with Pairings
  • 3. PBC Basics
    • Headers and Libraries
    • Types
    • Function Classes
    • Conventions
  • 4. Tutorial
    • BLS Signatures
    • Import/Export
  • 5. Pairing Functions
    • Initializing Pairings
    • Applying Pairings
    • Other Pairing Functions
    • Element Functions
    • Initializing Elements
    • Assigning Elements
    • Converting Elements
    • Element Arithmetic
    • Exponentiating Elements
    • Comparing Elements
    • I/O of Elements
    • Random Elements
    • Element Import/Export
  • 6. Param Functions
    • Type A
    • Type A1
    • Type D
    • Type E
    • Type F
    • Type G
  • 7. Randomness Functions
  • 8. Auxiliary Functions
    • Dynamic Arrays
    • Symbol Tables
  • 9. Custom Allocation
  • 10. Bundled Programs
    • Pairing-Based Calculator
    • Parameter Generation
    • Example Cryptosystems
    • Benchmarks
  • 11. PBC Internals
    • Design
    • Internal Randomness
    • Type A Internals
    • Type D Internals
    • Type E Internals
    • Type F Internals
    • Source Code
    • Religious Stances
  • 12. Security Issues
    • Truncated Hashes
    • Zeroed Memory
    • PRNG Determinism
  • A. Contributors
  • PBC Library Manual
  • Preface
  • 1. Installing PBC
  • 2. Quick Start
    • Playing with Pairings
  • 3. PBC Basics
    • Headers and Libraries
    • Types
    • Function Classes
    • Conventions
  • 4. Tutorial
    • BLS Signatures
    • Import/Export
  • 5. Pairing Functions
    • Initializing Pairings
    • Applying Pairings
    • Other Pairing Functions
    • Element Functions
    • Initializing Elements
    • Assigning Elements
    • Converting Elements
    • Element Arithmetic
    • Exponentiating Elements
    • Comparing Elements
    • I/O of Elements
    • Random Elements
    • Element Import/Export
  • 6. Param Functions
    • Type A
    • Type A1
    • Type D
    • Type E
    • Type F
    • Type G
  • 7. Randomness Functions
  • 8. Auxiliary Functions
    • Dynamic Arrays
    • Symbol Tables
  • 9. Custom Allocation
  • 10. Bundled Programs
    • Pairing-Based Calculator
    • Parameter Generation
    • Example Cryptosystems
    • Benchmarks
  • 11. PBC Internals
    • Design
    • Internal Randomness
    • Type A Internals
    • Type D Internals
    • Type E Internals
    • Type F Internals
    • Source Code
    • Religious Stances
  • 12. Security Issues
    • Truncated Hashes
    • Zeroed Memory
    • PRNG Determinism
  • A. Contributors
  • PBC Library Manual
  • Preface
  • 1. Installing PBC
  • 2. Quick Start
    • Playing with Pairings
  • 3. PBC Basics
    • Headers and Libraries
    • Types
    • Function Classes
    • Conventions
  • 4. Tutorial
    • BLS Signatures
    • Import/Export
  • 5. Pairing Functions
    • Initializing Pairings
    • Applying Pairings
    • Other Pairing Functions
    • Element Functions
    • Initializing Elements
    • Assigning Elements
    • Converting Elements
    • Element Arithmetic
    • Exponentiating Elements
    • Comparing Elements
    • I/O of Elements
    • Random Elements
    • Element Import/Export
  • 6. Param Functions
    • Type A
    • Type A1
    • Type D
    • Type E
    • Type F
    • Type G
  • 7. Randomness Functions
  • 8. Auxiliary Functions
    • Dynamic Arrays
    • Symbol Tables
  • 9. Custom Allocation
  • 10. Bundled Programs
    • Pairing-Based Calculator
    • Parameter Generation
    • Example Cryptosystems
    • Benchmarks
  • 11. PBC Internals
    • Design
    • Internal Randomness
    • Type A Internals
    • Type D Internals
    • Type E Internals
    • Type F Internals
    • Source Code
    • Religious Stances
  • 12. Security Issues
    • Truncated Hashes
    • Zeroed Memory
    • PRNG Determinism
  • A. Contributors
  • PBC Library Manual
  • Preface
  • 1. Overview
  • 2. Installing PBC
  • 3. Quick Start
    • Playing with Pairings
  • 4. PBC Basics
    • Headers and Libraries
    • Types
    • Function Classes
    • Conventions
  • 5. Tutorial
    • BLS Signatures
    • Import/Export
  • 6. Pairing Functions
    • Initializing Pairings
    • Applying Pairings
    • Other Pairing Functions
    • Element Functions
    • Initializing Elements
    • Assigning Elements
    • Converting Elements
    • Element Arithmetic
    • Exponentiating Elements
    • Comparing Elements
    • I/O of Elements
    • Random Elements
    • Element Import/Export
  • 7. Param Functions
    • Type A
    • Type A1
    • Type D
    • Type E
    • Type F
    • Type G
  • 8. Randomness Functions
  • 9. Auxiliary Functions
    • Dynamic Arrays
    • Symbol Tables
  • 10. Custom Allocation
  • 11. Bundled Programs
    • Pairing-Based Calculator
    • Parameter Generation
    • Example Cryptosystems
    • Benchmarks
  • 12. PBC Internals
    • Design
    • Internal Randomness
    • Type A Internals
    • Type D Internals
    • Type E Internals
    • Type F Internals
    • Source Code
    • Religious Stances
  • 13. Security Issues
    • Truncated Hashes
    • Zeroed Memory
    • PRNG Determinism
  • A. Contributors

Random Elements

Only works for finite algebraic structures. Effect on polynomial rings, fields of characteristic zero, etc. undefined.

See the chapter on randomness functions on where PBC gets random bits from and how to select a different source of random bits.

void element_random(element_t e)

If the e lies in a finite algebraic structure, assigns a uniformly random element to e.