TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by Gabriel Handford.
BigNum library for Objective-C. Uses OpenSSL.
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects.
platform :ios, "7.0"
pod "GHBigNum"
This only includes a few bignum methods that I needed, so its still a work in progress.
GHBigNum *a = [GHBigNum bigNumWithDecimalString:@"3487438743234789234879"];
GHBigNum *p = [GHBigNum bigNumWithDecimalString:@"22"];
GHBigNum *m = [GHBigNum bigNumWithDecimalString:@"43234789234880"];
GHBigNum *r = [GHBigNum modPow:a p:p m:m];
GHBigNum *a = [GHBigNum bigNumWithDecimalString:@"3487438743234789234879"];
GHBigNum *m = [GHBigNum bigNumWithDecimalString:@"743234789234880"];
GHBigNum *r = [GHBigNum modInverse:a m:m];
GHBigNum *bn = [GHBigNum generatePrime:512];
[bn isPrime]; // YES