Fact-checked by Grok 2 weeks ago

MIRACL

MIRACL (Multiprecision Integer and Rational Arithmetic C/C++ Library) is a software library providing efficient implementations of big integer arithmetic, modular exponentiation, and rational number operations, optimized for cryptographic computations. Developed by Michael Scott at Shamus Software Ltd. in Dublin, Ireland, it originated as a proprietary toolkit in the early 2000s to support the design of big number cryptography systems, including RSA, elliptic curve methods, and pairing-based protocols. The library gained prominence for its portability across platforms, compact footprint suitable for embedded systems, and resistance to side-channel attacks in later iterations, facilitating applications in secure communications, digital signatures, and identity verification. Over time, components evolved into open-source releases, such as MIRACL Core, which extends support to multiple programming languages including C, Go, Rust, and JavaScript, while incorporating post-quantum primitives and standards like BLS signatures and HPKE. Maintained by MIRACL (a company rebranded from CertiVox in honor of the library), it underpins passwordless authentication platforms achieving high success rates through zero-knowledge proofs, though its core remains a foundational tool for developers implementing custom cryptographic schemes.

History

Origins and Early Development

The MIRACL library, an acronym for Multiprecision Integer and Rational Arithmetic Cryptographic Library, was developed by , an Irish cryptographer and former head of computing at . Scott founded Shamus Software Ltd. in 1989 in , , to commercialize cryptographic tools, with MIRACL emerging as its flagship product focused on efficient handling of large-integer arithmetic essential for . The library's inception addressed the computational demands of algorithms like , which require operations on numbers hundreds of digits long, at a time when limitations necessitated optimized software implementations. Early versions of MIRACL, written in C for portability across platforms including DOS, Unix, and early Windows systems, provided core routines for arbitrary-precision addition, multiplication, modular exponentiation, and prime generation. By the mid-1990s, it had evolved into a comprehensive toolkit referenced in academic theses for distributed computing and factoring problems, demonstrating its reliability for high-performance cryptographic simulations. Shamus Software marketed MIRACL as a proprietary library to developers and researchers, emphasizing its speed—often outperforming contemporaries through hand-optimized assembly code for specific architectures—and small footprint suitable for embedded applications. Initial development prioritized undiluted numerical accuracy and causal efficiency in arithmetic primitives, avoiding floating-point approximations in favor of exact integer methods to mitigate errors in cryptographic protocols. This first-principles approach enabled MIRACL to support early implementations by the late 1990s, laying groundwork for its later expansions, though it remained a commercial offering from Shamus until open-sourcing efforts in the .

Contributions to Pairing-Based Cryptography

Michael Scott, chief cryptographer at MIRACL, co-developed the Barreto–Lynn–Scott (BLS) family of pairing-friendly elliptic curves, characterized by embedding degrees of 12, 24, or 48, which facilitate efficient bilinear pairings while supporting large prime-order subgroups for security. These curves, introduced in foundational work on constructing elliptic curves with prescribed embedding degrees, have become staples for protocols requiring compact representations and aggregatable signatures, such as BLS signatures that leverage pairings for verification. In a 2005 paper, Scott demonstrated that ordinary elliptic curves with efficient s—derived from relations to supersingular curves—enable faster pairing computations compared to traditional supersingular approaches, yielding the fastest known at the time for prime-characteristic fields targeting 1024-bit RSA-equivalent security. This optimization exploited distortion maps and endomorphism properties to reduce computational overhead in the Miller loop and final exponentiation phases, influencing subsequent implementations for schemes like Boneh-Franklin IBE. Scott revisited pairing implementations in 2019, proposing a simplified three-stage evaluation that discards outdated optimizations from prior literature, prioritizing practicality for real-world deployment on pairing-friendly curves like BLS12 series. This approach streamlined loop constructions and exponentiations, achieving performance gains through reduced intermediate field operations, and underscored the obsolescence of some early techniques amid refined security models. MIRACL's cryptographic library integrates these innovations via its multi-precision engine, supporting BLS and other pairing-friendly curves (e.g., , KSS) with portable, high-speed routines for bilinear maps, enabling developers to implement advanced schemes including attribute-based and short signatures without custom arithmetic code. The library's emphasis on optimized field arithmetic and curve-specific routines has facilitated benchmarks showing competitive cycle counts for η_T and Ate pairings on embedded and server hardware.

Transition to Open-Source and MIRACL Core

In the early 2000s, the MIRACL library, developed by at Shamus Software Ltd., operated primarily as a C-based multiprecision arithmetic library tailored for cryptographic applications, supporting developers in implementing algorithms like and without public source code availability. By 2011, following Scott's founding of CertiVox (later rebranded as MIRACL), the library maintained its commercial status, emphasizing performance and portability for enterprise use, though it began influencing open standards in pairing-based . This model limited broader adoption in open-source ecosystems, prompting a strategic shift amid growing demands for transparent, auditable in distributed systems. The transition to open-source commenced around 2016 when Scott contributed core from MIRACL to the Apache Milagro project, resulting in the Apache Milagro Cryptographic Library (AMCL), licensed under the Apache 2.0 terms to enable community scrutiny and integration. AMCL focused on and pairing-friendly implementations, inheriting MIRACL's efficient multi-precision engine while addressing side-channel resistance and modularity for resource-constrained environments like devices. This release marked MIRACL's pivot from closed-source exclusivity, allowing free reuse and extension, though it retained some commercial SDK elements under MIRACL's branding for certified deployments. In September 2019, MIRACL Trust launched MIRACL Core (version 4) as an extended, re-released iteration of AMCL, fully open-sourced on to provide a multi-lingual (C, C++, Go, , JavaScript, Python, Java, Swift) cryptographic SDK optimized for modern needs including threshold schemes and post-quantum readiness. Announced at the 2nd International Conference on Blockchain, , and in , MIRACL Core emphasized thread-safety, minimal dependencies, and high performance across architectures, decoupling it from prior proprietary constraints while building on AMCL's foundation for enhanced maintainability and developer accessibility. This evolution facilitated integrations in and protocols, prioritizing verifiable security over .

