# \_FIXVALS\_

*qrpixels:*

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAlFJ8ffdReuzFRxNA7%2F-MAlWP1GrDZneyIu1Stq%2Fimage.png?alt=media\&token=24f71410-ec55-44e4-8262-0bbd77494000)

*create\_card\_with\_face:*

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAkTTsmNseMGdWDSAL3%2F-MAlFE-mmaLY1nx-YziU%2Fimage.png?alt=media\&token=0a5f3ca8-bfbd-4d8a-bdeb-c16f2c14be6d)

```cpp
unsigned char encryptionKey[] = {
  0xf8, 0x0b, 0x95, 0x79, 0x69, 0xd1, 0xe8, 0x60, 0x6c, 0x33, 0x56, 0x00,
  0x76, 0x31, 0xe9, 0x2d, 0x14, 0x79, 0x9d, 0x65, 0x1f, 0x35, 0x0f, 0x89,
  0x87, 0x7c, 0x05, 0xa0, 0x3e, 0xc5, 0xaa, 0x3e
}; // 32

unsigned char signature_skpk[] = {
  0x2d, 0x52, 0xf8, 0x6a, 0xaa, 0x4d, 0x62, 0xfc,
  0xab, 0x4d, 0xb0, 0x0a, 0x21, 0x1a, 0x12, 0x60,
  0xf8, 0x17, 0xc5, 0xf2, 0xba, 0xb7, 0x3e, 0xfe,
  0xd6, 0x36, 0x07, 0xbc, 0x9d, 0xb3, 0x96, 0xee,
  
  0x57, 0xc6, 0x33, 0x09, 0xfa, 0xc2, 0x1b, 0x60,
  0x04, 0x76, 0x4e, 0xf6, 0xf7, 0xc6, 0x2f, 0x28,
  0xcf, 0x63, 0x40, 0xbe, 0x13, 0x10, 0x6e, 0x80,
  0xed, 0x70, 0x41, 0x8f, 0xa1, 0xb9, 0x27, 0xb4
}; // 64
```

*Keys generation:*

```cpp
unsigned char encryptionKey[crypto_aead_chacha20poly1305_IETF_KEYBYTES];
unsigned char signature_skpk[crypto_sign_SECRETKEYBYTES];
unsigned char signature_pk[crypto_sign_PUBLICKEYBYTES];
unsigned char verification_pk[crypto_sign_PUBLICKEYBYTES];

crypto_aead_chacha20poly1305_ietf_keygen(encryptionKey);
crypto_sign_keypair(signature_pk, signature_sk);
crypto_sign_ed25519_sk_to_pk(verification_pk, signature_skpk); 
```

*My debug constants:*

```
signaturekey = Bytes.parseHex("6f5c8615214d20a93fab64f705ee07da9d1356287de231fe25e2ef02c8ea0c1a8bf065b106115f13956ebff29b8cdc33ffc36399122b064d493de19da31fca9a").array();
verificationkeys = Bytes.parseHex("8bf065b106115f13956ebff29b8cdc33ffc36399122b064d493de19da31fca9a").array();

```

```
ed25519_skpk:

6f 5c 86 15 21 4d 20 a9 -> sk
3f ab 64 f7 05 ee 07 da
9d 13 56 28 7d e2 31 fe
25 e2 ef 02 c8 ea 0c 1a
8b f0 65 b1 06 11 5f 13 -> pk
95 6e bf f2 9b 8c dc 33
ff c3 63 99 12 2b 06 4d
49 3d e1 9d a3 1f ca 9a 
```

```
6f5c8615214d20a93fab64f705ee07da9d1356287de231fe25e2ef02c8ea0c1a8bf065b106115f13956ebff29b8cdc33ffc36399122b064d493de19da31fca9a
```

```
x25519_pk:

d8 76 66 29 76 d7 ce 85
65 e9 34 f1 37 6b df b3
b4 d3 07 a4 6d bb cb 78
e7 69 99 e1 df 0c b0 5a  

x25519_sk:

f0 44 85 c4 cc c1 26 71
cd 11 84 dd 49 b5 0e 5d
fd b9 9c a5 ca ab 8b b2
08 2e 9c 5c a3 1d 58 4a
```

