1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Implementation of the NIST P-521 curve

This commit is contained in:
Rhys Weatherley
2016-03-26 19:03:31 +10:00
parent c8d7c3153d
commit 9ff24b0ddf
10 changed files with 2928 additions and 5 deletions

View File

@@ -26,9 +26,11 @@
#include "ProgMemUtil.h"
// Number of limbs in a big number value of various sizes.
#define NUM_LIMBS_128BIT (16 / sizeof(limb_t))
#define NUM_LIMBS_256BIT (32 / sizeof(limb_t))
#define NUM_LIMBS_512BIT (64 / sizeof(limb_t))
#define NUM_LIMBS_BITS(n) \
(((n) + sizeof(limb_t) * 8 - 1) / (8 * sizeof(limb_t)))
#define NUM_LIMBS_128BIT NUM_LIMBS_BITS(128)
#define NUM_LIMBS_256BIT NUM_LIMBS_BITS(256)
#define NUM_LIMBS_512BIT NUM_LIMBS_BITS(512)
// The number of bits in a limb.
#define LIMB_BITS (8 * sizeof(limb_t))