Technical Architecture

Multi-Precision Arithmetic Engine

The multi-precision arithmetic engine in MIRACL forms the foundational layer for cryptographic computations, enabling operations on integers exceeding the native word size of processors, typically up to thousands of bits for applications like elliptic curve point multiplication and modular exponentiation. It implements a comprehensive set of routines for big integer arithmetic, drawing from established algorithms such as those in Knuth's The Art of Computer Programming (Volume 2, Chapter 4), to ensure portability across platforms without reliance on processor-specific assembly in its core form. The engine supports over 100 functions covering basic operations like addition, subtraction, multiplication, division, and more advanced ones including greatest common divisor computation via the binary Euclidean algorithm and fast modular reduction techniques. Central to the engine are custom data types: big for arbitrary-precision signed integers, represented as an array of limbs (each a fixed-width unsigned integer, typically 28-60 bits depending on configuration to accommodate carries without overflow), and flash for rational numbers using a floating-slash representation to handle fractions with bounded precision loss. A big value is stored in a reduced-radix form, with the base set to $2^{\text{BASEBITS}} (e.g., $2^{29} on 32-bit systems using signed 32-bit limbs, leaving 3 bits for sign and excess), allowing efficient digit-by-digit processing while minimizing normalization overhead. Double-length intermediates like DBIG facilitate multiplication without intermediate reductions, propagating carries column-by-column from right to left. Multiplication employs schoolbook methods for small operands but escalates to Karatsuba recursion for larger ones, reducing time complexity from O(n^2) to O(n^{1.585}) for sufficiently large n, with automatic normalization post-operation. Modular arithmetic is optimized via reduction, converting operands to Montgomery form (where reduction avoids explicit divisions by representing numbers as x \cdot R \mod m, with R = 2^k > m) to accelerate repeated multiplications in ladders, crucial for protocols like Diffie-Hellman . and operate lazily, deferring full until necessary to exploit word excess (e.g., 2-5 bits per limb) for stability and side-channel resistance through constant-time execution patterns. The engine's design prioritizes minimal memory footprint and configurability at compile-time for specific curve sizes (e.g., 256-bit moduli using 9 limbs on 32-bit systems), supporting pseudo-Mersenne, Montgomery-friendly, and general moduli without precomputation tables. This architecture ensures high performance in resource-constrained environments like embedded systems, with benchmarks showing competitive speeds against libraries like GMP for cryptographic workloads, though MIRACL emphasizes over general-purpose bigint use. Division and inversion use or binary shifting for moduli close to powers of two, further tailoring efficiency to pairing-based and elliptic curve schemes.

Data Types and

MIRACL Core employs fixed-size struct-based data types for multi-precision arithmetic, optimized for performance and security in cryptographic contexts. The core BIG struct represents arbitrary-precision integers as an array of chunk elements, where chunks are architecture-dependent integers (typically 32-bit on 32-bit systems or 64-bit on 64-bit systems), with limb configurations tailored to specific curves—such as 29-bit limbs for BIG_256_29 to support efficient Montgomery reduction without overflow. These sizes ensure modular operations remain within hardware word boundaries, reducing computational overhead for curves like BN or BLS. Field elements are handled via the FP struct, which wraps a BIG instance with additional for prime arithmetic, enabling fast reductions and multiplications curve primes (e.g., for BLS48581 or SECP256). points utilize ECP structs containing one or more FP coordinates, supporting affine, projective, or representations depending on the algorithm, while pairing-friendly extensions introduce FP12 or higher-degree extensions for cyclotomic . These types are compile-time parameterized by selection, minimizing runtime overhead and enabling constant-time implementations. Memory management emphasizes stack-based allocation to avoid dynamic usage during sensitive operations, inheriting this design from the Apache Milagro Crypto Library (AMCL) predecessor for native multi-threading and predictability. All temporary variables and intermediates fit within pre-allocated, fixed-size workspaces defined at initialization, preventing fragmentation and timing variations that could leak information via or side-channels. This stack-only approach confines memory footprints to curve-specific bounds (e.g., under 1 per operation for 128-bit security), suiting constrained devices without requiring custom allocators. Dynamic allocation, if any, is limited to library setup and avoided in hot paths, with explicit bounds checking to enforce security invariants.

Supported Algorithms and Primitives

Elliptic Curve Cryptography