The yellow rectangle is the attached signature. The rest is the message.&#x20;

![Attached signature shows content in plain](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAXDcvehHTZAW-fyPP5%2F-MAY0-AlUKpb8sAIwzJC%2Fimage.png?alt=media\&token=04154767-1bf3-4e31-9c00-304b08121e17)

Photo 64/2 via Dlib of manny1.bmp:

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAciaMWN04e_Q7dtOAp%2F-MAcjMb6kxFRO8CwRuTY%2Fimage.png?alt=media\&token=904aab00-df1f-4f3e-b633-fb631c1ddf43)

An `ed25519` secret key:

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAXDcvehHTZAW-fyPP5%2F-MAY9n8PcLn0qeE_xFRj%2Fimage.png?alt=media\&token=2dc03d55-f6c1-424a-b6f7-cb85d857aa49)

AEAD IETF encryption nonce:

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAXDcvehHTZAW-fyPP5%2F-MAYASJsJn4gKJ8KzkSl%2Fimage.png?alt=media\&token=a28eff64-538a-41c8-a006-8d9ad65bf80c)

The encrypted payload:

![AEAD IETF encrypted](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAXDcvehHTZAW-fyPP5%2F-MAYBN3QpO2Xu5IlR0FQ%2Fimage.png?alt=media\&token=587edf23-9f60-4403-a536-d4524d38b99f)

signer pub key:

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAYBWr8dKeFv5JCxEPR%2F-MAYFjukszYNsDUIMrQs%2Fimage.png?alt=media\&token=aaf74e21-e5f6-408c-bd95-223b9baa62e7)

faceArray\[128]:

![manny1.bmp](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAYtY4FzsYSrxXwg92p%2F-MAciNE2I1SR7GEVWbPn%2Fimage.png?alt=media\&token=60eb6353-ab12-40e0-8067-486089ca7ab2)

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAcjmCSFUgjCX990vgB%2F-MAcquHOsdpK3QJH3oPZ%2Fimage.png?alt=media\&token=fb878144-0e44-46e7-bbd8-79c5ad67c2ed)

The top nastiest would be `BitSet + 1` and below is the second:

![](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MAfkzDMr8FeHhZ0PTk1%2F-MAflIQih04gVjV5Qa-L%2Fimage.png?alt=media\&token=b372118d-9c87-45bc-82fd-587c04a26896)

It should be `ret >= 0.0` . The above bug would occur on test cases of exact same photo.&#x20;

**Array file I/O:**

```cpp
unsigned char buf[32];
struct stat st;
  
if (stat("file.dat", &st) == -1) {    
    std::ofstream outfile("file.dat", std::ios::out | std::ios::binary);      
    outfile.write(reinterpret_cast<const char*>(buf), sizeof buf);
    outfile.close();
} else {
    std::ifstream infile("file.dat", std::ios::in | std::ios::binary);  
    infile.read(reinterpret_cast<char*>(buf), sizeof buf);
}
```

C++ random number generation between 4 and 9 inclusive:

```cpp
#include <random>

std::random_device rd;
std::mt19937 re(rd());

std::uniform_int_distribution<int> r_4_9(4, 9);
```

Point Break:

![crash at 2955](https://4095256017-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M98M7KpH7vBLhacf2Yj%2F-MArId5wz0AVlx1UTrXT%2F-MArc27_sLWL20PT9Qkf%2Fimage.png?alt=media\&token=36f0c0fc-fce1-4e0e-b312-2a81e30ee0c2)

But the generated 2954 is no longer readable. The last generated readable is at 2953. ~~Both at **ECC\_LOW** and **ECC\_MEDIUM** have same crashing point and same last readable at 2953.~~

| ECC Level     | **Max bytes len readable** |
| ------------- | -------------------------- |
| ECC\_LOW      | 2953                       |
| ECC\_MEDIUM   | 2331                       |
| ECC\_QUARTILE | 1663                       |
| ECC\_HIGH     | 1273                       |
