Logo Search packages:      
Sourcecode: aesfix version File versions  Download package

errvect.h

// Iterates through vectors of a given size and Hamming weight
00002 class ErrorVector {
protected:
  int weight;
  int size;
  int *pos;
  bool done;

public:
  ErrorVector(int w, int s);
  ~ErrorVector();

  // Advances to the next vector
  bool Next();

  // ORs vector with the current iteration
  void Apply(uint8_t *vector);

  // Have we iterated through all vectors?
  bool Done() { return done; }
};

// Iterates through vectors of a given size and Hamming weight
// with fixed 1s at positions containing 1s in the specified vector
// (we use this to iterate through unique vectors that could have
// decayed into a particular vector)
00027 class ErrorVectorUnique : public ErrorVector {
  int *zero;
  bool IsZero(uint8_t *v, int p);

public:
  ErrorVectorUnique(int w, int s, uint8_t *v);
  ~ErrorVectorUnique();
  void Apply(uint8_t *vector);
};

Generated by  Doxygen 1.6.0   Back to index