Elliptic curves over GF(p), new BIGNUM functions, Montgomery re-implementation.
[openssl.git] / crypto / bn / bn_modfs.h
diff --git a/crypto/bn/bn_modfs.h b/crypto/bn/bn_modfs.h
new file mode 100644 (file)
index 0000000..b7ae496
--- /dev/null
@@ -0,0 +1,32 @@
+/*\r
+ *\r
+ *     bn_modfs.h\r
+ *\r
+ *     Some Modular Arithmetic Functions.\r
+ *\r
+ *     Copyright (C) Lenka Fibikova 2000\r
+ *\r
+ *\r
+ */\r
+\r
+#ifndef HEADER_BN_MODFS_H\r
+#define HEADER_BN_MODFS_H\r
+\r
+\r
+#include "bn.h"\r
+\r
+#ifdef BN_is_zero\r
+#undef BN_is_zero\r
+#define BN_is_zero(a)  (((a)->top == 0) || (((a)->top == 1) && ((a)->d[0] == (BN_ULONG)0)))\r
+#endif /*BN_is_zero(a)*/\r
+\r
+\r
+int BN_smod(BIGNUM *rem, BIGNUM *m, BIGNUM *d, BN_CTX *ctx);\r
+int BN_mod_sub(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *m, BN_CTX *ctx);\r
+int BN_mod_add(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *m, BN_CTX *ctx); \r
+int BN_mod_sqr(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx);\r
+int BN_swap(BIGNUM *x, BIGNUM *y);\r
+int BN_legendre(BIGNUM *a, BIGNUM *p, BN_CTX *ctx);\r
+int BN_mod_sqrt(BIGNUM *x, BIGNUM *a, BIGNUM *p, BN_CTX *ctx);\r
+\r
+#endif
\ No newline at end of file