MIRACL implements (ECC) as a core component, leveraging its multi-precision arithmetic for operations over finite fields including prime fields GF(p) and binary fields GF(2^m). The library provides efficient primitives such as point addition, point doubling, and , which form the foundation for higher-level protocols. These operations are optimized for performance, with assembly-level accelerations where applicable, enabling deployment on embedded systems like processors. Key protocols supported include the Elliptic Curve Digital Signature Algorithm (ECDSA) for authentication and the Elliptic Curve Diffie-Hellman (ECDH) scheme for key exchange. ECDSA implementations handle signature generation and verification using standardized curves, while ECDH supports ephemeral and static key agreements resistant to common attacks. Scalar multiplication, critical to both, employs algorithms resistant to timing and side-channel vulnerabilities, such as coordinate blinding and randomized projective coordinates. MIRACL supports a range of elliptic curves tailored to different security levels and use cases, including NIST P-160 (SECP160R1) for legacy compatibility, China's SM2 curve for national standards, and X448 for high-security key exchange. Additional curves like C1174 provide options for specific field sizes and embedding degrees. The library facilitates hash-to-curve mappings, such as Elligator and Simplified Shallue-van de Woestijne (SSWU), to securely map arbitrary inputs to curve points for protocols like deterministic signatures. Performance evaluations demonstrate MIRACL's efficiency in ECC operations compared to peers like RELIC, particularly in ElGamal-based schemes and point multiplication on embedded platforms. For instance, implementations on AVR and devices show competitive time and energy costs for point multiplication, underscoring suitability for and resource-limited environments. MIRACL's code emphasizes constant-time execution to mitigate differential power analysis and other physical attacks.

Pairing-Friendly Curves and Advanced Schemes

