MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / init_perm

Function init_perm

src/common/enc.cpp:914–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912#pragma option_override(init_perm, "opt(level, 0)")
913#endif
914STATIC void
915init_perm(C_block perm[64 / CHUNKBITS][1 << CHUNKBITS],
916 const unsigned char p[64], int chars_out)
917{
918 for (int k = 0; k < chars_out * 8; k++)
919 {
920 // each output bit position
921 int l = p[k] - 1; // where this bit comes from
922 if (l < 0)
923 continue; // output bit is always 0
924 const int i = l >> LGCHUNKBITS; // which chunk this bit comes from
925 l = 1 << (l & (CHUNKBITS - 1)); // mask for this bit
926 for (int j = 0; j < (1 << CHUNKBITS); j++)
927 {
928 // each chunk value
929 if ((j & l) != 0)
930 perm[i][j].b[k >> 3] |= 1 << (k & 07);
931 }
932 }
933}

Callers 1

init_desFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected