bn/bn_{mont|exp}.c: switch to zero-padded intermediate vectors.
[openssl.git] / crypto / include / internal / bn_int.h
index 9c984ba78183c247c59b86153b54704fe920b27d..e7fd8992f4f1c39217dce84417f1a3e5ae16ee3b 100644 (file)
 # include <openssl/bn.h>
 # include <limits.h>
 
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
 BIGNUM *bn_wexpand(BIGNUM *a, int words);
 BIGNUM *bn_expand2(BIGNUM *a, int words);
 
@@ -34,8 +30,6 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len);
 
 int bn_get_top(const BIGNUM *a);
 
-void bn_set_top(BIGNUM *a, int top);
-
 int bn_get_dmax(const BIGNUM *a);
 
 /* Set all words to zero */
@@ -66,17 +60,16 @@ void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size);
  */
 int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words);
 
-size_t bn_sizeof_BIGNUM(void);
-
 /*
- * Return element el from an array of BIGNUMs starting at base (required
- * because callers do not know the size of BIGNUM at compilation time)
+ * Some BIGNUM functions assume most significant limb to be non-zero, which
+ * is customarily arranged by bn_correct_top. Output from below functions
+ * is not processed with bn_correct_top, and for this reason it may not be
+ * returned out of public API. It may only be passed internally into other
+ * functions known to support non-minimal or zero-padded BIGNUMs.
  */
-BIGNUM *bn_array_el(BIGNUM *base, int el);
-
-
-#ifdef  __cplusplus
-}
-#endif
+int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+                          BN_MONT_CTX *mont, BN_CTX *ctx);
+int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
+                         BN_CTX *ctx);
 
 #endif