MIRACL Core implements pairing computations on several pairing-friendly elliptic curves, enabling efficient bilinear s for cryptographic protocols. These include the BN family, such as for prototyping and lower-security applications, and higher-security variants like BN462. BLS curves are also supported, notably BLS12-381 for 128-bit security levels in production use and BLS48-581 for enhanced security against certain attacks. Additionally, curves like C13318 provide options for specialized high-security pairing operations. These curves are selected for their embedding degrees (e.g., 12 for BLS12 series, allowing efficient pairings via Miller's algorithm followed by final exponentiation) and resistance to known attacks, with field sizes calibrated to target security levels from 80 to over 192 bits. The library's pairing engine supports Type-3 pairings (asymmetric, with G1 and of different sizes for optimization), including ate pairings and optimal variants for reduced computation. This facilitates advanced schemes such as Boneh-Lynn-Shacham (BLS) signatures, which aggregate multiple signatures into a single -verifiable value, offering compactness for and threshold applications. MIRACL provides an emerging-standards-compliant BLS , including precomputation for faster verification and support for hash-to-curve functions aligned with IETF drafts. Beyond BLS, the primitives enable (IBE) and protocols like M-Pin, which leverage pairings for zero-knowledge proofs without revealing user secrets. Implementations emphasize constant-time operations to mitigate timing attacks, with optimized for the curves' specific field representations (e.g., form for BLS12-381). Performance benchmarks show pairings on BLS12-381 achieving verification times suitable for resource-constrained environments, though higher-degree curves like BLS48-581 trade speed for security against future quantum threats or novel attacks like exTNFS.

Symmetric and Classical Primitives

MIRACL Core implements symmetric block ciphers, primarily the (AES) with support for 128-bit, 192-bit, and 256-bit key lengths, enabling encryption and decryption operations suitable for confidentiality in various protocols. These implementations are optimized for multi-precision arithmetic integration, allowing seamless use in hybrid cryptographic schemes combining symmetric and asymmetric methods. The library also provides hash functions as foundational primitives for integrity and key derivation, including SHA-256, SHA-384, and SHA-512 from the family, alongside SHA-3 variants for enhanced . These are designed for constant-time execution where applicable, reducing side-channel vulnerabilities in embedded environments. For classical asymmetric primitives, MIRACL includes legacy support for encryption and digital signatures, leveraging its multi-precision engine for over large integers. key generation, encryption, decryption, and signing operations are available, though positioned as transitional for systems not yet migrated to elliptic curve alternatives. The library does not emphasize classical Diffie-Hellman over finite fields, focusing instead on ECC-based for .

Post-Quantum Extensions

MIRACL Core incorporates a post-quantum module designed to support cryptographic primitives resistant to attacks from quantum computers, primarily leveraging lattice-based assumptions such as Ring Learning with Errors (RLWE). This module enables implementations of schemes like post-quantum (IBE), where a trusted generates a for a globally known polynomial A to derive user private keys from identities, such as addresses, without management. The IBE scheme, based on a 2014 proposal by Ducas, Lyubashevsky, and Prest, uses polynomials of degree up to 1024, with public key generation involving B = A·s + e (where s is the master secret and e an error term), ensuring decryption via the trapdoor despite added noise. Performance characteristics highlight the scheme's efficiency for practical deployment: trapdoor generation is computationally intensive and performed once by the authority, while and decryption operations are notably fast due to the optimized in MIRACL's multi-precision engine. Security relies on the hardness of the RLWE problem, which remains unsolved even for quantum adversaries under current computational bounds, distinguishing it from vulnerable methods. Earlier iterations of MIRACL-related libraries, such as AMCL 3.1 released around 2017, included support for NewHope, a (KEM) also grounded in RLWE for hybrid post-quantum . Development of the post-quantum module continues to evolve rapidly in response to ongoing efforts, with MIRACL emphasizing integration across its multi-language bindings (C, C++, , Go, and others) for embedded and server environments. However, as of 2023, the module is not deemed production-ready for widespread adoption, reflecting the nascent stage of post-quantum primitives amid unresolved challenges like larger key sizes and side-channel vulnerabilities in operations. MIRACL's approach prioritizes compatibility with existing pairing-based infrastructure while extending to quantum-safe alternatives, though no native support for NIST-finalized algorithms like or has been documented in releases.

Implementations and Integrations

Core C/C++ Library

The MIRACL Core C/C++ library serves as the foundational implementation for the cryptographic toolkit, written in portable to ensure compatibility across diverse architectures without reliance on assembly code or external dependencies. It provides efficient multi-precision arithmetic operations essential for cryptographic computations, including big integer handling for scalars and points, , and field operations optimized for performance on resource-constrained environments. The library incorporates countermeasures against side-channel attacks, such as constant-time implementations for sensitive operations. Key modules in the C core handle core primitives like elliptic curve point arithmetic, pairing computations on BLS and BN curves, symmetric ciphers (), and hash functions (, ), with support for standards including ECDSA, , BLS signatures, and HPKE. Data types are curve-specific, generated via configuration for popular curves such as NIST P-256, , BLS12-381, and post-quantum options like SIDH. The C++ interface is provided through inline wrappers or generated headers, enabling object-oriented usage while maintaining the underlying C efficiency; for instance, classes wrap C functions for elliptic curve operations. Building the library involves Python 3 scripts in the repository root to select curves, generate platform-specific code, and compile the C sources using standard tools like or ; documentation is generated from the C directory for reference. It supports deployment on embedded platforms including Cortex-M0/M4, , MIPS32, , and , with configurable word sizes (e.g., 32-bit or 64-bit) for memory optimization. Usage typically begins with including generated headers (e.g., ecp_*.h) and linking the compiled libmcl.a or equivalent, as demonstrated in example programs for and signing.

Cross-Language Bindings

MIRACL Core offers native implementations in several programming languages, allowing developers to integrate its directly without relying on foreign function interfaces or wrappers around a single-language . This multi-lingual approach ensures portability, performance consistency, and resistance to side-channel attacks across environments, with all code written in the target language without or third-party dependencies. The supported languages include C, C++, Go, Rust, Python, Java, JavaScript, and Swift. Each implementation is self-contained and includes documentation, such as Doxygen-generated references for C and extensive comments for C++, facilitating ease of adoption in diverse ecosystems. Python bindings, for instance, require Python 3 and come with sample programs for testing elliptic curve operations and pairing-based cryptography. Additionally, MIRACL Core employs code translators to extend support to other languages like C# and WebAssembly, enabling broader cross-platform deployment while maintaining algorithmic fidelity to the original designs. This strategy contrasts with traditional binding mechanisms by prioritizing native compilation for optimal speed and security, as verified through the library's focus on elliptic curve cryptography standards like those in draft-irtf-cfrg-hash-to-curve.

Deployment in Embedded and IoT Environments

MIRACL Core's architecture emphasizes portability and minimal resource demands, making it suitable for deployment on resource-constrained systems and devices. The is written in standard C without assembly code or external dependencies, allowing compilation for diverse architectures including Cortex-M0 and M4 processors, MIPS32, , microcontrollers, and even Arduino-compatible platforms. This agnostic design supports 16-, 32-, and 64-bit processors, enabling seamless integration into devices with limited and , such as sensors and edge nodes typical in networks. Key optimizations for embedded environments include a compact codebase of under 10,000 lines, exclusive use of stack memory to avoid heap allocation overhead, and native multi-threading support without platform-specific locks. These features reduce the overall footprint, facilitating efficient execution of like operations and encryption on low-power hardware. Side-channel resistance is achieved through constant-time algorithms, such as the Montgomery ladder for , minimizing vulnerabilities in timing or power analysis attacks prevalent in embedded deployments. Performance evaluations in contexts, including TLS 1.3 implementations, demonstrate its viability for secure communication protocols on devices like and TinyPICO boards. In practice, MIRACL Core has been integrated into IoT-specific protocols, such as public key infrastructures and credential systems for low-power nodes. Comparative studies of ECC libraries highlight its balanced performance in , signing, and on constrained , though it may exhibit slower compared to specialized alternatives like BearSSL. Deployment typically involves Python-based build scripts to generate platform-tailored libraries, ensuring modularity where only required modules—e.g., for pairing-based schemes or post-quantum extensions—are included to further optimize size and speed. This modular approach supports real-world IoT applications, including secure via M-PIN protocols and efficient handling of pairing-friendly curves for advanced schemes in distributed systems.

Applications and Adoption

Academic and Research Usage

The MIRACL library has been extensively utilized in academic research for implementing and benchmarking (ECC) protocols, particularly in scenarios involving resource-constrained devices such as embedded systems and environments. Researchers leverage its support for , point multiplication, and pairing operations to evaluate performance metrics like execution time, , and scalability. For instance, studies have employed MIRACL to compare ECC scalar multiplication algorithms against alternatives like RELIC, demonstrating its efficiency in handling ElGamal-based schemes on platforms with limited computational resources. In evaluations of on automotive-grade hardware, MIRACL has been benchmarked alongside libraries such as RELIC and , highlighting its suitability for cryptographic primitives requiring compact signatures and bilinear pairings. Similar assessments on embedded platforms, including AVR and microcontrollers, have used MIRACL to quantify time efficiency and energy costs for , informing optimizations for wireless sensor networks and low-power applications. MIRACL's multilingual bindings and focus on curve-based primitives have facilitated research into advanced schemes, such as efficient point operations over finite fields GF(p) and GF(2^m), with implementations tested for ECDH and ECDSA protocols. In deployments, the library supports curve-based across compilers and languages, enabling prototypes for in constrained networks. Additionally, it has been applied in research, including a C++ implementation of the with 2048-bit keys for geospatial data privacy. Further studies on Raspberry Pi-based systems have selected MIRACL for its comprehensive cryptographic toolkit, evaluating viability in scenarios with emphasis on pairing-friendly curves. These applications underscore MIRACL's role as a reliable for reproducible experiments, though researchers often note the need for custom optimizations to address platform-specific variances in performance.

Commercial and Industry Deployments

The MIRACL cryptographic library has seen widespread adoption among hardware manufacturers, serving as the basis for hundreds of closed-source commercial products, particularly in secure embedded systems and devices. Its compact footprint and support for primitives like enable efficient integration in resource-constrained environments, positioning it as a preferred choice for device-level implementations. Notable commercial deployments include integrations by for hardware-accelerated cryptographic operations, for key management solutions, and (now part of Thales) for two-factor authentication systems in smart cards and secure tokens. These applications leverage MIRACL's multi-precision arithmetic capabilities to support standards-compliant algorithms such as , , and Diffie-Hellman, ensuring compatibility with industry security protocols. In government sectors, the U.S. Air Force has incorporated MIRACL into secure computing systems, utilizing its for zero-knowledge proof-based to enhance access controls without exposing credentials. This deployment underscores MIRACL's role in high-stakes environments requiring verifiable , with ongoing support for post-quantum extensions in production settings.

Performance Benchmarks and Comparisons

MIRACL demonstrates competitive performance in operations, particularly for tasks, though it often trails specialized libraries like in compute-intensive scenarios on resource-constrained devices. In benchmarks on a (8GB RAM) using NIST curves (SECP256R1, SECP384R1, SECP521R1) and 200,000 iterations, MIRACL achieved average ECDSA signing times of 2.76 ms and times of 3.25 ms, outperforming BearSSL (20.54 ms signing, 37.43 ms verification) and Libecc (22.76 ms signing, 43.53 ms verification), but lagging behind MbedTLS (1.48 ms signing) and (1.54 ms signing) for generation and signing. matched MIRACL closely in at 3.30 ms. These results position MIRACL as suitable for and checks where speed is prioritized.
LibraryKey Gen (ms)Sign (ms)Verify (ms)
MIRACL7.512.763.25
RELIC1.371.545.16
MbedTLS1.391.485.75
OpenSSL4.014.213.30
On automotive-grade microcontrollers like the Infineon TC297 (300 MHz, 728 KB RAM), RELIC consistently outperformed MIRACL in ECDH and ECDSA operations. For SECP192R1 ECDH, MIRACL required 12.12 ms for key generation and 13.93 ms for shared secret computation, compared to RELIC's 6.36 ms and 15.06 ms, respectively. In BLS operations on BNP256, MIRACL's signing time was comparable at 59.2 ms versus RELIC's 58.4 ms, but verification was significantly slower at 726 ms against 280 ms. WolfSSL trailed both in most tests, such as 46.3 ms ECDSA signing on SECP256R1 versus RELIC's 14.1 ms. For on a T4300 (2.10 GHz, 2 GB RAM, 11.04), MIRACL exhibited higher latencies than RELIC across key sizes and message lengths; with 50 KB messages, 160-bit keys took 9 s on MIRACL versus 3.3 s on RELIC, and 256-bit keys 20.9 s versus 10.6 s. Similar gaps persisted for 100 KB messages (18.1 s vs. 6.6 s for 160-bit). RELIC's optimizations for pairing-friendly curves contribute to these advantages. In computations on a BLS 455-bit curve (1000 iterations), MIRACL's C implementation (64-bit) completed in 9 seconds on an Intel i3, outperforming Java (24 s pseudo-64-bit) and Rust (23 s 32-bit), but far ahead of JavaScript (390 s). This highlights MIRACL's efficiency in native C for advanced schemes, though direct library comparisons for pairings remain limited, with RELIC often favored for pairing-intensive tasks due to lower overhead. Overall, MIRACL balances versatility and speed for general-purpose but yields to RELIC in specialized, high-throughput elliptic curve workloads on constrained hardware.

Criticisms and Limitations

Security Audit and Verification Concerns

The MIRACL Core library, an open-source cryptographic implementation, lacks publicly documented independent third-party security audits or formal verifications as of October 2025. Its security posture relies primarily on developer assertions, code availability for peer review via , and internal design choices aimed at mitigating common cryptographic risks. This approach contrasts with libraries like HACL*, which incorporate machine-checked formal proofs for key primitives, potentially offering stronger guarantees against implementation bugs. To address side-channel vulnerabilities, MIRACL Core incorporates constant-time operations in sensitive routines, such as field arithmetic multiplications and modular inversions, preventing timing variations that could leak secret information through execution time or power consumption. Related implementations, including predecessors like the Milagro Crypto Library, explicitly avoid secret-dependent conditional branches and indexed memory accesses to counter such attacks, with field operations drawing from techniques ensuring uniform execution paths. Hashing-to-curve methods, such as Elligator and SSWU, are also engineered for constant-time behavior to resist exploitation via power analysis or cache timing. Despite these measures, concerns persist regarding unverified edge cases in curve-specific arithmetic or operations, particularly on resource-constrained devices where optimizations might inadvertently introduce timing leaks absent rigorous testing. No CVEs have been issued for MIRACL Core, reflecting an absence of confirmed exploitable flaws in public databases, though this does not preclude undisclosed issues discoverable via targeted or . Users in security-critical deployments, such as consensus protocols where MIRACL variants have been integrated, must conduct reviews, as evidenced by broader audits of Ethereum Beacon clients that scrutinized but did not isolate library-level defects. The library's evolution from proprietary roots to open-source may enhance transparency but introduces risks from incomplete historical scrutiny of legacy code paths.

Performance Trade-offs

MIRACL's permits configurable trade-offs between computational speed and consumption via its build-time configuration options, enabling optimizations tailored to or high-performance environments. For instance, developers can adjust parameters to favor reduced code size and at the expense of slightly slower multiprecision operations, or , as facilitated by the library's utilities. In (ECC) benchmarks on IoT platforms such as the , MIRACL demonstrates a balanced profile for resource-constrained settings, with averaging 7.51 ms—slower than MbedTLS (1.39 ms) or RELIC (1.37 ms)—but efficient signing at 2.76 ms and verification at 3.25 ms, closely rivaling in the latter. Its memory footprint remains low at approximately 75 KB during operations, contrasting sharply with OpenSSL's 600+ KB usage, which renders MIRACL preferable for memory-limited devices despite the key generation penalty. For general large-integer arithmetic underpinning crypto primitives, MIRACL yields medium performance relative to specialized libraries; on a under , 768-bit multiplication requires 71,512 clock cycles, trailing GMP's 17,605 cycles but surpassing 's 78,755 cycles. In over prime fields, it lags across platforms, yet excels in binary field on Windows setups, highlighting platform-specific optimizations that trade broad consistency for targeted efficiency in cryptographic workloads. These characteristics reflect MIRACL's design emphasis on crypto-specific efficiency—favoring compact, constant-time implementations for security-sensitive operations—over versatile big-integer handling, where general-purpose libraries like GMP prioritize raw speed at higher resource costs. In contexts, such as wireless sensor networks, tuned MIRACL deployments achieve superior throughput by minimizing overhead, though they may require custom optimizations to mitigate side-channel vulnerabilities or scaling limitations in non-curve operations.

Alternatives and Competitive Landscape

RELIC is a prominent open-source alternative to MIRACL, functioning as a modular cryptographic meta-toolkit in C with optimizations for efficiency in elliptic curve and pairing-based operations. It supports a wider selection of pairing-friendly curves, enabling implementations for protocols like attribute-based encryption at 128-bit security levels where MIRACL offers fewer options. Performance evaluations on embedded platforms, such as automotive-grade microcontrollers, indicate RELIC achieves comparable or superior execution times to MIRACL for scalar multiplications and pairings, particularly in scenarios involving multiple operations, though results vary by curve and hardware. The PBC library provides another C-based option focused on pairing computations, built atop GMP for to facilitate prototyping of schemes like . Primarily intended for rather than production deployment, PBC prioritizes ease of use over runtime optimization, resulting in slower performance compared to MIRACL or RELIC on equivalent hardware for pairing evaluations. Its maintenance has been less active since around 2012, limiting adoption in modern embedded contexts requiring ongoing updates for new curves or vulnerabilities. General-purpose libraries like wolfSSL and OpenSSL compete indirectly for standard elliptic curve cryptography but lack robust support for bilinear pairings essential to MIRACL's niche in zero-knowledge proofs and BLS signatures. WolfSSL, optimized for embedded TLS, delivers faster basic ECC operations on constrained devices but requires custom extensions for advanced pairing protocols, reducing its suitability as a drop-in replacement. In the competitive landscape, MIRACL differentiates through its historical emphasis on high-speed multi-precision arithmetic for IoT-scale deployments, though RELIC's flexibility appeals to researchers needing customizable arithmetic backends. No dominant commercial rivals exist for specialized pairing libraries, with open-source options prevailing due to the academic roots of the field.

References

  1. [1]
    ‪Michael Scott‬ - ‪Google Scholar‬
    MIRACL–Multiprecision Integer and Rational Arithmetic C/C++ Library. M Scott. Shamus Software Ltd, Dublin, Ireland, URL, 2003. 389*, 2003.
  2. [2]
    miracl
    MIRACL. MIRACL was written by Michael Scott. The MIRACL home page is indigo.ie/~mscott. Sample code using MIRACL: #include <stdio.h> #include "miracl.h" main ...
  3. [3]
    miracl/core: MIRACL Core - GitHub
    MIRACL Core is a multi-lingual and architecturally agnostic cryptographic library that supports elliptic curve cryptography, pairing-friendly curve cryptography ...
  4. [4]
    CertiVox announces Company name change to MIRACL
    London / Dublin / Tokyo. We are excited to announce today that CertiVox has changed its name to MIRACL. As CertiVox, we have grown from a small start-up to ...
  5. [5]
    About MIRACL
    Our name, MIRACL, is an acronym derived from our beloved cryptographic software library: Multiprecision Integer and Rational Arithmetic C/C++ Library.
  6. [6]
    Shamus Software 2025 Company Profile - PitchBook
    When was Shamus Software founded? Shamus Software was founded in 1989. Where is Shamus Software headquartered? Shamus Software is headquartered in Dublin, ...
  7. [7]
    Michael Scott - Technology Innovation Institute | LinkedIn
    Applied cryptographer, inventor, consultant and software developer. Distinguished… · Experience: Technology Innovation Institute · Education: The University ...
  8. [8]
    The MIRACL Core Library | PDF | Cryptography | 64 Bit Computing
    This document summarizes the MIRACL Core cryptographic library. It is designed to be portable, small, and suitable for Internet of Things applications with ...
  9. [9]
    M.I.R.A.C.L. Users Manual: Shamus Software Ltd. 4 Foster Place ...
    The MIRACL library consists of well over 100 routines that cover all aspects of multi-precision arithmetic. Two new data-types are defined - big for large ...
  10. [10]
    [PDF] Distributed Parallel Processing and the Factoring Problem
    Sep 3, 1995 · Occam, developed by INMOS [1NM88], is based around the ideas of ... [Sco95] Scott, Michael, The MIRACL Programming Library, available from:.
  11. [11]
    MIRACL Cryptographic SDK - GitHub
    What is MIRACL? Multiprecision Integer and Rational Arithmetic Cryptographic Library – the MIRACL Crypto SDK – is a C software library that is widely regarded ...MIRACL CoreSign inMiracl/amclkimud6003/MIRACL-raspbianMIRACL Trust Client JS Library
  12. [12]
    Announcing MIRACL Core: A commercially, relevant cryptographic ...
    MIRACL Trust has today launched its new, commercially relevant cryptographic library – MIRACL Core (V4).
  13. [13]
    The Role of Cryptography Then and Now (6 min read) - MIRACL
    Cryptography, a science since the 1940s, is used for encryption and is the original computer application. Public key cryptography was key for the internet, but ...
  14. [14]
    [PDF] Pairing Implementation Revisited - Cryptology ePrint Archive
    Michael Scott. MIRACL.com. May 15, 2019. Abstract. Pairing-based cryptography is ... Pairing-friendly elliptic curves of prime order. In Selected Areas in ...
  15. [15]
    Faster Pairings using an Elliptic Curve with an Efficient Endomorphism
    We illustrate our technique by implementing the fastest pairing algorithm to date (on elliptic curves of prime characteristic) for contemporary levels of ...
  16. [16]
    Pairing Implementation Revisited
    ### Summary of "Pairing Implementation Revisited" by Michael Scott
  17. [17]
    [PDF] Implementation of Pairing-Based Cryptographic Trust Infrastructure ...
    times and RELIC MIRACL library. In both cases, the library. RELIC has better results than MIRACL. According to the above information, it can be confirmed ...
  18. [18]
  19. [19]
    Evolving the MIRACL Core library (4 min read)
    MIRACL Core is an open-source cryptographic library with curve-based cryptography, hashing, AES, RSA, and a post-quantum module, available in 7 languages.
  20. [20]
    The Apache Milagro Crypto Library (Version 2.0) - MIRACL
    The idea is simple – use AMCL as a virtual M-bit machine, where M is the bit length of the supported elliptic curve, and build RSA arithmetic on top of that.
  21. [21]
    [PDF] The Apache Milagro Crypto Library (Version 2.0) - MIRACL
    It is a big ask to develop and maintain multiple versions of a crypto library written in radically different languages such as C, Java, Javascript, Go and.
  22. [22]
    [PDF] Efficient Implementation of Elliptic Curve Point Operations Using ...
    Miracl [7] provides implementations of modular arithmetic and point arithmetic over both. GF(p) and GF(2m) and also supplies sample code for ECDH and ECDSA. In ...
  23. [23]
    Default algorithm for scalar multiplication of elliptic curve points by ...
    Jan 3, 2016 · What is the default algorithm used by the MIRACL-Library [1] for elliptic curve cryptography systems to perform scalar-point multiplication ...Missing: support | Show results with:support
  24. [24]
    [PDF] Performance Evaluation and Comparison of Algorithms for Elliptic ...
    Dec 4, 2011 · Each implementation uses different cryptographic libraries: MIRACL and RELIC. The application of this algorithm meets the common needs of most ...
  25. [25]
    Implementation of elliptic curve cryptography fo… - Biblioteka Nauki
    We have used MIRACL library to compare time efficiency and energy costs of elliptic curve point multiplication on selected AVR and ARM embedded platforms.
  26. [26]
    BLS12381 package - go.bryk.io/miracl/core/BLS12381 - Go Packages
    Dec 26, 2024 · The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go. checked Redistributable license.
  27. [27]
    Crypto Pairing - ASecuritySite.com
    Pairing-based cryptography Identity Based Encryption (IBE) with MIRACL. IBE. IBE Encryption. Signatures. Boneh–Lynn–Shacham (BLS) signature. BLS. Example of BLS ...
  28. [28]
  29. [29]
    Pairing-based cryptography with MIRACL - ASecuritySite.com
    With pairing-based cryptography we have two cyclic groups (G1 and G2), and which are of an order of a prime number (n). A pairing on (G1,G2,GT) defines the ...<|separator|>
  30. [30]
    M-Pin: A Multi-Factor Zero Knowledge Authentication Protocol
    be created and PIN guesses can be tested against it. However the ... WA Technology Announces new Partnership with MIRACL23 Sep, 2024 by MIRACL; A ...<|separator|>
  31. [31]
    [PDF] On the Deployment of curve based cryptography for the Internet of ...
    We use our MIRACL Core multilingual library3. This library is written in multiple languages, which brings some advantages, as each language and com- piler has ...
  32. [32]
    Developer Resources - MIRACL
    MIRACL Core is a multi-lingual and architecturally agnostic Cryptographic library that supports elliptic curve cryptography, pairing-friendly curve cryptography ...
  33. [33]
    Post Quantum Identity Based Encryption - MIRACL
    Now here at MIRACL we are big believers in Identity Based Cryptography (IBC). One of the pillars of IBC is IBE – Identity Based Encryption. And the big idea ...
  34. [34]
    miracl/amcl - GitHub
    AMCL is a multi-lingual Cryptographic library that supports elliptic curve cryptography, pairing-friendly curve cryptography, RSA, AES symmetric encryption and ...
  35. [35]
    pfecCwrapper - lib - miracl-core-c - readme.md - GitLab
    Sep 15, 2022 · So for example to support both ED25519 and the NIST P256 curve on a 64-bit processor, we would need to create BIG_256_56, FP_25519, ECP_ED25519 ...<|separator|>
  36. [36]
    [PDF] On TLS for the Internet of Things, in a Post Quantum world
    In our implementation the default SAL uses the MIRACL Core library 2, as it supports most of the cryptography required by TLS1.3 in both C++ and Rust, and ...
  37. [37]
    Lightweight public key infrastructure for the Internet of Things
    The ECIOT protocol has been implemented on the MIRACL cryptography library. Nevertheless, the article fails to provide a security and a performance analysis ...
  38. [38]
    [PDF] PERFORMANCE COMPARISON OF ECC LIBRARIES FOR IOT ...
    Jun 28, 2024 · Performance evaluation and comparison of algorithms for elliptic curve cryptography with El-Gamal based on MIRACL and RELIC libraries. Journal ...<|separator|>
  39. [39]
    Performance Evaluation and Comparison of Algorithms for Elliptic ...
    ... To make it more understandable, MIRACL algorithms are very efficient for scalar multiplication, point addition, and digital signature generation. The ...
  40. [40]
    Performance Evaluation of Elliptic Curve Libraries on Automotive ...
    In this work we carry a performance evaluation on some modern libraries, e.g., MIRACL, RELIC, and compare them to the more classical WolfSSL. The evaluation is ...<|separator|>
  41. [41]
    Geospatial cryptography: enabling researchers to access private ...
    We implemented the Paillier cryptosystem in C++ using the MIRACL software library using current recommended minimum key length |n| = 2048 bits (Barker and ...
  42. [42]
    [PDF] Evaluating elliptic curve cryptography in constrained environments
    In order to perform cryptographic operations, we used the MIRACL [42, 58, 59] library on a Raspberry Pi 4 Model B and chose this library as it provides ...
  43. [43]
    MIRACL Core Library - ASecuritySite.com
    MIRACL Core is an open-source library with public key encryption methods, focused on elliptic curve and pairing-friendly methods, supporting C, C++, Go, Rust, ...
  44. [44]
    MIRACL, NTT i3 and NTT Labs Contribute Essential Elements for ...
    May 11, 2016 · Vancouver, B.C. Canada. May 11 2016. Leading into one of The Apache Software Fo...
  45. [45]
    [PDF] Performance Evaluation of Elliptic Curve Libraries on Automotive ...
    Aug 29, 2019 · The Diffie-Hellman key exchange is ... More expensive, public-key primitives, including pairing-based primitives, have been accounted.<|separator|>
  46. [46]
    Another Computer Language Comparison - MIRACL
    The library does a lot of very complex all-integer calculations. Perhaps the most complex calculation is of the “pairing” itself. Indeed the viability of ...
  47. [47]
    [PDF] HACL: A Verified Modern Cryptographic Library
    Formal verification has been successfully used on large security-critical software systems like the CompCert C compiler [31] and the sel4 operating system ...Missing: MIRACL | Show results with:MIRACL<|separator|>
  48. [48]
    Ed3363 (HighFive) – An alternative Elliptic Curve - MIRACL
    We propose a new Elliptic curve at a security level significantly greater than the standard 128 bits, that fills a gap in current proposals while bucking ...
  49. [49]
  50. [50]
    [PDF] Security Review of Ethereum Beacon Clients
    ... MIRACL11 for other architectures (including ARM Cortex-. M0 ... tracking issues reported by the two audits as well as proposed improvements16. Audits. In October ...
  51. [51]
  52. [52]
    [PDF] Comparative Analysis of Software Libraries for Public Key ...
    Under Pentium. IV, Windows XP, MIRACL has the best performance. CryptoPP is the slowest under all platforms. • Support for E(F p. ) ...Missing: big | Show results with:big
  53. [53]
    [PDF] Testing the Limits of Elliptic Curve Cryptography in Sensor Networks
    We have optimized MIRACL library to achieve the best. ECC performance on our WSN motes. Different Elliptic Curve Cryptography implementations for sensor ...
  54. [54]
    [PDF] Attacking embedded ECC implementations through cmov side ...
    Jul 18, 2016 · We stop the attack as soon as the time-memory trade-off technique succeeds for one trace. Since we are running the attack n times in parallel ...
  55. [55]
    relic-toolkit/relic: Code - GitHub
    RELIC is a modern research-oriented cryptographic meta-toolkit with emphasis on efficiency and flexibility. RELIC can be used to build efficient and usable ...
  56. [56]
    PBC Library - Pairing-Based Cryptography - About
    This tutorial shows how to implement a pairing-based cryptosystem in a few lines using the PBC library. MIRACL Core. I started the PBC library decades ago, for ...
  57. [57]
    blynn/pbc: The Pairing-based Crypto library - GitHub
    The PBC (Pairing-Based Crypto) library is a C library providing low-level routines for pairing-based cryptosystems.
  58. [58]
    Does PBC (pairing-based cryptography library) support curve25519?
    Jul 25, 2017 · Curve25519 is not pairing-friendly. There are two famous libraries about pairing: MIRACL and pbc.
  59. [59]
    [PDF] Comparative Analysis of Cryptography Library in IoT - arXiv
    xiii. MIRACL: Multiprecision Integer and Rational Arithmetic C Library (MIRACL) is a cryptography library designed for use in constrained environment in terms ...